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

genf_pdf(x, a, p, q)
% genf_pdf.m - evaluates a Generalized F Probability Density.
%   See "Continuous Univariate Distributions", Johnson, Kotz, & Balakrishnan,
%   Wiley, v.2, 1995, p.349.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  2/06/07
%

function [pdf] = genf_pdf(x, a, p, q)

%persistent coef ppq exp1

%if(isempty(coef))
    % Initializations.
    Bpq = beta(p,q);
    absa = abs(a);
    ppq = p + q;
    exp1 = a*p - 1;
    coef = absa / Bpq;
%end

pdf = coef .* x.^exp1 ./ ((1 + x.^a).^ppq);    

return

Contact us