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

sqline_cdf(x)
% sqline_cdf.m - evaluates a Square Line Picking Cumulative Distribution.
%   See web, "http://mathworld.wolfram.com/SquareLinePicking.html".
%
%  Created by Jim Huntley,  09/30/05
%
%

function [cdf] = sqline_cdf(x)

if(x >= 0 & x <= 1)
    cdf = 0.5*x^4 - 8*x^3/3 + pi*x^2;
elseif(x > 1 & x <= sqrt(2))
    cdf = -0.5*x^4 + (pi-2)*x^2 + 1/3 + 8*((x^2-1)^(3/2))/3 - 4*x^2*atan(sqrt(x^2-1)) + 4*sqrt(x^2-1);
end

return

Contact us