Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

James Huntley (view profile)

 

generates random variates from over 870 univariate distributions

pearson4_cdf(x, m, nu, a, lambda)
% pearson4_cdf.m - evaluates a Cumulative Pearson Type IV Distribution.
%   See "A Guide to the Pearson Type IV Distribution", J. Heinrich, U. PA, 1/8/04.
%
%  Created by Jim Huntley,  8/18/04
%

function [cdf] = pearson4_cdf(x, m, nu, a, lambda)

pdf = pearson4_pdf(x, m, nu, a, lambda);
for jx = 1:size(x,2)
    if(jx == 1)
        cdf(1) = pdf(1);
    elseif(jx == 2)
        cdf(jx) = trapz(x(1:jx),pdf(1:jx));
    elseif(jx > 2)
        cdf(jx) = simps(x(1:jx),pdf(1:jx));
    end
end

return

Contact us