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

trunlogn_pdf(x, mu, sigma, xc, bet, k)
% trunlogn_pdf.m - evaluates a Truncated lognormal Probability Density.
%   See "Probability for Seismic Hazard Analysis", 
%   USGS, http://energy.cr.usgs.gov/WEcont/chaps/OP.pdf.
%
%   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);
    end
    pdf(jx) = logn_pdf(x(jx),mu,sigma) * fx;
end 

return

Contact us