Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

 

generates random variates from over 870 univariate distributions

chisq_pdf(x, nu)
%chisq_pdf.m - evaluates a Chi-squared Probability Distribution.
%   See "Dataplot Reference Manual, CHSCDF", 8-35, NIST, 3/20/97
%
%  Created by Jim Huntley,  12/9/03
%

function [pdf] = chisq_pdf(x, nu)

%persistent coef

%if(isempty(coef))
    coef = 1 / (2^(nu/2) * gamma(nu/2));
%end

pdf = coef .* x.^(nu/2-1) .* exp(-0.5.*x);

return

Contact us