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

genstud_pdf(x, sigma, k, p, theta)
% genstud_pdf.m - evaluates a Generalized Student Probability Density.
%   See "Continuous Univariate Distributions", v.2, Johnson, Kotz, and Balakrishnan, 
%   J. Wiley, 1995, p.401.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  6/19/07
%

function [pdf] = genstud_pdf(x, sigma, k, p, theta)

%persistent coef odksigsq

%if(isempty(coef))
    coef = 1 / (sigma * sqrt(k) * beta(0.5,p-0.5));
    odksigsq = 1 / (k * sigma^2);
%end

pdf = coef .* (1 + (x-theta).^2.*odksigsq).^(-p);

return

Contact us