Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley


generates random variates from over 870 univariate distributions

trunpar3_pdf(x, a, ups, L, U)
% trunpar3_pdf.m - evaluates a doubly Truncated Pareto Probability Denisity.
%   See "Some Recurrence Relations Between Product Monments of Order Statistics of a Doubly Truncated Pareto Distribution",  
%  Created by Jim Huntley,  01/12/10

function [pdf] = trunpar3_pdf(x, a, ups, L, U)

%persistent coef P Q

    P = 1 - (ups/U)^a;
    Q = 1 - (ups/L)^a;
    coef = a*ups^a / (P-Q);

pdf = coef ./ x.^(a+1);



Contact us