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

morse_pdf(n, lambda, q)
% morse_pdf.m - evaluates a Morse 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,  2/19/09
%

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

sumlim = 10 / (1-q);            % heuristic.

sumjn = 0;
for jn = 1:sumlim+1
    j = jn - 1;
    sumjn = sumjn + lambda^j * q^(j*(j-1)/2);
end
pdf = lambda^n * q^(n*(n-1)/2) / sumjn;

return

Contact us