To generate a chi-squared variable with one degree of freedom by the Marsaglia polar method, repeatedly draw independent uniformly on until . ReturnThe accepted point is uniform on the unit disk; its squared radius is uniform on and independent of angle. The radial rescaling gives a standard normal coordinate , hence . The same accepted pair also supplies another independent standard normal coordinate, if needed. The proof stages below follow the four printed sampler labels.
Squaring a variable with the standard normal distribution gives the required chi-squared distribution. Its two inverse images at are , so the change-of-variable formula givesDraw the branch-selection uniform variable independently of the randomness used for the normal draw. Then the pair has the product law: conditioning on leaves uniform. This independence is exactly what justifies interpreting the subsequent threshold as the conditional probability of selecting the smaller root.
Introduce . Solving the quadratic and using its product of roots givesBoth roots are positive, with ; equality occurs only for . For computation, the smaller root has the equivalent cancellation-free formThis is stable root evaluation for inverse Gaussian sampling.
Define . It decreases from infinity to zero on and increases from zero to infinity on , sinceThe two roots are precisely its inverse branches. This supplies the Jacobians needed for the reciprocal-root inverse Gaussian sampler.
For , only the smaller-root branch can produce a value near . Conditional on , its selection probability is . The output density on that interval is thereforeUseThe factors cancel to giveThus the selected lower branch has exactly the lower part of the desired inverse Gaussian density, rather than the unweighted density of the smaller root alone.
For , the corresponding smaller root is . The conditional probability of selecting the larger root isIt is the same weight as a function of the actual selected value . HenceCombining the two open intervals proves the output has the Inverse Gaussian distribution . The event has probability zero, so no atom occurs at ; the limiting density there is finite. The algorithm always selects one of its positive roots, so these branch densities exhaust its probability distribution.
For the constructed output, its defining quadratic says identically. Since the preceding branch calculation proves that its law is , any variable with that law has the same pushforward distribution:One can also verify this chi-squared transform of an inverse Gaussian variable directly. The density contributions from the inverse branches areThe final equality follows from . This confirms the transformed law independently of which reciprocal root was selected.
Articles by others on the same topic
There are currently no matching articles.