Draw independent uniformly on , and setThis is the Box-Muller transform. The endpoint has probability zero; an implementation should avoid evaluating its logarithm.
For , , so has density . It is independent of the angle, which has a uniform distribution on , and their joint density is . Transforming to Cartesian coordinates divides by the polar-coordinate Jacobian , yieldingThus the outputs are independent random variables with the standard normal distribution, proving the algorithm.
Let , and write for the standard normal distribution density. For importance sampling, choose the proposal density , namely the uniform distribution on the target interval. Its importance sampling weight isFor iid uniform draws ,is an unbiased estimator of the target mean, since its expectation integrates . If one chooses not to evaluate , the self-normalized importance sampling alternative has statistical consistency, but generally is not an unbiased estimator.
Alternatively, draw independent random variables with the standard normal distribution, let and , and useConditionally on , the retained draws are iid from the truncated normal distribution, so their average is an unbiased estimator with variance , where is its variance. If the ratio is undefined; one can continue drawing until a prescribed number of retained observations is obtained.
Here importance sampling uses every draw inside the interval, whereas only of the normal proposals are retained. The advantage can also be quantified. Integration using givesFor uniform importance sampling,For the retained-draw ratio with a fixed total proposal budget, its asymptotic variance coefficient is . Thus this importance choice has substantially smaller error for the same proposal count; it also avoids wasting about two thirds of the standard normal distribution draws. This comparison is specific to this well-matched importance sampling proposal; arbitrary proposal choices do not share this guarantee.
Use the spectral theorem for real symmetric matrices to write , with orthogonal and , . Set and generateThen . The characteristic function iswhich identifies the multivariate normal distribution . Equivalently, every linear combination is normal, with the required mean and variance. A Cholesky decomposition can be used for a positive-definite matrix. The spectral construction also works for singular , producing a degenerate Gaussian distribution on an affine subspace; in that case there need not be a density on all of .
Use as the variance parameter, with prior density relative to . Let and . Multiplying the prior by the likelihood function gives the unnormalized Bayesian posteriorThe printed request for an “improper posterior” should not be read as a claim that this posterior is always improper. Although the prior is improper, integrating over gives a marginal kernel , which is integrable exactly when and . Under these usual nondegenerate-data conditions it is a proper posterior. If those conditions fail, the displayed kernel is improper and there is no posterior probability distribution for a sampler to target.
Completing the square and using the inverse-gamma distribution give the full conditionalsThe inverse-gamma distribution convention is density proportional to . Equivalently the precision satisfiesusing shape and rate, as in the question.
A Gibbs sampler starts from and alternatesThis is the normal mean-variance posterior with a log-uniform variance prior. For a marginal check, : integrating out reduces the shape by . This marginal shape is different from the full-conditional shape .
Articles by others on the same topic
There are currently no matching articles.