Mercurial > hg > ltpda
diff m-toolbox/classes/+utils/@math/Chi2cdf.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/+utils/@math/Chi2cdf.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,31 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Compute Chi square cumulative distribution function +% +% CALL +% +% p = Chi2cdf(x,v); +% +% +% INPUT +% +% - x, data +% - v, degrees of freedom of the distribution +% +% References: +% [1] M. Abramowitz and I. A. Stegun, "Handbook of Mathematical +% Functions", Government Printing Office, 1964, 26.4. +% +% +% L Ferraioli 14-02-2011 +% +% $Id: Chi2cdf.m,v 1.2 2011/05/30 17:18:09 luigi Exp $ +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function p = Chi2cdf(x,v) + +% Call the gamma distribution function. +p = gammainc(x./2,v/2); + + +end \ No newline at end of file