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

qbinomial_coef(x, k, q)
% qbinomial_coef.m - compute q-binomial coefficient.
%   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:  J. Huntley,  08/02/2006.
%

function [qcoef] = qbinomial_coef(x, k, q)

num = 1;
denom = 1;
for jn = 1:k
    num = num * (1-q^(x-jn+1));
    denom = denom * (1-q^jn);
end
qcoef = num / denom;

return

Contact us