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

geninvnorm_cdf(x,alpha,mu,tau)
% geninvnorm_cdf.m - compute Generalized Inverse Normal Cumulative Distribution Function.
%   See "Continuous Univariate Distributions", Johnson, Kotz & Balakrishnan,
%   Vol. 2, J. Wiley, 1995, p.649.             
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  10/20/08.
%

function [cdf] = geninvnorm_cdf(x,alpha,mu,tau)

pdf = geninvnorm_pdf(x,alpha,mu,tau);
dx = x(2) - x(1);
for jz = 1:size(x,2);
    if(jz < 2)
        cdf(jz) = trapz(pdf(1:jz)) * dx;
    else 
        cdf(jz) = simps(pdf(1:jz)) * dx;
    end
end

return



Contact us