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

scinvchisq_pdf(x, k, sigma)
% scinvchisq_pdf.m - evaluates a Scaled Inverse Chi Square Probability Density.
%   See "The Amoroso Distribution", G. E. Crooks, Tech. Note 003v5 (2010-01-14)
%   http://threeplusone.com/pubs/technote/CrooksTechNote003.pdf.
%
%   Vector form of PDF!!!!
%
%  Created by Jim Huntley,  02/23/10
%

function [pdf] = scinvchisq_pdf(x, k, sigma)

%persistent coef

%if(isempty(coef))
    coef = 2 * sigma^2 / gamma(0.5*k);
%end

argx = 1 ./ (2.*sigma^2.*x);
pdf = coef .* argx.^(0.5*k+1) .* exp(-argx);

return

Contact us