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_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",  
%   http://faculty.ksu.edu.sa/69424/Paperpdf/Order%20statistics%20from%20Compertz%20distribution.pdf
%
%  Created by Jim Huntley,  01/12/10
%

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

%persistent coef P Q

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

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

return





    

Contact us