Skip to content

Commit

Permalink
stat/distuv: provide complete test coverage for LogNormal distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
romanwerpachowski committed Jul 1, 2020
1 parent 142f1a8 commit 1236d60
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions stat/distuv/lognormal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
}

Expand Down

0 comments on commit 1236d60

Please sign in to comment.