\Hat\mu = (1/N) \sum x_i
where x_i are the elements of the dataset data. For samples drawn from a gaussian distribution the variance of \Hat\mu is \sigma^2 / N.
\Hat\sigma^2 = (1/(N-1)) \sum (x_i - \Hat\mu)^2
where x_i are the elements of the dataset data. Note that the normalization factor of 1/(N-1) results from the derivation of \Hat\sigma^2 as an unbiased estimator of the population variance \sigma^2. For samples drawn from a gaussian distribution the variance of \Hat\sigma^2 itself is 2 \sigma^4 / N.
This function computes the mean via a call to gsl_stats_mean
. If
you have already computed the mean then you can pass it directly to
gsl_stats_variance_m
.
\Hat\sigma^2 = (1/(N-1)) \sum (x_i - mean)^2
\Hat\sigma^2 = (1/N) \sum (x_i - \mu)^2