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

qccviii_pdf(n, c, q, nn)
% test_qccviii.m - evaluates a q-CCV-III 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] = qccviii_pdf(n, c, q, nn)

persistent pdfhold

if(n == 0)
    pdfhold = uq(c,q,nn);
    pdf = pdfhold;
elseif(n > 0)
    pdf = pdfhold * (1-q^(nn-n+1))*q^(2*n-2)*c / ... 
                ((1-c*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