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

qb4_pdf(n, p, phi, nn)
% qb4_pdf.m - evaluatess a Quasi Binomial IV Probability Density.
%   See "Parameter Estimation, Data Fitting, and Limiting Distribution of QBD III and QBD IV",
%   S. Chakraborty, Dibrugargh U., SCRA 2004 FIM XI, Dec.27-29, 2004, Inst. of Engr. & Tech.,
%   Lucknow, India.
%
%  Created by Jim Huntley,  01/15/08
%

function [pdf] = qb4_pdf(n, p, phi, nn)

coef = p^2 * (p+phi) * (1-p-nn*phi) / ((p+phi)*(1-nn*phi)-nn*p*phi*(1-(nn-1)*phi));

for jn = 1:size(n,2)        
    pdf(jn) =  coef * binomial_coef(nn,n(jn)) * (p+n(jn)*phi)^(n(jn)-2) * ...
              (1-p-n(jn)*phi)^(nn-n(jn)-1);
end

return

Contact us