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

modhans_cdf(x,u2,u4,u6,u8)
% modhans_cdf.m - compute modified Hansmann Cumulative Distribution Function.
%   see "A Note on Hansmann's 1934 Family of Distributions", 
%   R.F. Pawula and S. O. Rice, IEEE Trans Info Theory, v.35, No.4, p.910 8/1989.           
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  12/13/07.
%

function [cdf] = modhans_cdf(x,u2,u4,u6,u8)

pxpdf = modhans_pdf(x,u2,u4,u6,u8);
sx = size(x,2);
qz(1:sx) = 0;

for jx = 1:sx
    if(jx <= 2)
        qz(1) = pxpdf(1);
    elseif(jx > 2)
        dx = x(2)-x(1);
        cdf(jx) = simps(pxpdf(1:jx)) * dx;
    end
end

return



Contact us