Set . In polar coordinates, the event is , the angular sector
Because has the continuous uniform distribution on an interval of length , the probability is the sector's angular length divided by :
The symmetry of the standard normal distribution in makes the lower sector equally likely. Their disjoint union is , apart from , an event of probability zero. Therefore the requested cumulative distribution function is
This is the unit-scale half-Cauchy distribution. At there is no atom, and as the cumulative distribution function tends to one.
Figure 1.
Gaussian angular probability and the support of a transformed exponential pair
. Details.
The left panel uses , giving a sector of angle and probability . The right panel displays the domain for the next change of variables for probability densities; a vertical section through it determines the conditional range.
Taking the transpose gives , so is a symmetric matrix. For , has the standard normal distribution, whereas has the normal distribution . Distinct upper-triangular entries depend on disjoint sets of the original independent random variables, so they remain independent.
Consequently the joint probability density function, relative to , is
Here because is a symmetric matrix. This is the Gaussian orthogonal ensemble, with off-diagonal variance one and diagonal variance two; the rescaled matrix has the corresponding off-diagonal variance.
We will also use its entry covariance. Expanding in the independent entries of , for which , gives
The symbols are Kronecker deltas. This formula includes the diagonal case, where the two terms both contribute.
The matrix is invertible almost surely. Indeed, successively sampled Gaussian columns have probability zero of lying in the proper linear subspace spanned by the previous columns. Thus the diagonal signs used above exist with probability one. Equivalently, apply the Gram-Schmidt process to the columns, always dividing each residual by its positive Euclidean norm; this produces directly.
To prove uniformity, fix . Each column of has density proportional to , so orthogonal transformations preserve its probability distribution. Column independence therefore gives .
The QR decomposition with positive diagonal is unique: if , then is both an orthogonal matrix and an upper triangular matrix, hence diagonal with entries . Its diagonal entries are positive, so it is the identity. It follows that the orthogonal factor of is . Therefore
By uniqueness of normalized Haar measure on the compact group , the returned matrix has exactly the required probability distribution. Reflection invariance gives each determinant sign probability , so the algorithm samples both components of the orthogonal group. The positive-diagonal correction is essential when a numerical QR decomposition chooses its own signs.
Write . The two multivariate normal distribution probability density functions have ratio
Here is the Euclidean norm. Consequently the smallest rejection sampling envelope constant, and its acceptance probability, are
The supremum is attained at ; hence no smaller constant can dominate the ratio. Draw and an independent from the uniform distribution on . Accept when
otherwise repeat with fresh independent random variables. One can generate using a random vector with independent standard normal distribution coordinates.
For any measurable set , the joint acceptance probability is . Dividing by proves that the returned random vector has probability density function . The number of proposals has a geometric distribution on the positive integers, with expected value . When , every proposal is accepted.
The moment-generating function of a standard normal distribution gives . Using independence of the coordinates,
The accepted draws are independent and identically distributed random variables, so their sample mean is an unbiased estimator and has variance
This counts accepted draws, requiring proposals in expectation.
At equal sample count, rejection sampling eventually has smaller variance for fixed ; at equal expected proposal cost, importance sampling eventually wins. The distinction matters because a sample of the rejection sampling estimator means an accepted draw.
For the importance sampling estimator, all coordinates contribute to the importance weight although only one enters the integrand. The same normal distribution transform as in (c), now with linear coefficient for coordinate one, gives
Both estimators are unbiased estimators of , and
For fixed , the first variance grows exponentially while the second stays constant. This is the benefit of returning exact target draws in rejection sampling. However, obtaining those draws costs proposals each on average.
To compare computational work, multiply each variance by its expected proposal count. For importance sampling that count is ; for rejection sampling it is . The ratio of the resulting cost-normalized variances is
because . Thus importance sampling eventually gives better precision for the same expected number of proposals, assuming comparable work per proposal. This is an asymptotic cost comparison, not a guarantee that a fixed small computing budget produces any accepted draws. Both methods still deteriorate exponentially in this comparison. For they coincide and every proposal is accepted.
Figure 1.
Sample-count and expected-proposal-cost comparisons for the one-coordinate integrand at sigma squared equal to two
. Details.
A practical improvement is to exploit the integrand's one-coordinate structure directly: average for standard normal distribution draws , without generating unused coordinates. The optimal change of proposal distribution in (iii) improves further.
Let and , evaluated from the given polylogarithm formulas. Generate a large sample of independent and identically distributed random variables with r_sample_f, and compute its sample mean and sample variance using mean and var. The central limit theorem gives the first standardized check:
For the second check, the correct asymptotic variance of the sample variance involves the fourth central moment :
The denominator is not unless the probability distribution has the requisite fourth central moment, as does the normal distribution. Here the probability density function decays exponentially, so all required moments are finite.
To compute , expand the denominator of the probability density function as a geometric series and integrate each nonnegative term. The gamma function integral gives the raw moments
Thus and . The following R code implements both checks for chosen interior parameters and large n:
p <- 0.4
beta <- 1.3
n <- 100000
raw_m <- vapply(1:4, function(j) {
  -factorial(j) * polylog(j + 1, 1 - p) / (beta^j * log(p))
}, numeric(1))
m <- raw_m[1]
v <- raw_m[2] - m^2
mu4 <- raw_m[4] - 4 * m * raw_m[3] +
  6 * m^2 * raw_m[2] - 3 * m^4
