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

tsogive_pdf(x, nn, theta, a, b)
% tsogive_pdf.m - evaluates a Two-Sided Ogive Probability Density.
%   See "Dataplot Reference Manual", Vol.1, Aux., NIST, TSOPDF.
%
%   Vectorr Form of PDF!!!
%
%  Created by Jim Huntley,  04/06/09
%

function [pdf] = tsogive_pdf(x, nn, theta, a, b)

%persistent omth bma

%if(isempty(bma))
    omth = 1 - theta;
    bma = b - a;
%end

for jx = 1:size(x,2)
    arg = (x(jx) - a) / bma;
    if(arg > theta)
        pdf(jx) = nn * ((1-arg)/omth)^(nn-1) * ((4*nn-2)-(2*nn-2)*((1-arg)/omth)^nn) / ((3*nn-1)*bma);
    elseif(arg <= theta)
        pdf(jx) = nn * (arg/theta)^(nn-1) * ((4*nn-2)-(2*nn-2)*(arg./theta)^nn) / ((3*nn-1)*bma);
    end
end        
        
return

Contact us