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

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

function [pdf] = shsk2_pdf(n, a, b, theta)

if(n == 1)
    pdf = 1 - a*theta/(b+1);
elseif(n > 1)
    pdf = a * theta^(n-1) * (1/(n+b-1) - theta/(n+b));
end
    
return

Contact us