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

qb3_pdf(n, p, phi, nn)
% qb3_pdf.m - evaluates a Quasi Binomial IIII 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] = qb3_pdf(n, p, phi, nn)

%coef = p^2 * (p+phi) * p / (p^2-nn*p^2*phi+p*phi)
coef = p^2 * (p+phi) / (p-nn*p*phi+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));
end

return

Contact us