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

overunder_pdf(n, lambda, q)
% overunder_pdf.m - evaluates an Over-Underdispersed Probability Density.
%   See "Steady-State Markov Chain models for Certain q-confluent Hypergeometric 
%   Distributions", A.W. Kemp, Journal of Stat. Planning and Inference", 
%   vol.135, 2005, p.107.
%
%  Created by Jim Huntley,  3/05/09
%

function [pdf] = overunder_pdf(n, lambda, q)

persistent pdfhold

if(n == 0)
    pdfhold = 1 / (1+lambda);
    pdf = pdfhold;
elseif(n > 0)
    pdf = pdfhold * lambda*q^(n-1) / (1+lambda*q^n);
    pdfhold = pdf;
end

return

Contact us