Function wvector_variance_fmean (o2scl)¶
-
template<class vec_t, class vec2_t>
double o2scl::wvector_variance_fmean(size_t n, const vec_t &data, const vec2_t &weights, double wmean)¶ Compute the variance of a weighted vector with a mean known in advance.
This function computes
\[ \left[ \sum_i w_i \left(x_i-\mu\right)^2 \right] \left[ \sum_i w_i \right]^{-1} \]This function produces the same results as
gsl_stats_wvariance_with_fixed_mean()
.
-
template<class vec_t, class vec2_t>
double o2scl::wvector_variance_fmean(const vec_t &data, const vec2_t &weights, double wmean)¶ Compute the variance of a weighted vector with a mean known in advance.
This function computes
\[ \left[ \sum_i w_i \left(x_i-\mu\right)^2 \right] \left[ \sum_i w_i \right]^{-1} \]This function produces the same results as
gsl_stats_wvariance_with_fixed_mean()
.