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

czeled_cdf(x, mu, sigma, kappa)
% czeled_cdf.m - evaluates a Czeledin Cumulative Distribution.
%   See "The Czeledin Distribution Function", M. Knecht and S. Kuttel, Converium Ltd.
%
%  Created by Jim Huntley,  08/10/06
%
%

function [y] = czeled_cdf(x, mu, sigma, kappa)

sigma02 = log(1 + sigma^2/mu^2);
sigma0 = sqrt(sigma02);
mu0 = log(mu/kappa) - 0.5*sigma02;
mu02 = mu0^2;
alpha = exp(-0.5*mu02/sigma02) / (sqrt(2*pi)*sigma0*gaus_cdf(mu0/sigma0,0,1));
if(x < kappa)
    L = logn_cdf(x,mu,sigma);
    y = L;
else
    P = pareto_cdf(x,alpha,kappa);
    L = logn_cdf(kappa,mu,sigma);
    y = L + (1-L)*P;
end

return

Contact us