The
Marsaglia
Marsaglia is a '' comune'' (municipality) in the Province of Cuneo in the Italian region Piedmont, located about southeast of Turin and about east of Cuneo.
References
External links
Official website
Cities and towns in Piedmont
C ...
polar method is a
pseudo-random number sampling method for generating a pair of independent
standard normal random variables.
Standard normal random variables are frequently used in
computer science
Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to practical disciplines (includin ...
,
computational statistics, and in particular, in applications of the
Monte Carlo method
Monte Carlo methods, or Monte Carlo experiments, are a broad class of computational algorithms that rely on repeated random sampling to obtain numerical results. The underlying concept is to use randomness to solve problems that might be deter ...
.
The polar method works by choosing random points (''x'', ''y'') in the square −1 < ''x'' < 1, −1 < ''y'' < 1 until
:
and then returning the required pair of normal
random variable
A random variable (also called random quantity, aleatory variable, or stochastic variable) is a mathematical formalization of a quantity or object which depends on random events. It is a mapping or a function from possible outcomes (e.g., the p ...
s as
:
or, equivalently,
:
where
and
represent the
cosine and
sine of the angle that the vector (''x'', ''y'') makes with ''x'' axis.
Theoretical basis
The underlying theory may be summarized as follows:
If ''u'' is uniformly distributed in the interval
0 ≤ ''u'' < 1, then the point
(cos(2π''u''), sin(2π''u''))
is uniformly distributed on the unit circumference
''x''
2 + ''y''
2 = 1, and multiplying that point by an independent
random variable ρ whose distribution is
: