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

dtrunweib_cdf(x, c, xi0, alpha, U, L)
% dtrunweib_cdf.m - evaluates a Doubly Truncated Weibull Cumulative Distribution.
%   See "Continuous Univariate Distributions", Johnson, Kotz and Balakrishnan,
%   J. Wiley, v.1, p.691, 1995.
%
%    Created by:    J. Huntley,  10/11/2007
%

function [cdf] = dtrunweib_cdf(x, c, xi0, alpha, U, L)

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

% Integrate PDF to get CDF.
warning off MATLAB:quad:MinStepSize
sz = size(x,2);
for jz = 1:sz
    cdf(jz) = quad(@dtrunweib_pdf,L,x(jz),tol,trace,c,xi0,alpha,U,L);
end

return

Contact us