u = chi2rnd(nu, [N,1]);

Thanks Daniel,
But, por example, if N=10,000, what are the degrees of freedom nu in u = chi2rnd (nu, [N, 1])?

 Accepted Answer

Wayne King
Wayne King on 27 Oct 2011
Hi, The degrees of freedom has nothing to do with N = 10000
The degrees of freedom is the parameter that characterizes the chi-square pdf, just like the mean and the variance are the parameters that characterize the Gaussian. For a chi-square density, if you know the degrees of freedom, you know everything about the distribution.
N = 10000 is just the number of samples you want.
u = chi2rnd(5,1000,1); % draw 1000 samples chi-square density with
% 5 degrees of freedom
u = chi2rnd(5,1e4,1); % draw 10000 samples

More Answers (0)

Tags

Asked:

on 27 Oct 2011

Community Treasure Hunt

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

Start Hunting!