Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley (view profile)


generates random variates from over 870 univariate distributions

trungom_pdf(x, bet, gam, Q1, P1)
% trungom_pdf.m - evaluates a Truncated Gompertz Probability denisity.
%   See "Order Statistics from Doubly Truncated Gompertz Distribution and its Characterizations",  
%  Created by Jim Huntley,  01/12/10

function [pdf] = trungom_pdf(x, bet, gam, Q1, P1)

%persistent coef P Q

    P = 1 - exp(-bet*(exp(gam*P1)-1)/gam);
    Q = 1 - exp(-bet*(exp(gam*Q1)-1)/gam);
    coef = bet / (P-Q);

pdf = coef .* exp(gam.*x-bet.*(exp(gam.*x)-1)./gam);



Contact us