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

leipnik_pdf(x, lambda, mu)
% leipnik_pdf.m - evaluates an Leipnik Probability Density.
%   See "VGAM Family Functions for Univariate Distributions", Beta Version 0.5-15,
%   T. W. Yee, Univserity of Aukland, 1/06/2004.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  07/17/06
%
%

function [pdf] = leipnik_pdf(x, lambda, mu)

sx = size(x,2);
betaterm = beta(0.5*(lambda+1),0.5);
power = -0.5*lambda;

for jx = 1:sx
    arg = x(jx)*(1 - x(jx));
    pdf(jx) = (1 + (x(jx)-mu)^2/arg)^power / (sqrt(arg) * betaterm);
end

return

Contact us