x <- r_sample_f(n, p, beta)
c(mean_check = sqrt(n) * (mean(x) - m) / sqrt(v),
  variance_check = sqrt(n) * (var(x) - v) / sqrt(mu4 - v^2))
For each check separately, an absolute value below is consistent with its approximate confidence interval. Repeat with many independent samples: the two standardized statistics should each resemble a standard normal distribution, with about outside that range. Also vary , and n; a systematic discrepancy that grows with suggests a bias. The two checks from the same sample are generally dependent, so passing both is not itself a joint statement, nor can a finite test prove that a generator is correct.
The second central limit theorem follows from the central limit theorem for the sample variance: differs by a quantity tending to zero in probability from .
Assume and a current state with , . The unnormalized posterior density is
Thus the log-posterior, up to an additive constant, is the log-likelihood plus the beta distribution and exponential distribution log prior densities. The exponential distribution rate is , since is its mean. [ref] [ref]
Choose a symmetric joint random-walk Metropolis algorithm proposal: and , for independent standard normal distribution draws. Its scale depends only on fixed hyperparameters, so forward and reverse proposal probability density functions agree. Reject immediately outside ; otherwise accept with Metropolis–Hastings acceptance probability
The following function makes exactly one proposal, with rejection retaining both old parameters:
MHstep <- function(x, p, beta, a, b, mu) {
  p_new <- rnorm(1, mean = p, sd = 0.1)
  beta_new <- rnorm(1, mean = beta, sd = mu / 2)
  if (p_new <= 0 || p_new >= 1 || beta_new <= 0)
    return(list(p = p, theta = beta))
  logpost <- function(pp, bb) {
    ll_f(pp, bb, x) + dbeta(pp, a, b, log = TRUE) +
      dexp(bb, rate = 1 / mu, log = TRUE)
  }
  logA <- logpost(p_new, beta_new) - logpost(p, beta)
  if (log(runif(1)) <= min(0, logA)) {
    p <- p_new
    beta <- beta_new
  }
  list(p = p, theta = beta)
}
The returned field theta contains the updated value of beta. The original PDF really asks for p and theta, although no parameter is defined in this question. This choice preserves its literal interface while making the intended second parameter explicit. A caller therefore advances with state <- MHstep(x, p, beta, a, b, mu), p <- state$p, and beta <- state$theta.
The proposal is an unrestricted symmetric normal distribution followed by rejection outside the support. Repeatedly drawing until a valid proposal appears would instead truncate and renormalize the proposal, requiring a proposal-density correction. The code uses immediate rejection and needs no such correction. The displayed scales are valid fixed choices; practical efficiency can be improved using a separate tuning phase.
The central limit theorem gives , so, with the cumulative distribution function of the standard normal distribution,
The error has two tails. Using the supplied quantile, whose two-sided coverage is approximately , gives
The supplied quantile would be appropriate for a one-sided calculation; it would give only approximately two-sided coverage. Using the exact quantile instead of would give draws; we consistently use the paper's rounded value below.
For routine Monte Carlo integration, the central limit theorem calculation is preferable as a practical budget: it uses about one fifteenth as many draws as the Chebyshev's inequality bound. However, its coverage is approximate. Finite variance alone supplies no universal rate of convergence to the normal distribution; an integrand with large skewness or a heavy-tailed distribution can make the approximation poor even at a large sample count. If an unconditional finite-sample guarantee is required under only the stated assumptions, use the Chebyshev's inequality budget.
The proposal's normalization of a probability distribution is
This is the Laplace distribution with location zero and scale one. For example, generate its magnitude from the exponential distribution with rate one and give it an independent fair sign. The target is the standard normal distribution, with .
To obtain the tight envelope, let . By completing the square,
Equality occurs at , so is the smallest valid envelope constant. It maximizes the acceptance probability for this fixed proposal. The supplied lower bound must be clipped at zero to satisfy the algorithm's nonnegativity requirement:
This is valid because for , while is everywhere positive. Its support is .
Here is the fully specified squeeze rejection sampling procedure. Draw with probability density function , independently draw , and compute and . If , return immediately. Otherwise evaluate , independently draw , and return if . On rejection restart with fresh draws. In this example everywhere, so the residual denominator is positive.
Avoiding a target evaluation means accepting at the first test. Its unconditional probability for one proposal is
For comparison, the overall acceptance probability is . The first-stage saving is the fraction of proposals requiring no target evaluation, including both eventual accepted and rejected proposals in the denominator; it is not conditional on acceptance.
Let , where is the standard normal distribution's cumulative distribution function. Statistical consistency and Slutsky's theorem allow replacement of by :
Thus the probability that this standardized estimation error lies between and tends to . Rearranging gives the Wald confidence interval
The coverage probability is approximate, with limiting value ; it is a repeated-sampling statement about the random confidence interval.
The sample mean has mean and variance . The central limit theorem gives a normal approximation for interior when both expected binomial counts are sufficiently large. Under the null hypothesis, a level- upper-tail cutoff is approximately
To obtain the power function, evaluate this same cutoff under the true statistical parameter , standardizing with :
Here is the standard normal distribution's cumulative distribution function. The formula treats the binomial threshold as continuous; exact integer cutoffs and boundary randomization are finite-sample refinements.
First establish the limiting law needed by the delta method. For fixed , put and let count how many of the are at most . Then has a binomial distribution with expectation and variance . The event is exactly . Its standardized threshold tends to , so the central limit theorem for these binomial counts gives
Here is the cumulative distribution function of the standard normal distribution. Equivalently,
Use the usual local regularity for the delta method: is continuous at the population median and . The inverse function theorem, applied at , gives
Therefore
The asymptotic normality gives the requested leading variance approximation
Here the variance parameter for the rescaled limiting law is , while the source states the corresponding approximation for the unscaled estimator. Strict increase of alone does not force ; that local condition is needed for this form of the asymptotic distribution of a sample median.
The denominator is positive, so
Strict increase of the standard normal distribution function turns this into . Since the coefficient multiplying in is positive, the rejection rule is precisely , with
The quantile is approximately . Equivalently, the rule requires posterior probability of below , because its prior odds are one. The calculation is an instance of the Bayes factor for the sign of a normal mean.
Under the null hypothesis, the full model has two free positive statistical parameters and the constrained model has one. The Wilks theorem therefore gives
as both sample sizes tend to infinity, with tending to a number strictly between zero and one. For the observed , calculate
The large-sample p-value is the upper-tail probability
where is the cumulative distribution function of the standard normal distribution. The last equality uses the fact that the square of a standard normal random variable has a chi-squared distribution with one statistical degree of freedom. Values of on either side of are already included by the transformation to .
Condition on the total of 400 complaints. Assume each complaint independently has the same probability of being received on Monday; in particular, repeated complaints from one incident must not create material dependence. The Monday count then has a binomial distribution with parameters . Test against , rejecting for large as suggested by the monotone likelihood ratio.
Under the null hypothesis, and . Both expected successes and expected failures are large, so the central limit theorem gives a suitable normal approximation:
Using the paper's supplied rounded table, the upper-tail p-value is approximately
A more accurate evaluation of the standard normal distribution cumulative distribution function gives about 0.0062. For example, choose significance level 0.05 before examining the data; the supplied upper 5% standard normal quantile is approximately 1.6, and . Reject at 5%, and also at 1%, using this approximation. The observed binomial proportion is , providing evidence that the Monday probability exceeds 0.2 under the sampling assumptions.
If applying a continuity correction, approximate by ; this gives the same 5% and 1% conclusions. The uncorrected value 0.005 is approximate, so a decision exactly at the 0.5% boundary is not warranted by the supplied rounded table.
Put . As a linear combination of independent normal random variables under the posterior distribution,
The shortest 95% credible interval is
Here is the standard normal distribution cumulative distribution function. To justify shortest length, consider all intervals of a fixed length . If is this normal distribution posterior density, the interval probability has derivative with respect to . The normal distribution is symmetric and its density strictly decreases with distance from its mean, so this probability is uniquely maximized when the midpoint is . The centered interval can therefore attain 95% posterior probability with the least length. It is both an equal-tailed credible interval and a highest posterior density interval.
The target is the experiment's mean at . A posterior predictive distribution for a new noisy observation would instead have variance ; that extra observation variance does not belong in the requested interval.
The displayed identity requires a correction to the process construction in the source. In a piecewise-deterministic Markov process, the instantaneous hazard function is evaluated at the current flowing state , and the destination is sampled from . Keeping the jump times and destinations of the original Markov jump process instead evaluates both quantities at its last reset state , which generally differs from . The source PDF confirms that these original jump times and destinations were retained. Consequently its definition does not in general produce the asserted transition kernel, or even a Markov process in the state variable alone.
For an explicit counterexample, take , , , and let every be the standard normal distribution, independently of . These are smooth coefficients with bounded positive jump rate, so nonexplosion holds. In the literal construction, the first holding time has the exponential distribution of rate . Thus the probability distribution of has an atom of mass at . Paths with at least one jump contribute no atom there, because the reset has a normal density. The asserted identity instead assigns to this no-jump atom the mass
which differs for every .
Here is the full derivation for the intended piecewise-deterministic Markov process. Assume nonexplosion; smoothness alone does not guarantee it. Start at , let be the first jump after , and set
One precise construction draws an independent unit-rate exponential random variable and takes , with . This implements a hazard function along the flow of a vector field, rather than a fixed exponential holding time at the last reset. Its survival probability and jump-time probability density function are
Equivalently, with . On , the terminal state is . Conditional on , draw the new state from and restart the same construction from . The Markov property and the tower property of conditional expectation therefore give the first-jump decomposition of a piecewise-deterministic Markov process
This proves the requested identity under the corrected construction, for every bounded Borel measurable function . The two contributions partition according to whether the first jump occurs before ; later jumps are already contained in .
For comparison, the literal construction does have a different renewal identity when started at a reset with . If denotes only these reset-start operators, the same conditional expectation argument gives
These need not be the transition operators conditional on at an arbitrary time: that observation does not specify the hidden reset state. This distinction explains exactly why replacing only the between-jump paths is insufficient.
The exponential distribution prior has rate and support , so its prior density is . By Bayes' theorem,
where is a normalizing constant independent of .
Completing the square gives a useful exact reference for the numerical sampling. Put
Then this normal mean posterior with an exponential prior is a normal distribution with location and variance , truncated below at zero. With the standard normal distribution density and its cumulative distribution function,
The exponential rate is , not three; the prior mean is three. The support restriction must be retained in both the formula and the sampler.
The source prints bare differentials in both integrals; the integration variable is , so we write them as .[ref]
The normalization of a probability distribution for gives
Therefore
Next, the standard normal distribution has and , so the second moment is . Since , linearity of expectation yields . Expressing this expectation using the probability density function gives
Consequently
These evaluate the gamma function at and , respectively, directly from a transformed normal random variable.