u = chi2rnd(nu, [N,1]);
Afficher commentaires plus anciens
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?
Réponses (1)
Daniel Shub
le 27 Oct 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.
Catégories
En savoir plus sur Random Number Generation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!