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

truncbeta_cdf(x, a, b, c)
% truncbeta_cdf.m - evaluates a truncated beta Cumulative Distribution.
%   See "Stichastic Decomposition in M/M/inf Queues with Markow Modulated Service Rates", 
%   M. Baykal-Gursoy and W. Xiao, Rutgers, 3/29/2004.
%
%  Created by Jim Huntley,  07/17/06
%

function [cdf] = truncbeta_cdf(x, a, b, c)

%persistent cb2 cb3
    
%if(isempty(cb2))
    cb2 = c^a * a * beta(a,b-a);
    cb3 = c^(b-1) * (b-1) * beta(a,b-a);
%end

cdf = x.^a ./ cb2 - x.^(b-1) ./ cb3;

return

Contact us