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

distbeta_pdf(x, a2da1, d1, d2, m, p)
% distbeta_pdf.m - evaluates a Distended Beta Probability Density.
%   See "A Beta Warning Time Distribution and a Distended Beta Distribution",
%	H.W. Block & B.R. Rao, Indian J. of Stat., V.35, Series B, Pt.1,1973, p.79.  
%
%               Vector Form of PDF !!!
%
%  Created by Jim Huntley,  12/29/08
%

function[pdf] = distbeta_pdf(x, a2da1, d1, d2, m, p)

%persistent mdp d1dp d2dp beta1 arg2 arg3 coef

%if(isempty(coef))
    mdp = m / p;
    d1dp = d1 / p;
    d2dp = d2 / p;
    arg2 = d1dp-mdp;
    arg3 = d2dp+mdp;
    beta1 = beta(arg2,arg3);    
    coef = m * a2da1^m / (beta(d1dp,d2dp));
%end

arg1 = 1 ./ (1+(a2da1.*x).^(-p));
pdf = coef .* x.^(m-1) .* beta1 .* (1 - betainc(arg1,arg2,arg3));

return



Contact us