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

kappa4p_cdf(x, h, k, tsi, alpha)
% kappa4p_cdf.m - evaluates a Kappa 4-Parameter Cumulative Distribution.
%   See "The Four-Parameter Kappa Distribution", J. R. M. Hosking,
%   IBM Jour. Res. Develop., vol.68, No.3, May 1994.
%
%  Created by Jim Huntley,  12/21/07
%

function [cdf] = kappa4p_cdf(x, h, k, tsi, alpha)

if(k ~= 0 && h ~= 0)
    cdf = (1 - h.*(1 - k.*(x-tsi)./alpha).^(1/k)).^(1/h);
elseif(k ~= 0 && h == 0)
    cdf = exp(-(1 - k.*(x-tsi)./alpha).^(1/k));
elseif(k == 0 && h ~= 0)
    cdf = (1 - h.*exp(-(x-tsi)./alpha)).^(1/h);
elseif(k == 0 && h == 0)
    cdf = exp(-exp(-(x-tsi)./alpha));
end

return

Contact us