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

foldstud_pdf(x, nu)
% foldstud_pdf.m - evaluates a Folded Student T Probability Density.
%   See "Handbook of Beta Distribution and Its Applications", A.K Gupta &,
%   S. Nadarajah, p.125, 2004.  
%
%  Created by Jim Huntley,  10/18/11
%

function [pdf] = foldstud_pdf(x, nu)

%pdf = 2 .* gamma(0.5*(nu+1)) ./ (sqrt(pi*nu) .* gamma(0.5*nu) .* ...
%      (1+x.^2./nu).^(0.5*(nu+1)));
pdf = 2 .* exp(gammaln(0.5*(nu+1))-gammaln(0.5*nu)) ./ (sqrt(pi*nu) .* ...
      (1+x.^2./nu).^(0.5*(nu+1)));

return

Contact us