var m = data.Average();
var s = CalculateStdDev(data);
float CalculateStdDev(IEnumerable<float> values)
{
double ret = 0;
if (values.Count() > 0)
{
double avg = values.Average();
double sum = values.Sum(d => Math.Pow(d - avg, 2));
ret = Math.Sqrt((sum) / values.Count()-1);
}
return (float)ret;
}