From 8aaf7610226caf4b192b9ef56261b1ad43e7ec8f Mon Sep 17 00:00:00 2001 From: Michael Creel Date: Tue, 23 Apr 2024 15:38:08 +0200 Subject: [PATCH] typo and clear up negbin --- src/ML/Likelihoods/negbin.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ML/Likelihoods/negbin.jl b/src/ML/Likelihoods/negbin.jl index e832630..aa4516a 100644 --- a/src/ML/Likelihoods/negbin.jl +++ b/src/ML/Likelihoods/negbin.jl @@ -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