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

trungom_cdf(x, bet, gam, Q1, P1)
% trungom_cdf.m - evaluates a Truncated Gompertz Cumulative Distribution.
%   See "Order Statistics from Doubly Truncated Gompertz Distribution and its Characterizations", 
%   http://faculty.ksu.edu.sa/69424/Paperpdf/Order%20statistics%20from%20Compertz%20distribution.pdf
%
%  Created by Jim Huntley,  01/12/10
%

function [cdf] = trungom_cdf(x, bet, gam, Q1, P1)

%persistent coef P2

%if(isempty(coef))
    P = 1 - exp(-bet*(exp(gam*P1)-1)/gam);
    Q = 1 - exp(-bet*(exp(gam*Q1)-1)/gam);
    P2 = (1-P) / (P-Q);
    coef = bet / (P-Q);
%end

pdf = trungom_pdf(x, bet, gam, Q1, P1);
cdf = 1 + P2 -exp(-gam.*x) .* pdf ./ bet;

return





    

Contact us