Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley


generates random variates from over 870 univariate distributions

qnegbinom_pdf(n, k, q, theta)
% qnegbinom_pdf.m - evaluates a q-Negative Binomial Probability Density.
%   See "The q-Factorial Moments of Discrete q-Distributions and a Characterization
%   of the Euler Distribution", Ch. A. Charalambides and N. Papdatos, U. Athens.
%  Created by Jim Huntley,  8/02/06

function [pdf] = qnegbinom_pdf(n, k, q, theta)

qcoef = qbinomial_coef(k+n-1, n, q);
prod = 1;
for jj = 1:k
    prod = prod * (1 - theta*q^(jj-1));
pdf = qcoef * theta^n * prod;


Contact us