11.6.8. astroML.stats.bivariate_normal¶

astroML.stats.
bivariate_normal
(mu=[0, 0], sigma_1=1, sigma_2=1, alpha=0, size=None, return_cov=False)[source]¶ Sample points from a 2D normal distribution
 Parameters
 muarraylike (length 2)
The mean of the distribution
 sigma_1float
The unrotated xaxis width
 sigma_2float
The unrotated yaxis width
 alphafloat
The rotation counterclockwise about the origin
 sizetuple of ints, optional
Given a shape of, for example,
(m,n,k)
,m*n*k
samples are generated, and packed in an mbynbyk arrangement. Because each sample is Ndimensional, the output shape is(m,n,k,N)
. If no shape is specified, a single (ND) sample is returned. return_covboolean, optional
If True, return the computed covariance matrix.
 Returns
 outndarray
The drawn samples, of shape size, if that was provided. If not, the shape is
(N,)
.In other words, each entry
out[i,j,...,:]
is an Ndimensional value drawn from the distribution. covndarray
The 2x2 covariance matrix. Returned only if return_cov == True.
Notes
This function works by computing a covariance matrix from the inputs, and calling
np.random.multivariate_normal()
. If the covariance matrix is available, this function can be called directly.