Function vector_variance (o2scl)

O2scl : Function List

template<class vec_t>
double o2scl::vector_variance(size_t n, const vec_t &data, double mean)

Compute the variance with specified mean.

This function computes

\[ \frac{1}{N-1} \sum_{i} \left( x_i - \mu \right)^2 \]
where the value of \( \mu \) is given in mean.

This function produces the same results as gsl_stats_variance_m.

If n is 0 or 1, this function will call the error handler.

template<class vec_t>
double o2scl::vector_variance(const vec_t &data, double mean)

Compute the variance with specified mean.

This function computes

\[ \frac{1}{N-1} \sum_{i} \left( x_i - \mu \right)^2 \]
where the value of \( \mu \) is given in mean.

This function produces the same results as gsl_stats_variance_m.

If n is 0 or 1, this function will call the error handler.

template<class vec_t>
double o2scl::vector_variance(size_t n, const vec_t &data)

Compute the variance.

This function computes

\[ \frac{1}{N-1} \sum_{i} \left( x_i - \mu \right)^2 \]
where \( \mu \) is the mean computed with vector_mean().

This function produces the same results as gsl_stats_variance.

If n is 0 or 1, this function will call the error handler.

template<class vec_t>
double o2scl::vector_variance(const vec_t &data)

Compute the variance.

This function computes

\[ \frac{1}{N-1} \sum_{i} \left( x_i - \mu \right)^2 \]
where \( \mu \) is the mean computed with vector_mean().

This function produces the same results as gsl_stats_variance.

If n is 0 or 1, this function will call the error handler.