MATLAB: U = chi2rnd(nu, [N,1]);

chisquared

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

Best Answer

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