Generating points from a standard Gaussian

436 Views Asked by At

I'm new to Gaussian distributions and I'm trying to generate say, $ N$ points from a $ M$ dimensional standard gaussian. What does this mean? How would I do this in matlab?

2

There are 2 best solutions below

2
On BEST ANSWER

here's how in Matlab. In general, you can generate a uniform random variable on [0,1] then feed it into the inverse CDF (i.e,$\Phi^{-1}$) for the gaussian to get a random variable.

0
On

In Matlab, if you want to generate N samples of an 1xM Gaussian random vector, so that its components follow a multivariate Gaussian distribution with 1xM mean vector mu and MxM covariance matrix sigma, use

samples = mvnrnd(mu,sigma,N);

This gives an NxM matrix, samples, where each row is an 1xM sample vector.