-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Description
I think I found a bug (or maybe this was already discussed elsewhere but could not find it).
If you do
init = [0.6, 0.4]
trans = [0.7 0.3; 0.2 0.8]
dists = [Normal(-0.8), Normal(0.8)]
hmm = HMM(init, trans, dists)
T = 20
state_seq, obs_seq = rand(hmm, T)
hmm_est, loglikelihood_evolution = baum_welch(hmm , obs_seq)
works but if you just change dists = Vector{Distribution{Univariate, Continuous}}([Normal(-0.8), Normal(0.8)])
it no longer works. (and more generally this happens when you have a vector of different distributions let say a Exponential
and a Gamma
)
ERROR: suffstats is not implemented for (Distribution{Univariate, Continuous}, Vector{Float64}, SubArray{Float64, 1, Matrix{Float64}, Tuple{Int64, Base.Slice{Base.OneTo{Int64}}}, true}).
Since your package is so clean, it was very easy to find the issue and a fix (maybe not the best? + I don't know if it happens only for Distributions.jl
)
See your code here and a fix here.
The type was infered from the vector of distribtutions and not from the distribution element it self.
Metadata
Metadata
Assignees
Labels
No labels