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

genhyp_cdf(x, lambda, alpha, bet, delta, mu)
% genhyp_cdf.m - evaluates a Cumulative Generalized Hyperbolic Distribution.
%   See "Nonparametric Risk Management with Generalized Hyperbolic Distribution", CASE, web.
%  Created by Jim Huntley,  8/24/04

function [cdf] = genhyp_cdf(x, lambda, alpha, bet, delta, mu)

tol = 1e-8;
trace = [];
warning off MATLAB:quad:MinStepSize;

minx = min(x);

% Integrate PDF to get CDF.
for jz = 1:size(x,2)
    cdf(jz) = quad(@genhyp_pdf,minx,x(jz),tol,trace,lambda,alpha,bet,delta,mu);


Contact us