Fixed standard deviation calculation