Questions
- Am I right in assuming that the emission probabilities will not be following a gaussian distribution for my particular problem?
- Obviously, I will need to train the model for state detection. As I understood from this answer, I should use the Baum-Welch algorithm, since I do not know emission and transition probabilities for my model. Is this correct?
- How to achieve "labeling" of each data sample state as being in a "systole" or "diastole" state, as below? Am I correct in assuming that the Baum-Welch algorithm will give me a pointwise state likelihood, that I can use to achieve this classification?
Legend: systole = red, diastole = white
- Can someone please point me to a example code or a lib for such a data classification/labeling task? I would prefer Python or Java, but anything else will do.
The Problem
I am facing the task of detecting systolic and diastolic phases of the cardiac cycle on a time series derived from an arterial line sampling, as represented by the following plot:
Legend: time -> artery area in pixels
After some reading, it would seem that one of the preferred ways of doing that is using a Hidden Markov Model. I also read Bayesian Methods for Hackers to get a grip on the subject.
From the Wikipedia page on the Viterbi algorithm, I modeled my problem as follows:
Since, diastole takes ~2/3 of the cardiac cycle time, the starting probabilities are known, but I do not understand how to calculate the rest and label my data. I found this Hidden Markov Model example using PyMC and gaussian emission probabilities, but I do not understand how to use it, and documentation is sparse...