163 |
|
return; |
164 |
|
} |
165 |
|
|
166 |
+ |
/** |
167 |
+ |
* return the 95% confidence interval: |
168 |
+ |
* |
169 |
+ |
* That is returns c, such that we have 95% confidence that the |
170 |
+ |
* true mean is within 2c of the Average (x): |
171 |
+ |
* |
172 |
+ |
* x - c <= true mean <= x + c |
173 |
+ |
* |
174 |
+ |
*/ |
175 |
+ |
void get95percentConfidenceInterval(ResultType &ret) { |
176 |
+ |
assert(Count_ != 0); |
177 |
+ |
RealType sd; |
178 |
+ |
this->getStdDev(sd); |
179 |
+ |
ret = 1.960 * sd / sqrt(Count_); |
180 |
+ |
return; |
181 |
+ |
} |
182 |
+ |
|
183 |
|
private: |
184 |
|
ElementType Val_; |
185 |
|
ResultType Avg_; |
273 |
|
ret[0] = sqrt(var[0]); |
274 |
|
ret[1] = sqrt(var[1]); |
275 |
|
ret[2] = sqrt(var[2]); |
276 |
+ |
return; |
277 |
+ |
} |
278 |
+ |
|
279 |
+ |
/** |
280 |
+ |
* return the 95% confidence interval: |
281 |
+ |
* |
282 |
+ |
* That is returns c, such that we have 95% confidence that the |
283 |
+ |
* true mean is within 2c of the Average (x): |
284 |
+ |
* |
285 |
+ |
* x - c <= true mean <= x + c |
286 |
+ |
* |
287 |
+ |
*/ |
288 |
+ |
void get95percentConfidenceInterval(ResultType &ret) { |
289 |
+ |
assert(Count_ != 0); |
290 |
+ |
ResultType sd; |
291 |
+ |
this->getStdDev(sd); |
292 |
+ |
ret[0] = 1.960 * sd[0] / sqrt(Count_); |
293 |
+ |
ret[1] = 1.960 * sd[1] / sqrt(Count_); |
294 |
+ |
ret[2] = 1.960 * sd[2] / sqrt(Count_); |
295 |
|
return; |
296 |
|
} |
297 |
|
|
342 |
|
return; |
343 |
|
} |
344 |
|
|
345 |
+ |
/** |
346 |
+ |
* return the 95% confidence interval: |
347 |
+ |
* |
348 |
+ |
* That is returns c, such that we have 95% confidence that the |
349 |
+ |
* true mean is within 2c of the Average (x): |
350 |
+ |
* |
351 |
+ |
* x - c <= true mean <= x + c |
352 |
+ |
* |
353 |
+ |
*/ |
354 |
+ |
void getLength95percentConfidenceInterval(ResultType &ret) { |
355 |
+ |
assert(Count_ != 0); |
356 |
+ |
RealType sd; |
357 |
+ |
this->getLengthStdDev(sd); |
358 |
+ |
ret = 1.960 * sd / sqrt(Count_); |
359 |
+ |
return; |
360 |
+ |
} |
361 |
+ |
|
362 |
+ |
|
363 |
|
private: |
364 |
|
ResultType Val_; |
365 |
|
ResultType Avg_; |
449 |
|
} |
450 |
|
return; |
451 |
|
} |
452 |
< |
|
452 |
> |
|
453 |
> |
/** |
454 |
> |
* return the 95% confidence interval: |
455 |
> |
* |
456 |
> |
* That is returns c, such that we have 95% confidence that the |
457 |
> |
* true mean is within 2c of the Average (x): |
458 |
> |
* |
459 |
> |
* x - c <= true mean <= x + c |
460 |
> |
* |
461 |
> |
*/ |
462 |
> |
void get95percentConfidenceInterval(ResultType &ret) { |
463 |
> |
assert(Count_ != 0); |
464 |
> |
Mat3x3d sd; |
465 |
> |
this->getStdDev(sd); |
466 |
> |
for (unsigned int i = 0; i < 3; i++) { |
467 |
> |
for (unsigned int j = 0; j < 3; j++) { |
468 |
> |
ret(i,j) = 1.960 * sd(i,j) / sqrt(Count_); |
469 |
> |
} |
470 |
> |
} |
471 |
> |
return; |
472 |
> |
} |
473 |
> |
|
474 |
|
private: |
475 |
|
ElementType Val_; |
476 |
|
ResultType Avg_; |