VF_chi2VD_chi2VE_chi2
FunctionChi-square merit function.
Syntax C/C++#include <VFstd.h>
float VF_chi2( fVector X, fVector Y, fVector InvVar, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::chi2( const vector<T>& Y, const vector<T>& InvVar );
Pascal/Delphiuses VFstd;
function VF_chi2( X, Y, InvVar:fVector; size:UIntSize ): Single;
Descriptionc2 = sum( 1/si2 * (Xi - Yi)2 ).
The c2 (chi-square) merit function is most often used to judge the quality of a fit. One vector (either X or Y) represents experimental values that are obtained with individual standard deviations sigmai, the other contains the values predicted on the basis of a theory or a model. If the experimental data are "normally" distributed, and if s (sigma) is the correct measure for the quality of these data, then c2 is a measure for the quality of the fit. Rather than the standard deviations themselves, the routine needs the inverse of their squares (i.e., the inverse of the variances) to be passed as the vector InvVar.
Error handlingnone
Return valuechi2 merit function.
See alsoVF_meanwW,   VF_varianceVwW,   VF_varianceV,   VF_varianceCwW,   VF_chiabs,   VF_square,   VF_inv,   VF_linregress

VectorLib Table of Contents  OptiVec home