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

boxcoxpe_cdf(x, mu, sigma, nu, tau)
% boxcoxpe_cdf.m - compute Box Cox Power Exponential Cumulative Distribution Function.
%   See BCPE, "The GAMLSS Package", 
%   http://cran.r-project.org/doc/packages/gamlss.pdf, p.9.                
%
%  Created by:  Jim Huntley,  11/19/07.
%

function [cdf] = boxcoxpe_cdf(x, mu, sigma, nu, tau)

bcpepdf = boxcoxpe_pdf(x,mu,sigma,nu,tau);
sx = size(x,2);
qz(1:sx) = 0;

for jx = 1:sx
    if(jx <= 2)
        qz(1) = bcpepdf(1);
    elseif(jx == 2)
        dx = x(2)-x(1);
        qz(2) = trapz(bcpepdf(1:2)) * dx;
    elseif(jx > 2)
        dx = x(2)-x(1);
        qz(jx) = simps(bcpepdf(1:jx)) * dx;
    end
end

cdf = qz;

return




Contact us