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

hnormal_pdf(x, sigma, mu)
% hnormal_pdf.m - evaluates a Half Normal Probability Density.
%   See "Applied Robust Statistics", Chapter 3, D.J. Olive, p. 71.
%   http://www.math.siu.edu/olive/ol-bookp.htm.
%
%   Vector Form of PDF!!!!
%
%  Created by Jim Huntley,  01/21/10
%

function [pdf] = hnormal_pdf(x, sigma, mu)

%persistent coef

%if(isempty(coef))
    coef = 2 / (sqrt(2*pi)*sigma);
%end

pdf = coef .* exp(-0.5*(x-mu).^2./sigma^2);
%arg = (x-mu) ./ sigma;
%cdf = 2 .* gaus_cdf(arg, 0, 1) - 1;

return

Contact us