Skip to content

Commit

Permalink
delete underflow correction - otherwise won't replicate
Browse files Browse the repository at this point in the history
  • Loading branch information
m-dadej committed Mar 29, 2024
1 parent 7e0af86 commit 6fa582d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/likelihood.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ function loglik(θ::Vector{Float64},
# η[:, i] = pdf.(Normal.(view(X, :, 2:(n_β+n_β_ns+2))*β[i], σ[i]), view(X, :, 1))
# end

η .+= 1e-12
# if there is an underflow error for some reason I added this:
#η .+= 1e-30
# but it may alter the estimations in some cases. Same in TVTP

@inbounds for t in 1:T
ξ[t,:] = t == 1 ? ξ_0 : view(ξ, t-1, :)
Expand Down Expand Up @@ -66,7 +68,7 @@ function loglik_tvtp(θ::Vector{Float64},

# f(y | S_t, x, θ, Ψ_t-1) density function
η = reduce(hcat, [pdf.(Normal.(view(X, :,2:n_β+n_β_ns+2)*β[i], σ[i]), view(X, :,1)) for i in 1:k])
η .+= 1e-12
#η .+= 1e-30

@inbounds for t in 1:T
ξ[t,:] = t == 1 ? ξ_0 : view(ξ, t-1, :)
Expand Down

0 comments on commit 6fa582d

Please sign in to comment.