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

qbinomial_pdf(n, nn, q, theta)
% qbinomial_pdf.m - evaluates a q-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] = qbinomial_pdf(n, nn, q, theta)

qcoef = qbinomial_coef(nn, n, q);
prod = 1;
for jn = 1:nn
    prod = prod / (1 + theta*q^(jn-1));
pdf = qcoef * q^(n*(n-1)/2) * theta^n * prod;


Contact us