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

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

function [pdf] = genhyp_pdf(x, lambda, alpha, bet, delta, mu)

gama = sqrt(alpha^2 - bet^2);
arg = sqrt(delta^2 + (x-mu).^2);
pdf = (gama/delta).^lambda .* besselk(lambda-0.5, alpha*arg) .* exp((x-mu).*bet) ./ ...
    (sqrt(2*pi) * besselk(lambda,delta*gama) * (arg/alpha).^(0.5-lambda));

return

Contact us