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

logsech_pdf(x, a, b)
% log_pdf.m - evaluates a log hyperbolic secant Probability Density.
%   See "Lognormality in Ecological Time Series", 
%   J Halley and P. Inchausti, OIKOS, 99: 518, 2002.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  7/13/05
%

function [pdf] = logsech_pdf(x, a, b)

%persistent expma

%if(isempty(expma))
    expma = exp(-a);
%end

arg = x .* expma;
pdf = 2 ./ (pi.*b.*x.*(arg.^(1/b) + arg.^(-1/b)));

return

Contact us