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

shsk1_pdf(n, a, p, theta)
% shsk1_pdf.m - evaluates a Shenton & Skees I Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp & Kotz,
%   J. Wiley, 2005, p.324. 
%
%  Created by Jim Huntley,  10/02/07
%

function [pdf] = shsk1_pdf(n, a, p, theta)

%persistent c1 c2 

%if(isempty(c1))
    c1 = a * (1-p);
    c2 = (1-a) / log(1-theta);
%end

pdf = c1 * p^(n-1) - c2 * theta^n / n;
    
return

Contact us