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

runs_pdf(n, n0, n1)
% runs_pdf.m - evaluates a Runs (Ising-Stevens) Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp & Kotz,
%   J. Wiley, 2005, p.451. 
%
%  Created by Jim Huntley,  10/01/07
%

function [pdf] = runs_pdf(n, n0, n1)

%persistent coef 

%if(isempty(coef))
    coef = 1 / binomial_coef(n0+n1,n1-1);
%end

pdf = coef * binomial_coef(n0,n-1) * binomial_coef(n1,n1-n);
    
return

Contact us