u = chi2rnd(nu, [N,1]);
Ältere Kommentare anzeigen
Hi,
I use the chi2rnd to generate random variables. This function asks me as an input the degrees of freedom, but I do not know how it is calculated. If someone could help me with this, be grateful. For example, in this case "u = chi2rnd (nu, [N, 1])", what are the degrees of freedom nu?
Antworten (1)
Daniel Shub
am 27 Okt. 2011
The degrees of freedom is a parameter of the distribution. Basically, you can rewrite chi2rnd as:
chi2rnd = @(nu, siz)sum(randn([nu, siz]).^2);
Basically, the degrees of freedom nu is how many normal random variables you are going to sum together. Its value really depends on your application.
Kategorien
Mehr zu Random Number Generation finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!