VF_chiabsVD_chiabsVE_chiabs
VF_chiabswSaturationVD_chiabswSaturationVE_chiabswSaturation
FunctionAbsolute-value analogue of the chi-square merit function.
Syntax C/C++#include <VFstd.h>
float VF_chiabs( fVector X, fVector Y, fVector Wt, ui size );
float VF_chiabswSaturation( fVector X, fVector Y, fVector Wt, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::chiabs( const vector<T>& Y, const vector<T>& Wt )
T vector<T>::chiabswSaturation( const vector<T>& Y, const vector<T>& Wt );
Pascal/Delphiuses VFstd;
function VF_chiabs( X, Y, Wt:fVector; size:UIntSize ): Single;
function VF_chiabswSaturation( X, Y, Wt:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_chiabs( float *h_RetVal, fVector d_X, fVector d_Y, fVector d_Wt, ui size );
int cusdVF_chiabs( float *d_RetVal, fVector d_X, fVector d_Y, fVector d_Wt, ui size );
float VFcu_chiabs( fVector h_X, fVector h_Y, fVector h_Wt, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_chiabs( var h_RetVal:Single; d_X, d_Y, d_Wt:fVector; size:UIntSize ): IntBool;
function cusdVF_chiabs( d_RetVal:PSingle; d_X, d_Y, d_Wt:fVector; size:UIntSize ): IntBool;
function VFcu_chiabs( h_X, h_Y, h_Wt:fVector; size:UIntSize ): Single;
Descriptionchiabs = sum( Wti * |Xi - Yi| ).
The chiabs function is a "robust" replacement for the c2 (chi-square) merit function. It is used to judge the quality of a fit in the presence of outlier points. The chiabs function is disturbed by outlier points to a lesser degree than the chi-square function.

V?_chiabswSaturation is almost identical to V?_chiabs, except for the treatment of infinities and NAN values. While V?_chiabs may overflow to INF and will return NAN, if any input element is a NAN, V?_chiabswSaturation will saturate possible overflow into HUGE_VAL and treats input values of ±NAN as ±HUGE_VAL. Thereby, it becomes most suitable for use inside the nonlinear fitting routines. If the fitting routine needs the figure-of-merit for a parameter set, any bad parameter set should give the feedback that the guess was far off; you do not want to raise an exception or crash the programme here.

Error handlingnone
Return valuechiabs merit function.
See alsoVF_chi2

VectorLib Table of Contents  OptiVec home