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_pdf(x, alpha, bet, nu, tau)
% parlognor_pdf.m - evaluates a Double Pareto Lognormal Probability Density.
%   See "The Double Pareto-Lognormal Distribution - A New Parameteric Model for Size Distributions", 
%   W. J. Reed and M. Jorgensen, U. Victoria.
%
%  Created by Jim Huntley,  08/29/06
%

function [pdf] = parlognor_pdf(x, alpha, bet, nu, tau)

coef = alpha*bet / (alpha+bet);
A1 = exp(alpha*nu + 0.5*alpha^2*tau^2);
A2 = exp(-bet*nu + 0.5*bet^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'.
pdf = coef .* (A1 .* x.^(-alpha-1) .* Phi1 + A2 .* x.^(bet-1) .* Phi2) ;

return

Contact us