| 187 |
|
} |
| 188 |
|
|
| 189 |
|
outStream << "#######################################################\n"; |
| 190 |
< |
outStream << "# Standard Deviations in those quantities follow:\n"; |
| 190 |
> |
outStream << "# 95% confidence intervals in those quantities follow:\n"; |
| 191 |
|
outStream << "#######################################################\n"; |
| 192 |
|
|
| 193 |
|
for (int j = 0; j < nBins_; j++) { |
| 200 |
|
|
| 201 |
|
int n = outputData->accumulator[j]->count(); |
| 202 |
|
if (n != 0) { |
| 203 |
< |
writeStdDev( outStream, outputData, j ); |
| 203 |
> |
writeErrorBars( outStream, outputData, j ); |
| 204 |
|
} |
| 205 |
|
} |
| 206 |
|
outStream << std::endl; |
| 257 |
|
} |
| 258 |
|
} |
| 259 |
|
|
| 260 |
< |
void SpatialStatistics::writeStdDev(ostream& os, OutputData* dat, |
| 260 |
> |
void SpatialStatistics::writeErrorBars(ostream& os, OutputData* dat, |
| 261 |
|
unsigned int bin) { |
| 262 |
|
assert(int(bin) < nBins_); |
| 263 |
|
int n = dat->accumulator[bin]->count(); |
| 265 |
|
|
| 266 |
|
if( dat->dataType == odtReal ) { |
| 267 |
|
RealType r; |
| 268 |
< |
dynamic_cast<Accumulator*>(dat->accumulator[bin])->getStdDev(r); |
| 268 |
> |
dynamic_cast<Accumulator*>(dat->accumulator[bin])->get95percentConfidenceInterval(r); |
| 269 |
|
if (isinf(r) || isnan(r) ) { |
| 270 |
|
sprintf( painCave.errMsg, |
| 271 |
|
"SpatialStatistics detected a numerical error writing:\n" |
| 279 |
|
|
| 280 |
|
} else if ( dat->dataType == odtVector3 ) { |
| 281 |
|
Vector3d v; |
| 282 |
< |
dynamic_cast<VectorAccumulator*>(dat->accumulator[bin])->getStdDev(v); |
| 282 |
> |
dynamic_cast<VectorAccumulator*>(dat->accumulator[bin])->get95percentConfidenceInterval(v); |
| 283 |
|
if (isinf(v[0]) || isnan(v[0]) || |
| 284 |
|
isinf(v[1]) || isnan(v[1]) || |
| 285 |
|
isinf(v[2]) || isnan(v[2]) ) { |