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

qccvii_pdf(n, eta, q, b)
% qccvii_pdf.m - evaluates a q-CCV-II Probability Density.
%   See "Steady-State Markov Chain models for Certain q-confluent Hypergeometric 
%   Distributions", A.W. Kemp, Journal of Stat. Planning and Inference", 
%   vol.135, 2005, p.107.
%
%  Created by Jim Huntley,  2/26/09
%

function [pdf] = qccvii_pdf(n, eta, q, b)

persistent pdfhold

prodlim = 20/(1-q);         % heuristic.            

if(n == 0)
    pdfhold = uq(-eta,q,prodlim) / uq(-eta/b,q,prodlim);
    pdf = pdfhold;
elseif(n > 0)
    pdf = pdfhold * (1-b*q^(n-1))*q^(n-1)*eta / ... 
                (b*(1+eta*q^(n-1))*(1-q^n));
    pdfhold = pdf;
end

return

function [prodjn] = uq(u,q,prodlim)

prodjn = 0;
for jn = 1:prodlim
    prodjn = prodjn + log((1-u*q^(jn-1)));
end
prodjn = exp(prodjn);

return

Contact us