In Matlab, it is easy to get a normally distributed random vector with mean and standard deviation. From randn help:
Generate values ββfrom the normal distribution with mean 1 and standard deviation 2. r = 1 + 2. * randn (100.1);
Now I have the covariance matrix C, and I want to generate N (0, C).
But how can I do this?
From randn help: Generate values ββfrom a two-dimensional normal distribution with a given average of the vector and covariance matrices. mu = [1 2]; Sigma = [1.5; .5 2]; R = chol (Sigma); z = repmat (mu, 100.1) + randn (100.2) * R;
But I donβt know exactly what they are doing here.
source share