필터 지우기
필터 지우기

sampling from a normal distribution

조회 수: 1 (최근 30일)
PChoppala
PChoppala 2016년 3월 28일
I usually generate a sample from a normal distribution N(mu,sigmasq) (where mu is the mean and sigmasq is the variance) as follows (assume a 1D case)
mu=1.5;
sigmasq=0.01;
p = mu+chol(sigmasq)*randn;
or
p = mvnrnd(mu,sigmasq);
I now want to generate a sample from N(mu,k^2, sigmasq) with k=10. One way is
p = mvnrnd(mu,k^2*sigmasq);
Which among the two below statements is correct?
p = mu + chol(k^2*sigmasq)*randn;
p = mu + k^2*chol(sigmasq)*randn;

답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by