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

parlognor_cdf(x, alpha, bet, nu, tau);
% parlognor_cdf.m - evaluates a Double Pareto Lognormal Cumulative Distribution.
%   See "The Double Pareto-Lognormal Distribution - A New Parameteric Model for Size Distributions", 
%   W. J. Reed and M. Jorgensen, U. Victoria.
%   NOTE:  The expression for the CDF listed in this reference does not correspond to the PDF.  In
%   fact, it can yield negative values for small 'x'.  Use numerical integration instead.  See file
%   'parlognor_cdf.m'.
%
%  Created by Jim Huntley,  08/29/06
%
%

function [y] = parlognor_cdf(x, alpha, bet, nu, tau);

coef = 1 / (alpha+bet);
A1 = exp(alpha*nu + 0.5*alpha^2*tau^2);
A2 = exp(-bet*nu + 0.5*alpha^2*tau^2);
arg1 = (log(x) - nu - alpha*tau^2) / tau
Phi1 = gaus_cdf(arg1,0,1);                   % Normal CDF of 'arg1'.
arg2 = (log(x) - nu + bet*tau^2) / tau;
Phi2 = 1 - gaus_cdf(arg2,0,1);               % Complementary Normal CDF of 'arg2'.
arg0 = (log(x) - nu) / tau;
Phi0 = gaus_cdf(arg0,0,1);                   % Normal CDF of 'arg0'.
y = Phi0 - coef * (A1 * bet*x^(-alpha) * Phi1 + A2 * alpha * x^bet * Phi2) ;

return

Contact us