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

mixinvgaus_pdf(x, mu, sigma, p)
% mixinvgaus_pdf.m - evaluates a Mixed Inverse Gaussian Probability Density.
%   See "Continuous Univariate Distributions", v.1, Johnson, Kotz, & Balakrishnan,
%   J. Wiley, 1995, p.286.
%
%   Vector form of PDF!!!
%
%  Created by Jim Huntley,  7/12/07
%

function [pdf] = mixinvgaus_pdf(x, mu, sigma, p)

gam = mu * (1-p) / p;
pdf = (gam+x) .* exp(-0.5.*(x-mu).^2./(mu^2.*sigma^2.*x)) ./ ...
      (sqrt(2.*pi.*sigma^2.*x.^3) .* (gam+mu));

return

Contact us