Provide complete test coverage for Gumbel distribution. Fix
documentation.
MODIFY
stat/distuv/gumbel.go
stat/distuv/gumbel.go
@@ -57,7 +57,7 @@ func (g GumbelRight) Mean() float64 {
return g.Mu + g.Beta*eulerMascheroni
}
-// Median returns the median of the normal distribution.
+// Median returns the median of the Gumbel distribution.
func (g GumbelRight) Median() float64 {
return g.Mu - g.Beta*math.Log(math.Ln2)
}

MODIFY
stat/distuv/gumbel_test.go
stat/distuv/gumbel_test.go
@@ -66,7 +66,9 @@ func testGumbelRight(t *testing.T, g GumbelRight, i int) {
min := math.Inf(-1)
testRandLogProbContinuous(t, i, min, x, g, tol, bins)
checkProbContinuous(t, i, x, math.Inf(-1), math.Inf(1), g, 1e-10)
+ checkEntropy(t, i, x, g, tol)
checkMean(t, i, x, g, tol)
+ checkMedian(t, i, x, g, tol)
checkVarAndStd(t, i, x, g, tol)
checkExKurtosis(t, i, x, g, 1e-1)
checkSkewness(t, i, x, g, 5e-2)
@@ -74,4 +76,7 @@ func testGumbelRight(t *testing.T, g GumbelRight, i int) {
if g.Mu != g.Mode() {
t.Errorf("Mismatch in mode value: got %v, want %g", g.Mode(), g.Mu)
}
+ if g.NumParameters() != 2 {
+ t.Errorf("Mismatch in NumParameters: got %v, want 2", g.NumParameters())
+ }
}

Provide complete test coverage for Gumbel distribution. Fix (#1360)

documentation.