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

qbinom2_pdf(n, theta, lambda, nn)
% qbinom2_pdf.m - evaluates a q-Binomial II Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp, and Kotz,
%   J. Wiley, 2005, p.103.    
%
%  Created by Jim Huntley,  9/25/07
%

function [pdf] = qbinom2_pdf(n, theta, lambda, nn)

%persistent coef

%if(isempty(coef))
    coef = theta / ((1+theta)*(1+theta+lambda*nn)^(nn-1));
%end

pdf = coef * binomial_coef(nn,n) * (1+lambda*nn-lambda*n)^(nn-n-1) * ...
      (theta+lambda*n)^(n-1);

return

Contact us