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

fstat_pdf(x, r, nmk)
% fstat_pdf.m - evaluates a F-Statistic Probability Density.
%   See "An Exact, Unified Distributional Characterization of
%   Statistics used to Test Linear Hypotheses in Simple Regression
%   Models", T. Parker, 20 May, 2010. 
%
%  Created by Jim Huntley,  10/19/11
%

function [pdf] = fstat_pdf(x, r, nmk)

%persistent coef rd2

%if(isempty(coef))
    rd2 = 0.5 * r;
    coef = (r/nmk)^rd2 / beta(rd2,nmk/2);
%end

pdf = coef .* x.^(rd2-1) ./ (1+r.*x./nmk).^((r+nmk)/2);

return

Contact us