Noncentral F random numbers
x = distfun_ncfrnd(v1,v2,delta) x = distfun_ncfrnd(v1,v2,delta,[m,n]) x = distfun_ncfrnd(v1,v2,delta,m,n)
a matrix of doubles, numerator degrees of freedom, v1>0 (can be non integer).
a matrix of doubles, denominator degrees of freedom, v2>0 (can be non integer).
a matrix of doubles, the noncentrality parameter, delta>=0
a 1-by-1 matrix of floating point integers, the number of rows of x
a 1-by-1 matrix of floating point integers, the number of columns of x
a matrix of doubles, the random numbers in the set [0,∞).
Generates random variables from the Noncentral F-distribution function.
Any scalar input argument is expanded to a matrix of doubles of the same size as the other input arguments.
x = distfun_ncfrnd(2,5,3) // Test with expanded v1, v2 and delta x = distfun_ncfrnd(1:6,1:6,3) // Check mean and variance N = 5000; v1 = 3; v2 = 5; delta = 7; x = distfun_ncfrnd(v1,v2,delta,[1 N]); RM = mean(x) RV = variance(x) [M,V] = distfun_ncfstat(v1,v2,delta) // Make a plot of the actual distribution of the numbers v1 = 10; v2 = 50; delta = 7; data = distfun_ncfrnd(v1,v2,delta,1,1000); scf(); histplot(20,data) x = linspace(0,4,1000); y = distfun_ncfpdf(x,v1,v2,delta); plot(x,y) xtitle("Noncentral F Random Numbers","X","Density") legend(["Empirical","PDF"]); // Make a plot of a ratio of chi-square random numbers scf(); v1 = 10; v2 = 50; delta = 7; R1 = distfun_ncx2rnd(v1,delta,1,1000); R2 = distfun_chi2rnd(v2,1,1000); x = (R1./v1)./(R2./v2); histplot(20,x) x = linspace(0,4,1000); y = distfun_ncfpdf(x,v1,v2,delta); plot(x,y) xtitle("$\textrm{Random Numbers }\frac{R_1/v_1}{R_2/v_2}$","X","Density") legend(["Empirical","PDF"]); | ![]() | ![]() |
http://en.wikipedia.org/wiki/Noncentral_F-distribution