Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

James Huntley (view profile)

 

generates random variates from over 870 univariate distributions

sinhnorm_pdf(x, alpha, gam, sigma)
% sinhnorm_pdf.m - evaluates a Sinh Normal Probability Density.
%   See "Continuous Univariate Distributions", Johnson, Kotz and Balakrishnan,
%   J. Wiley, v.2, 1995, p.661.
%
%   Vector form of PDF!!!
%
%  Created by Jim Huntley,  10/03/07
%

function [pdf] = sinhnorm_pdf(x, alpha, gam, sigma)

%persistent coef alphat

%if(isempty(coef))
   coef = 2 / (alpha*sigma*sqrt(2*pi)); 
   alphat = 2 / alpha^2;
%end

arg = (x - gam) ./ sigma;
pdf = coef .* cosh(arg) .* exp(-alphat.*(sinh(arg)).^2);
    
return

Contact us