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

tbirnsan_pdf(x, alpha, bet, nu)
% tbirnsan_pdf.m - evaluates a t-Birnbaum Sanders Probability Density.
%   See "A New Family of Life Distributions Based on Birnbaum-Sanders
%   Distribution", J.A. Diaz-Garcia and V. Leiva-Sanchez,
%   http://www.cimat.mx/reportes/enlinea/I-02-17.pdf.
%
%   Vector Form of PDF!!!
%
%   Created by Jim Huntley,  12/10/09
%

function [pdf] = tbirnsan_pdf(x, alpha, bet, nu)

%persistent coef

%if(isempty(coef))
    coef = exp(gammaln((nu+1)/2) - (log(2*alpha) + 0.5*log(nu*pi*bet) + gammaln(nu/2)));
%end

argx = (x./bet + bet./x - 2);
pdf = coef .* (x+bet) ./ (x.^1.5 .* (1+argx./(nu*alpha^2)).^((nu+1)/2));

return

Contact us