Changeset 343 for trunk/projects/polly/lreg.c
- Timestamp:
- 01/17/07 00:38:49 (4 years ago)
- Files:
-
- 1 modified
-
trunk/projects/polly/lreg.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/projects/polly/lreg.c
r340 r343 114 114 115 115 // standard deviation of the points 116 double stddevPoints = isqrt( (SSyy - b * SSxy)/(size-2) ); 116 // printf( "1 sqrt( %f )=",(SSyy - b * SSxy)/(size-2)); 117 // double stddevPoints = isqrt( (SSyy - b * SSxy)/(size-2) ); 118 // printf( "%f\n",stddevPoints); 117 119 118 120 // Error of the slope 119 double bError = stddevPoints / isqrt( SSxx ); 121 // printf( "2 sqrt( %f )=",SSxx); 122 // double bError = stddevPoints / isqrt( SSxx ); 123 // printf( "%f\n",isqrt( SSxx)); 120 124 121 125 double r2Numerator = (size * Sxy) - (Sx * Sy); … … 123 127 double r2 = (r2Numerator * r2Numerator) / r2Denominator; 124 128 125 double signB = (b < 0) ? -1.0 : 1.0; 126 printf( "signB = %f r2 = %f\n",signB,r2); 127 double r = signB * isqrt( r2*10000 ); 129 //double signB = (b < 0) ? -1.0 : 1.0; 130 //printf( "3 sqrt(%f)=",r2); 131 //double r = signB * isqrt(r2); 132 //printf( "%f\n",r); 128 133 129 reg_out->r = r;134 reg_out->r_sqr = r2; 130 135 reg_out->a = a; 131 136 reg_out->b = b; 132 reg_out->bError = bError; 133 reg_out->stddevPoints= stddevPoints; 137 reg_out->bError = 0; 138 reg_out->stddevPoints= 0; 139 //reg_out->bError = bError; 140 //reg_out->stddevPoints= stddevPoints; 134 141 } // if N > 0 135 142
