Skip to content

Commit

Permalink
Update NormalDist.cs
Browse files Browse the repository at this point in the history
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?
  • Loading branch information
towsey authored and atruskie committed Oct 14, 2020
1 parent ea81074 commit c4b0113
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TowseyLibrary/NormalDist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c4b0113

Please sign in to comment.