Function vector_pvariance (o2scl)

O2scl : Function List

template<class vec_t, class vec2_t>
double o2scl::vector_pvariance(size_t n1, const vec_t &data1, size_t n2, const vec2_t &data2)

The pooled variance of two vectors.

This function computes

\[ s_{p}^2 = \frac{(n_1-1)s_1^2+(n_2-1)s_2^2}{n_1+n_2-2} \]
where \( n_i \) is the number of elements in vector \( i \) and \( s_i^2 \) is the variance of vector \( i \).

From http://en.wikipedia.org/wiki/Pooled_variance

, “Under the

assumption of equal population variances, the pooled sample

variance provides a higher precision estimate of variance than

the individual sample variances.”

This function produces the same results as gsl_stats_pvariance().

template<class vec_t, class vec2_t>
double o2scl::vector_pvariance(const vec_t &data1, const vec2_t &data2)

The pooled variance of two vectors.

This function computes

\[ s_{p}^2 = \frac{(n_1-1)s_1^2+(n_2-1)s_2^2}{n_1+n_2-2} \]
where \( n_i \) is the number of elements in vector \( i \) and \( s_i^2 \) is the variance of vector \( i \).

From http://en.wikipedia.org/wiki/Pooled_variance

, “Under the

assumption of equal population variances, the pooled sample

variance provides a higher precision estimate of variance than

the individual sample variances.”

This function produces the same results as gsl_stats_pvariance().