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

reflgam_pdf(x, alpha, bet, gam)
% reflgam_pdf.m - evaluates a Reflected Gamma Probability Density.
%   See "Continuous Univariate Distributions", Vol. 1, Johnson, Kotz, & Balakrishnan,
%   J. Wiley, 1995, p.387.
%
%   Vector form of PDF!!!
%
%   Created by Jim Huntley,  11/02/09
%

function [pdf] = reflgam_pdf(x, alpha, bet, gam)

%persistent coef

%if(isempty(coef))
    coef = exp(log(0.5) - alpha*log(bet) - gammaln(alpha));
%end

pdf = coef .* (abs(x-gam)).^(alpha-1) .* exp(-abs(x-gam)./bet);

return

Contact us