| 35 |  | * | 
| 36 |  | * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). | 
| 37 |  | * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). | 
| 38 | < | * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). | 
| 38 | > | * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). | 
| 39 |  | * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010). | 
| 40 |  | * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). | 
| 41 |  | */ | 
| 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(RealType(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(RealType(Count_)); | 
| 293 | + | ret[1] = 1.960 * sd[1] / sqrt(RealType(Count_)); | 
| 294 | + | ret[2] = 1.960 * sd[2] / sqrt(RealType(Count_)); | 
| 295 |  | return; | 
| 296 |  | } | 
| 297 |  |  | 
| 341 |  | ret = sqrt(var); | 
| 342 |  | return; | 
| 343 |  | } | 
| 344 | < |  | 
| 345 | < | protected: | 
| 346 | < | size_t Count_; | 
| 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(RealType(Count_)); | 
| 359 | > | return; | 
| 360 | > | } | 
| 361 | > |  | 
| 362 | > |  | 
| 363 |  | private: | 
| 364 |  | ResultType Val_; | 
| 365 |  | ResultType Avg_; | 
| 449 |  | } | 
| 450 |  | return; | 
| 451 |  | } | 
| 452 | < |  | 
| 453 | < | protected: | 
| 454 | < | size_t Count_; | 
| 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(RealType(Count_)); | 
| 469 | > | } | 
| 470 | > | } | 
| 471 | > | return; | 
| 472 | > | } | 
| 473 | > |  | 
| 474 |  | private: | 
| 475 |  | ElementType Val_; | 
| 476 |  | ResultType Avg_; |