Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

 

generates random variates from over 870 univariate distributions

malik1_pdf(x, a, n, k)
% malik1_pdf.m - evaluates a Malik 1 Probability Density.
%   See "Continuous Univariate Distributions", v.1, Johnson, Kotz, & Balakrishnan,
%   J. Wiley, 1995, p.596.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  7/09/07
%

function [pdf] = malik1_pdf(x, a, n, k)

%persistent coef nlk

%if(isempty(coef))
    coef = exp(n*log(a) - gammaln(n));
    nlk = n*log(k);
%end

arg = x - nlk;
pdf = coef .* arg.^(n-1) .* exp(-a.*arg);

return

Contact us