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

qdefbinom_pdf(n, q, m, tau)
% qdefbinom_pdf.m - evaluates a q-Deformed Binomial Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp, and Kotz,
%   J. Wiley, 2005, p.468.    
%
%  Created by Jim Huntley,  9/25/07
%
%   Calls: 'qhyperser' - attached to this file.
%

function [pdf] = qdefbinom_pdf(n, q, m, tau)

%persistent qqm

%if(isempty(qmm))
    qqm = qhypergser(q,q,m);
%end

tqmmx = qhypergser(tau,q,m-n);
qqx = qhypergser(q,q,n);
qqmmx = qhypergser(q,q,m-n);
pdf = qqm * tqmmx * tau^n / (qqx * qqmmx);

return


function [val] = qhypergser(a,q,jj)

val = 1;
for j = 1:jj
    val = val * (1 - a*q^(j-1));
end

Contact us