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

daniels_pdf(x, n, r)
% daniels_pdf.m - evaluates a Daniels Probability Density.
%   See "General Formulae for the Central Moments of Certain
%   Serial Correlation Coefficient Approximations", A.W. Kemp,
%   Queen's University of Belfast, 1/22/1970.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  07/17/06
%
%

function [pdf] = daniels_pdf(x, n, r)

%persistent coef

%if(isempty(coef))
    coef = (n+1) / ((n-n*r+1+r)*beta(0.5*n,0.5));
%end

pdf = coef .* (1-x.^2).^(0.5*n-1) .* (1+r^2-2.*r.*x).^(-0.5*n) .* (1-x);

return

Contact us