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

beta4_pdf(x, alpha, bet, a, b)
% beta4_pdf.m - evaluates a 4-Parameter Beta Probability Density.
%   See "A Compendium of Distributions", ModelRisk 3.0, Vose Software,
%   http://www.vosesoftware.com/content/ebook.pdf.
%
%  Created by Jim Huntley,  08/13/11
%

function [pdf] = beta4_pdf(x, alpha, bet, a, b)

%persistent denom

%if(isempty(denom))
    denom = beta(alpha,bet) * (b-a)^(alpha+bet-1);
%end

pdf = (x-a).^(alpha-1) .* (b-x).^(bet-1) ./ denom;

%sx = size(x,2);
%for jx = 1:sx
%    if(jx <= 2)
%        cdf(jx) = trapz(pdf(1:jx)) * dx;
%    elseif(jx > 2)
%        cdf(jx) = simps(pdf(1:jx)) * dx;
%    end
%end

return

Contact us