generating a random variable with a given mean and matrix
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
fafz1203
il 15 Ott 2016
Commentato: Diego Jaramillo
il 16 Apr 2020
can any one tell me how to generate a NORMAL DISTRIBUTION random variable X = N(mu,A), where mu is the mean (mu = 0, 0 mean) and A is a p*p IDENTITY MATRIX. Please ask me if the question is unclear. Thanks
Risposta accettata
Image Analyst
il 15 Ott 2016
Like this?
numRows = size(A, 1);
A(logical(eye(numRows))) = randn(1, numRows)
8 Commenti
Image Analyst
il 15 Ott 2016
I don't believe you can do that and have the random variable be random. If it's random, you won't have A=eye(10) for the covariance matrix.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Random Number Generation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!