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

pert_cdf(x, mo, a, b)
% pert_cdf.m - evaluates a PERT Cumulative Distribution.
%   See "A Compendium of Distributions", ModelRisk 3.0, Vose Software,
%   http://www.vosesoftware.com/content/ebook.pdf.
%
%  Created by Jim Huntley,  08/09/11
%

function [cdf] = pert_cdf(x, mo, a, b)

%persistent mu a1 a2 coef

%if(isempty(coef) == 1)
    mu = (a + 4*mo + b) /6;
    a1 = 6*(mu-a)/(b-a);
    a2 = 6*(b-mu)/(b-a);
%end

z = (x-a) ./ (b-a);
cdf = betainc(z,a1,a2);
  
return

Contact us