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

koenker_pdf(x, a, b)
% koenker_pdf.m - evaluates a Koenker Probability Density.
%   See VGAM, 9 February, 2011.
%
%  Created by Jim Huntley,  09/12/11
%

function [pdf] = koenker_pdf(x, a, b)

%persistent coef

%if(isempty(coef))
    coef = 1 / (1 + a/sqrt((a/b)^2+4));    %normalization constant
%end

argx = (x - a) ./ b;
pdf = 4 .* coef ./ (4 + argx.^2).^1.5;

return

Contact us