Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

James Huntley (view profile)

 

generates random variates from over 870 univariate distributions

fellpar_cdf(x, alpha, bet)
% fellpar_cdf.m - evaluates a Feller Pareto Cumulative Distribution.
%   See "Advances in Information Retrieval", ed. F. Crestani, M. Girolami, 
%   C.J. van Rijsbergen, March 2002, 
%   "Term frequncy Normalization via Pareto Distributions", G. Amati et al.
%
%  Created by Jim Huntley,  08/17/11
%

function [cdf] = fellpar_cdf(x, alpha, bet)

pdf = fellpar_pdf(x, alpha, bet);

sx = size(x,2);
dx = x(2) - x(1);
for jx = 1:sx
    if(jx <= 2)
        cdf(jx) = trapz(pdf(1:jx)) * dx;
    elseif(jx > 2)
        cdf(jx) = simps(pdf(1:jx)) * dx;
    end
end

return

Contact us