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

dtrunweib_pdf(x, c, xi0, alpha, U, L)
% dtrunweib_pdf.m - evaluates a Doubly Truncated Weibull Probability Density.
%   See "Continuous Univariate Distributions", Johnson, Kotz and Balakrishnan,
%   J. Wiley, v.1, p.691, 1995.
%
%   Vector form of PDF!!!
%
%    Created by:    J. Huntley,  10/11/2007
%

function [pdf] = dtrunweib_pdf(x, c, xi0, alpha, U, L)

%persistent coef 

%if(isempty(coef))
    coef = c / (alpha*(exp(-((L-xi0)/alpha)^c) - exp(-((U-xi0)/alpha)^c)));
%end

pdf = coef .* ((x-xi0)/alpha).^(c-1) .* exp(-((x-xi0)./alpha).^c);

return

Contact us