sample_var function

Compute the sample variance