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

r_cdf(x, nn)
% r_cdf.m - evaluates an r Cumulative distribution.
%   See "www.stat.tamu.edu/~thsing/610/fin99.pdf ", web.
%   See "www.xycoon.com/rdis_density.htm", web.
%   Additional factor of 0.5 is normalization.
%
%  Created by Jim Huntley,  11/10/05
%

function [cdf] = r_cdf(x, nn)

bb = beta(1/2,(nn-2)/2);
a = [1/2 -1/2*nn+2];
b = 3/2;
z = x.^2;
cdf = 0.5 + x .* pfq(a, b, z) ./ bb;

return

Contact us