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

tspower_cdf(x, nn, theta)
% tspower_cdf.m - evaluates a Two-Sided Power Cumulative Distribution.
%   See "Dataplot Reference Manual", Vol.1, Aux., NIST, TSPCDF.
%
%  Created by Jim Huntley,  01/13/10
%

function [cdf] = tspower_cdf(x, nn, theta)

for jx = 1:size(x,2)
    if(x(jx) > theta)
        cdf(jx) = 1 - (1-theta) * ((1-x(jx))/(1-theta))^nn;
    elseif(x(jx) <= theta)
        cdf(jx) = theta * (x(jx)/theta)^nn;
    end
end        

return

Contact us