apologies for the silly question, mathematics is not my strong point. I am trying to design a function in matlab that generates samples according to a normal distribution N(mu, sigma) in d-dimensions. This is the code I have so far,
mu = [1 2];
Sigma = [1 .5; .5 2]; R = chol(Sigma);
z = repmat(mu,100,1) + randn(100,2)*R;
I’ve found this from reading through various wikipedia and google articles and was wondering if it is correct? Thanks in advance,
rusty
Short answer – yes.
Slightly longer answer – why not try it yourself?