From c4b01133a39b4d4ff23f1416a979296e66c27cda Mon Sep 17 00:00:00 2001 From: towsey Date: Tue, 29 Sep 2020 12:07:36 +1000 Subject: [PATCH] Update NormalDist.cs Change method that calculates mean and SD to accept just two values. Previously required three values minimum to calculate variance. This change may cause some tests to fail? --- src/TowseyLibrary/NormalDist.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TowseyLibrary/NormalDist.cs b/src/TowseyLibrary/NormalDist.cs index add6452f0..7989842ac 100644 --- a/src/TowseyLibrary/NormalDist.cs +++ b/src/TowseyLibrary/NormalDist.cs @@ -213,7 +213,7 @@ public static void AverageAndVariance(double[] data, out double av, out double v variance /= N; } else - if (N > 2) + if (N > 1) { variance /= N - 1; }