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

nc_chisq_pdf(x, n, s, sigma)
% nc_chisq_pdf.m evaluates a non-central Chi-squared Probability Distribution.
% See Proakis, "Digital Communications", pp. 42-45.
%
%  Created by Jim Huntley,  05/29/02
%

function [pdf] = nc_chisq_pdf(x, n, s, sigma)

ssq = s * s;
sigmasq = sigma * sigma;
nu = n/2 - 1;
z = sqrt(x) * s / sigmasq;
[inu, ierr] = besseli(nu, z);
pdf = (x / ssq)^((n-2)/4) * exp(-(ssq + x)/(2*sigmasq)) * inu / (2*sigmasq);

return

Contact us