Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

James Huntley (view profile)

 

generates random variates from over 870 univariate distributions

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

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

%persistent coef

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

pdf = coef ./ (1 + ((x-mu)./sigma).^2);
%cdf = 2 .* atan((x-mu)./sigma) ./ pi;
        
return

Contact us