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

champer_cdf(x, mu, theta);
% champer_cdf.m - compute Champernowne Cumulative Distribution Function.
%   See "On the Shape of Optimal Non-Linear Income Tax Schedule, M. Tuomala, 
%   Tampere Economic Working Paper #49, Apr, 2006, http://tampub.uta.fi/econet/wp49-2006.pdf.            
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  07/18/06.
%

function [cdf] = champer_cdf(x, mu, theta);

tol = 1e-8;
trace = [];
warning off MATLAB:quad:MinStepSize;

minx = min(x);

% Integrate PDF to get CDF.
warning off MATLAB:quad:MinStepSize
sz = size(x,2);
for jz = 1:sz
    cdf(jz) = quad(@champer_pdf,minx,x(jz),tol,trace,mu,theta);
end

return



Contact us