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

frechvbm_pdf(n, N, a, m)
% frechvbm_pdf.m - evaluates a Frechet Visibility Bias Model Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp & Kotz,
%   J. Wiley, p.435, 2005. 
%
%  Created by Jim Huntley,  02/11/07
%

function [pdf] = frechvbm_pdf(n, N, a, m)

sum = 0;
coef = factorial(m) / factorial(N);
facn = factorial(n);
for jn = 1:m-n+1
    sum = sum + (-1)^(jn-1) * factorial(N-n-jn+1) * a^(n+jn-1) / ...
          (facn * factorial(jn-1) * factorial(m-n-jn+1));
end
pdf = coef * sum;

return


Contact us