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

hofmann_cdf(n, a, p, c, t)
% hofmann_cdf.m - compute Hofmann Cumulative Distribution Function.
%   See "The Practical replacement of a Bonus-Malus System", 
%   J. F. Walhin and J. Paris, U. de Louvain, ASTIN Bull., Vol.31, No.2, 2001, p.317.
%    (just a brute-force sum of the PDF).
%  Created by:  Jim Huntley,  09/22/06.

function [cdf] = hofmann_cdf(n, a, p, c, t)

sum1 = hofmann_pdf(0, a, p, c, t);
for jn = 1:n
    sum1 = sum1 + hofmann_pdf(jn, a, p, c, t);
cdf = sum1;

Contact us