Get the mean of the set of observations
float mean = sigma_fx ( a ) / f ; float sum = 0 ; foreach ( pair i in a ) { sum += ( i . first - mean ) * ( i . first - mean ) * i . second ; } return ( float ) Math . Sqrt ( sum / f ) ; }