|
STK++ 0.9.13
|
Compute safely the variance of the variable V. More...
#include <STK_Stat_Functors.h>
Public Types | |
| typedef Derived::Type | Type |
Public Member Functions | |
| VarianceSafeOp (ExprBase< Derived > const &V) | |
| constructor | |
| Type const | operator() (bool unbiased) const |
| template<class Weights > | |
| Type const | operator() (ExprBase< Weights > const &w, bool unbiased) const |
Protected Attributes | |
| Derived const & | V_ |
Compute safely the variance of the variable V.
Definition at line 473 of file STK_Stat_Functors.h.
| typedef Derived::Type STK::Stat::VarianceSafeOp< Derived >::Type |
Definition at line 475 of file STK_Stat_Functors.h.
|
inline |
constructor
Definition at line 477 of file STK_Stat_Functors.h.
References STK_STATIC_ASSERT_ONE_DIMENSION_ONLY.
|
inline |
![\[ \hat{\sigma}^2 = \frac{1}{n} \sum_{i=1}^n (V(i)-\hat{\mu})^2. \]](form_295.png)
| unbiased | true if we want an unbiased estimate of the variance, false otherwise |
Definition at line 484 of file STK_Stat_Functors.h.
References STK::Stat::sum(), and STK::Stat::VarianceSafeOp< Derived >::V_.
|
inline |
![\[ \hat{\sigma}^2
= \frac{\sum_{i=1}^n w(i)}{\left( \sum_{i=1}^n w(i))\right)^2-\sum_{i=1}^n w(i)^2}
\sum_{i=1}^n w(i) (V(i)-\hat{\mu})^2.
\]](form_296.png)
| w | weights |
| unbiased | true if we want an unbiased estimate of the variance, false otherwise |
Definition at line 522 of file STK_Stat_Functors.h.
References STK::Arithmetic< Type >::isNA(), STK_STATIC_ASSERT_ONE_DIMENSION_ONLY, STKRUNTIME_ERROR_NO_ARG, STK::Stat::sum(), and STK::Stat::VarianceSafeOp< Derived >::V_.
|
protected |
Definition at line 551 of file STK_Stat_Functors.h.
Referenced by STK::Stat::VarianceSafeOp< Derived >::operator()(), and STK::Stat::VarianceSafeOp< Derived >::operator()().