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

disunifra_pdf(n, M, nn, q)
% disunifra_pdf.m - evaluates a Discrete Uniform Range Probability Density.
%     "q-Probability: I. Basic Discrete Distributions", 
%     B. Kupershmidt, J. Nonlinear Math., vol. 7, No. 1 p.73, 2000.
%
%  Created by Jim Huntley,  03/02/07
%

function [pdf] = disunifra_pdf(n, M, nn, q)

x = M + 1;
if(n == 0)
    pdf = 1 / x^(nn-1);
else
    pdf = ((n+1)^nn - 2*n^nn + (n-1)^nn) * (M+1-n) / x^nn;
end

return


Contact us