Added test for statistics + fix bug variance

This is the basic example of the paper.
Also fixed a strange problem in computation of the variance:

I have identified cases where:

$$ 1/N sum_i (x_i- m)^2  \neq 1/N sum_i x_i^2 - m^2 $$

with $ m = 1/N sum_i x_i $

In particular, the RHS (which corresponds to previous implementation) may give **negative** variances!! LHS seems to be more accurate (especially in cases where x_i is very close to m) --> changed implementation to LHS