Skip to content
Snippets Groups Projects
Commit aae6dcb1 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

com

parent 906d403c
No related branches found
No related tags found
No related merge requests found
......@@ -925,11 +925,12 @@ void NCurveFile::Fit( bool _allow_slow_conv )
if( status.info==11 )
throw "exception in fit function";
// compute fit quality metrics:
// Fit quality metrics Q:
// Q: status code
C->Quality[0] = (double) status.info;
// - coefficient of determination R^2 (for linear regression)
// Q: coefficient of determination R^2 (for linear regression)
double ysum1 = 0, ysum2 = 0;
for( uint i=0; i<nd; ++i ){
ysum1 += D->y[i];
......@@ -938,7 +939,7 @@ void NCurveFile::Fit( bool _allow_slow_conv )
double ydev2 = ysum2 - SQR( ysum1 )/nd; // = nd * <(y-<y>)^2>
C->Quality[1] = ydev2!=0 ? 1 - SQR(status.fnorm) / ydev2 : -1;
// - mean deviation (chi^2 if fvec is weighed with 1/dy)
// Q: mean deviation (chi^2 if fvec is weighed with 1/dy)
uint nfreedom = nd - npfree - 1;
if( nfreedom<1 ) nfreedom = 1;
C->Quality[2] = SQR(status.fnorm) / nfreedom;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment