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

snvg_pdf(x, delta, c, lambda)
% snvg_pdf.m - evaluates a Symmetric Normal Variance Gamma Probability Density.
%   See "Tests of Fit for Symmetric Variance Gamma Distributions", F. Kostas,
%   15th European Young Statisticians Meeting, Sept 10-14, 2007.    
%   Vector Form of PDF !!!
%  Created by Jim Huntley,  8/14/07

function [pdf] = snvg_pdf(x, delta, c, lambda)

%persistent coef pow

    pow = lambda-0.5;
    coef = -(log(c)+gammaln(lambda)+log(sqrt(pi)));

arg = abs(x-delta) ./ c;
pdf = exp(coef + pow.*log(0.5.*arg) + log(besselk(pow,arg)));


Contact us