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

triang_pdf(x, a, b, c)
% triang_pdf.m - evaluates a Triangular Probability Density.
%   See "Dataplot Reference Manual, TRICDF", 8-215, NIST, 3/21/97..
%
%  Created by Jim Huntley,  11/06/03
%
%

function [pdf] = triang_pdf(x, a, b, c)

if(x >= a & x <= c)
    pdf = 2*(x-a) / ((b-a)*(c-a));
elseif(x <= b & x > c);
    pdf = 2*(b-x) / ((b-a)*(b-c));
end

return

Contact us