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

normlapl_pdf(x, alpha, bet, sigma, mu)
% normlapl_pdf.m - evaluates a Normalized Laplace Probability Density.
%   See "Brownian-Laplace Motion and its use in Financial Modeling", 
%   W. J. Reed, U. Victoria, Jan., 2005.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  7/20/06
%

function [pdf] = normlapl_pdf(x, alpha, bet, sigma, mu)

coef = alpha*bet/(alpha+bet);
sx = size(x,2);

for jx = 1:sx
    arg = (x(jx)-mu)/sigma;
    R1 = (1 - gaus_cdf(alpha*sigma-arg,0,1)) / gaus_pdf(alpha*sigma-arg,0,1);
    R2 = (1 - gaus_cdf(bet*sigma+arg,0,1)) / gaus_pdf(bet*sigma+arg,0,1);
    pdf(jx) = coef * gaus_pdf(arg,0,1) * (R1 + R2);    
end 

return

Contact us