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

mckay1_cdf(x,a,b,c)
% mckay1_cdf.m - compute McKay I Cumulative Distribution Function.
%   See "Sum & Difference of 2 Squared Correlated Nakagami Variates
%   in Connection with the McKay Distribution", H. Holm & M-S Alouini,
%   IEEE Trans. Comm., Vol. 52, No. 8, August 2004, p. 1368.                
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  03/31/05.
%

function [cdf] = mckay1_cdf(x,a,b,c)

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(@mckay1_pdf,minx,x(jz),tol,trace,a,b,c);
end

return



Contact us