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

poisshpar_pdf(x, mu, n, alpha)
% poisshpar_pdf.m - evaluates a Poisson Shifted Pareto Probability Density.
%   See "Laplace Transforms, Mellin Transforms and Mixed Poisson Processes", 
%   P. Albrecht, Scand. Actuarial J., vol.1, p.58, 1984.
%
%   Vector form of PDF!!!
%
%  Created by Jim Huntley,  05/26/09
%

function [pdf] = poisshpar_pdf(x, mu, n, alpha)

%persistent coef

%if(isempty(coef))
    coef = (alpha+1)*log(mu) + log(alpha+1) - gammaln(n+1) + gammaln(n-alpha);
%end

for jx = 1:size(x,2)
    pdf(jx) = exp(coef + alpha*log(x(jx)) + log(1-gammainc(mu*x(jx),n-alpha)));
end

return

Contact us