Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

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

%if(isempty(coef))
    pow = lambda-0.5;
    coef = -(log(c)+gammaln(lambda)+log(sqrt(pi)));
%end

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

return

Contact us