public double stdev ( ) { double m = mean ( ) ; double total = 0 ; final int N = getNumElements ( ) ; if ( N <= 1 ) throw new IllegalArgumentException ( "There must be more than one element to compute stdev" ) ; for ( int i = 0 ; i < N ; i ++ ) { double x = get ( i ) ; total += ( x - m ) * ( x - m ) ; } total /= ( N - 1 ) ; return Math . sqrt ( total ) ; }
Computes the unbiased standard deviation of all the elements .