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

harris_pdf(n, k, m)
% harris_pdf.m - evaluates a Harris Probability Density.
%   See "Harris Processes", s. Sebastian et al., India, web.
%
%  Created by Jim Huntley,  7/11/06
%

function [pdf] = harris_pdf(n, k, m)

%persistent odk odm logodm logomodm gamlnodk

%if(isempty(odk))
    odk = 1/k;
    odm = 1/m;
    logodm = log(odm);
    logomodm = log(1-odm);
    gamlnodk = gammaln(odk);
%end

%pdf = exp(gammaln(odk + n) + log(odm^odk) + log((1-odm)^n) - (log(factorial(n)) + gamlnodk));
pdf = exp(gammaln(odk+n) + odk*logodm + n*logomodm - (gammaln(n+1) + gamlnodk));

return

Contact us