Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley


generates random variates from over 870 univariate distributions

invgam_pdf(x, alpha, mu)
% invgam_pdf.m - evaluates an Inverse Gamma Probability Density.
%   See "On Recursive evaluation of Mixed Poisson Probabilities and Related Quantities", 
%   G.E.Willmot, Scand. Actuarial J., vol.2, p.114, 1993.
%   Vector form of PDF!!!!
%  Created by Jim Huntley,  02/23/10

function [pdf] = invgam_pdf(x, alpha, mu)

%persistent coef

    coef = mu^alpha / gamma(alpha);

pdf = coef .* x.^(-alpha-1) .* exp(-mu./x);


Contact us