September 2018
Beginner to intermediate
178 pages
4h 57m
English
HMM can also have a Gaussian distribution for the emission probability. Just like MultinomialHMM, we can also sample from GaussianHMM. In the next code example, we use the GaussianHMM class provided in the hmmlearn library to see how the samples are generated from this type of model:
source activate hmmconda install scikit-learnpip install hmmlearn
Once the Python packages are installed, we can use the following code to generate samples from Gaussian HMM:
from hmmlearn.hmm import GaussianHMMimport numpy as npimport matplotlib.pyplot as plt
startprob = np.array([0.6, 0.3, 0.1, 0.0]) # The transition matrix, note that there are no transitions possible # between component 1 and 3 transmat = np.array([[0.7, 0.2, 0.0 ...
Read now
Unlock full access