Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

James Huntley (view profile)

 

generates random variates from over 870 univariate distributions

fisher_cdf(x,rho2,n,k)
% fisher_cdf.m - compute a Fisher Cumulative Distribution Function.
%   See "Continuous Univariate Distributions", Vol. 2, Johnson, Kotz and Balkrishnan,
%   J. Wiley, p. 619, 1995.              
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  01/11/07.
%

function [cdf] = fisher_cdf(x,rho2,n,k)

% Integrate PDF to get CDF.
pdf = fisher_pdf(x, rho2,n,k);
for jz = 1:size(x,2)
    if(jz == 1)
        cdf(jz) = trapz(pdf(1:jz));
    elseif(jz == 2)
        dx = x(2)-x(1);
        cdf(jz) = trapz(pdf(1:jz)) * dx;
    elseif(jz > 2)
        cdf(jz) = simps(pdf(1:jz)) * dx; 
    end
end

return




Contact us