Atlas › Test

symmetry:_k=0_equals_k=n

Exact test identity: go.temporal.io/server/tools/flakereport/TestLogBetaBinomial/symmetry:_k=0_equals_k=n

Package
go.temporal.io/server/tools/flakereport
Suite / test hierarchy
TestLogBetaBinomial/symmetry:_k=0_equals_k=n
Test
symmetry:_k=0_equals_k=n
Introduced at
bisect.go ×2 Frontier kind: Joint frontier
Covered ranges
2
Covered lines
9
Covered files
1

Co-introduced tests

3 other tests enter at the same concept.

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

go.temporal.io/server/tools/flakereport/bisect.go 9 covered LOC · 2 ranges

Open complete file

20
21 // logBeta returns log(Beta(a, b)) = lgamma(a) + lgamma(b) - lgamma(a+b).
22 > func logBeta(a, b float64) float64 { bisect.go
23 > la, _ := math.Lgamma(a)
24 > lb, _ := math.Lgamma(b)
25 > lab, _ := math.Lgamma(a + b)
26 > return la + lb - lab
27 > }
28
29 // logBetaBinomial returns the log marginal likelihood of observing k failures
30 // in n trials with a Beta(alpha, beta) prior on the failure probability.
31 // With Beta(1,1) prior this is the log Beta-Binomial marginal likelihood.
32 > func logBetaBinomial(n, k int, alpha, beta float64) float64 { bisect.go
33 > return logBeta(float64(k)+alpha, float64(n-k)+beta) - logBeta(alpha, beta)
34 > }
35
36 // logSumExpNormalize converts log-weights to probabilities using the log-sum-exp trick