Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley (view profile)


generates random variates from over 870 univariate distributions

trunlogn_pdf(x, mu, sigma, xc, bet, k)
% trunlogn_pdf.m - evaluates a Truncated lognormal Probability Density.
%   See "Probability for Seismic Hazard Analysis", 
%   USGS,
%   Vector Form of PDF !!!
%  Created by Jim Huntley,  8/25/06

function [pdf] = trunlogn_pdf(x, mu, sigma, xc, bet, k)

for jx = 1:size(x,2)
    fx = 1;
    if(abs(x(jx)) > xc)
        fx = exp(-((abs(x(jx))-xc)/k)^bet);
    pdf(jx) = logn_pdf(x(jx),mu,sigma) * fx;


Contact us