Skip to content

Commit

Permalink
get rid of all NB padding and clamping
Browse files Browse the repository at this point in the history
  • Loading branch information
seabbs committed Aug 2, 2024
1 parent 7bdb361 commit 7c8b12f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions EpiAware/src/EpiObsModels/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ Compute the mean-cluster factor negative binomial distribution.
A `NegativeBinomial` distribution object.
"""
function NegativeBinomialMeanClust(μ, α)
= clamp(μ, 1e-6, 1e17)
= clamp(α, 1e-6, Inf)
ex_σ² = (_α *^2)
p = clamp(_μ / (_μ + ex_σ²), 1e-17, 1 - 1e-17)
r = clamp(_μ^2 / ex_σ², 1e-17, 1e17)
μ² = μ^2
ex_σ² = α * μ²
p = μ /+ ex_σ²)
r = μ² / ex_σ²
return NegativeBinomial(r, p)
end

0 comments on commit 7c8b12f

Please sign in to comment.