# Sampling from HMM

This script shows how to sample points from a Hidden Markov Model (HMM): we use a 4-components with specified mean and covariance.

The plot show the sequence of observations generated with the transitions between them. We can see that, as specified by our transition matrix, there are no transition between component 1 and 3.

Prepare parameters for a 4-components HMM Initial population probability

Total running time of the script: ( 0 minutes 0.676 seconds)

# Gaussian HMM of stock data

This script shows how to use Gaussian HMM on stock price data from Yahoo! finance. For more information on how to visualize stock prices with matplotlib, please refer to date_demo1.py of matplotlib.

Get quotes from Yahoo! finance

Run Gaussian HMM

Out:

Print trained parameters and plot

Out:

Total running time of the script: ( 0 minutes 2.903 seconds)