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

stsd3_cdf(x, k)
% stsd3_cdf.m - evaluatess a Sort-Tail Symmetric III Cumulative Distribution.
%   See "Robust Estimation and Hypothesis Testing Under Short-Tailedness And Inliers",
%   A.D. Akkaya and M.L. Tiku, Sociedad de Estadistica e Investigacion Operativa Test 
%   2005, Vol. 14, No. 1, pp.129-150.
%
%  Created by Jim Huntley,  12/06/07
%

function [cdf] = stsd3_cdf(x, k)

%persistent coef

%if(isempty(coef))
    coef = k * 2^(k-1);
%end

for jx = 1:size(x,2)
    if(x(jx) < 0.5)
        cdf(jx) = 0.5 - coef * (0.5-x(jx))^k / k;
    elseif(x(jx) >= 0.5)
        cdf(jx) = 0.5 + coef*(x(jx)-0.5)^k / k;
    end
end

return

Contact us