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

betastacy_cdf(x,a,b,e)
% betastacy_cdf.m - compute Beta Stacy Cumulative Distribution Function.
%   See "Beta-Stacy Survival Regression Models",  F. Rigat and P. Muliere,
%   CRiSM Paper No.07-6, www.warwick.ac.uk/go/crism.
%
%   Vector Form of the CDF!!!
%
%  Created by Jim Huntley,  02/10/10
%

function [cdf] = betastacy_cdf(x,a,b,e)

tol = 1e-8;
trace = [];
warning off MATLAB:quad:MinStepSize;

minx = min(x);

% Integrate PDF to get CDF.
warning off MATLAB:quad:MinStepSize
sz = size(x,2);
for jz = 1:sz
    cdf(jz) = quad(@betastacy_pdf,minx,x(jz),tol,trace,a,b,e);
end

return



Contact us