Skip to content

Commit

Permalink
typo and clear up negbin
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Creel committed Apr 23, 2024
1 parent 9bc59df commit 8aaf761
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ML/Likelihoods/negbin.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ function negbin(θ, y, x, nbtype)
eps = 1e-8
λ = eps .+ exp.(x*β)
α = eps .+ exp(θ[end])
nbtype == 1 ? r = λ./α : r = ones(n)/α
p = r ./ (r + λ)
nbtype == 1 ? ψ = λ./α : ψ = ones(n)/α
p = ψ ./ (ψ + λ)
all(r .> 0.0) & all(p .> 0.0) & all(p .< 1.0) ? log.(pdf.(NegativeBinomial.(r, p),y)) : -Inf
end

Expand Down

0 comments on commit 8aaf761

Please sign in to comment.