float variance (x, xdim) STATFUNS.C Level 3
 
float *x The x input vector.
int xdim The dimension of x.
 
variance() returns the variance of x which is defined as  S (x - <x>)(x - <x>)/(xdim - 1).
This formula incorporates Bessel's correction to the standard deviation which replaces xdim in the denominator with xdim - 1. Here <x> is the average of x.