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_cdf(x, r, nmk)
% fstat_cdf.m - evaluates a F-Statistic Cumulative Distribution.
%   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 [cdf] = fstat_cdf(x, r, nmk)

pdf = fstat_pdf(x, r, nmk);
dx = x(2) - x(1);
sx = size(x,2);
cdf(1:sx) = 0;
for jx = 1:sx
    if(jx <= 2)
        cdf(jx) = trapz(pdf(1:jx)) * dx;
    elseif(jx > 2)
        cdf(jx) = simps(pdf(1:jx)) * dx;
    end
end

return

Contact us