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

igsr_pdf(x, a, b, c, d, mu)
% igsr_pdf.m - evaluates an Inverted Gamma Square Root Probability Density.
%   See "A Bayesian Analysis of Moving Average Processes with Time-Dependent Parameters", 
%   K. Triantafyllopoulos and G. P. Nason, U. Sheffield, 21 April, 2006.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  8/24/06
%

function [pdf] = igsr_pdf(x, a, b, c, d, mu)

%persistent coef

%if(isempty(coef))
    gammam = gamma(a) * gammainc(b/d,a) / b^a;
    coef = c^(2*a) / gammam;
%end

pdf = coef .* abs(x-mu) .* exp(-b*c^2./((x-mu).^2+d*c^2)) ./ ((x-mu).^2+d*c^2).^(a+1);  

return

Contact us