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

extlog_pdf(n, m, theta)
% extlog_pdf.m - evaluates an Extended Logarithmic Probability Density.
%   See "An Extension of Panjer's Recursion", K. Hess et al., Dresden,
%   casualtyactuaries.com/library/astin/vol32no2/283.pdf.
%
%  Created by Jim Huntley,  11/14/06
%

function[pdf] = extlog_pdf(n, m, theta)

%persistent coef

%if(isempty(coef))
    sumlim = max(10,10/(1-theta));      % heuristic.
    sum1 = 0;
    for fs = m:sumlim+m-1
        sum1 = sum1 + theta^fs / binomial_coef(fs,m);
    end
    coef = 1 / sum1;
%end

pdf = coef * theta^n / binomial_coef(n,m);

return



Contact us