Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Example for multivariate features GMMHMM, include in docs #40

Open
rbeeli opened this issue Jun 13, 2022 · 1 comment
Open

Example for multivariate features GMMHMM, include in docs #40

rbeeli opened this issue Jun 13, 2022 · 1 comment

Comments

@rbeeli
Copy link

rbeeli commented Jun 13, 2022

Hi,

do you have an example for a multivariate features Gaussian Mixture Model HMM, similar to GMMHMM from the hmmlearn Python package?
Extending the docs with such an example would help a lot.

Many thanks.

@rbeeli rbeeli changed the title Example for GMMHMM, include in docs Example for multivariate features GMMHMM, include in docs Jun 13, 2022
@maxmouchet
Copy link
Owner

maxmouchet commented Jun 24, 2022

Hi,

This is currently unsupported out-of-the-box as the MixtureModel type from Distributions.jl does not implement fit_mle. Something like this could work:

using Distributions
using HMMBase

function Distributions.fit_mle(::Type{MixtureModel{Univariate, Continuous, Normal{Float64}, Categorical{Float64, Vector{Float64}}}}, x::Matrix, w::Vector)
    # Implement ML estimator here and return fitted mixture model.
end

A = [0.9 0.1; 0.1 0.9]
B = [
    MixtureModel([Normal(0, 1), Normal(1, 1)]),
    MixtureModel([Normal(10, 1), Normal(11, 1)])
]

hmm = HMM(A, B)
y = rand(hmm, 500)

fit_mle(hmm, y)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants