From 1236d60193ec80c20ceb0c77e2432d4c53dc7813 Mon Sep 17 00:00:00 2001 From: Roman Werpachowski <61159095+romanwerpachowski@users.noreply.github.com> Date: Thu, 2 Jul 2020 00:09:20 +0100 Subject: [PATCH] stat/distuv: provide complete test coverage for LogNormal distribution --- stat/distuv/lognormal_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stat/distuv/lognormal_test.go b/stat/distuv/lognormal_test.go index fee6e612a..fb47768dc 100644 --- a/stat/distuv/lognormal_test.go +++ b/stat/distuv/lognormal_test.go @@ -38,6 +38,14 @@ func TestLognormal(t *testing.T) { checkProbContinuous(t, i, x, 0, math.Inf(1), dist, 1e-10) checkProbQuantContinuous(t, i, x, dist, tol) checkMode(t, i, x, dist, 1e-2, 1e-2) + + logProb := dist.LogProb(-0.0001) + if !math.IsInf(logProb, -1) { + t.Errorf("Expected LogProb == -Inf for x < 0, got %v", logProb) + } + if dist.NumParameters() != 2 { + t.Errorf("Mismatch in NumParameters: got %v, want 2", dist.NumParameters()) + } } }