84  Simulating HMMs

Open in Google Colab | Download notebook

As we have seen, simulating models (that is, formulating a model and then generating synthetic data from it) is a great way to study models in general. The formalism for an HMM is quite straightforward. An HMM is defined by Equation 52.1. It is just a matter of choosing an emission probability and priors.

Build an HMM with an appropriate emission probability where the observations are spikes. That is, the latent variables of the HMM affect spiking rate. Then, use your model to generate data sets and perform inference to see if you can recover the ground truth parameters you put into the model.