This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using System.Collections.Generic;
using System.Linq;
namespace DTS.Utilities
{
public class StandardDev
{
public static double StandardDeviation(IEnumerable<double> values)
{
double standardDeviation = 0;
if (!values.Any()) return standardDeviation;
// Compute the average.
double avg = values.Average();
// Perform the Sum of (value-avg)_2_2.
double sum = values.Sum(d => System.Math.Pow(d - avg, 2));
// Put it all together.
standardDeviation = System.Math.Sqrt((sum) / (values.Count() - 1));
return standardDeviation;
}
}
}