Questions tagged [hidden-markov-model]
Hidden Markov Models are used for modelling systems that are assumed to be Markov processes with hidden (i.e. unobserved) states.
598
questions
1
vote
1
answer
14
views
R MSM package: how to flag incident and prevalent disease?
I am trying to create a 2-state Markov model (state 1 to 2 and 2 to 1) with the msm package in R. hpv_state is 2 when infected, 1 when not infected, and 999 when ...
0
votes
0
answers
13
views
HMMs "difficulty" compared to a Markov model
Given an HMM, it is easy to compute the best approximating $n$-gram model over the observations. For example, for $N=1$, we have $p(w_i|w_{i-1}) = \sum_{s_i,s_{i-1}}p(w_i,s_i|w_{i-1},s_{i-1})=\sum_{...
0
votes
0
answers
19
views
Dynamic Bayesian Network with Temporal Hidden State
Can someone direct me to papers or Python packages which I can use to develop a dynamic bayesian network with temporal hidden states. I found packages that can handle discrete hidden states. But that'...
1
vote
0
answers
45
views
Time Series Prediction with Hidden Variables [closed]
I have time series data sampled every 10 seconds. I want to predict a target variable 𝑦 for 5 steps ahead using the input variable at the current time along with 10 past lags. My problem is that ...
0
votes
1
answer
22
views
Are correlated variables in hidden markov model tolerated?
I have two weakly correlated variables (r2=0.66). I want to include these in a hidden markov model (HMM) alongside other uncorrelated variables. I cannot find anything in the assumptions of HMM's ...
0
votes
0
answers
13
views
Forward-Backward Algorithm for Autoregressive HMMs
I am currently studying HMMs, and covered the Forward-Backward Algorithms as well as the smoothing and filtering process. Recently, we were posed a question on Autoregressive HMMs which I've been ...
1
vote
0
answers
31
views
Extended Hidden Markov Models (HMM) parameter estimation
For simpler HMMs, we can use algorithms like Viterbi training (not decoding) or Baum Welch to estimate the parameters that best describe the observed data.
How do we do the same when using a more ...
0
votes
0
answers
10
views
What is the effect of sampling rate on parameter estimation when fitting a markov state model to timeseries data?
Let us say that I have some timeseries data, which can be described by a markov state model. And the time series has been sampled every $\Delta t$ time units. The sampling rate ($1/\Delta t$) must ...
0
votes
0
answers
29
views
Do I use $P(y_t|y_{1:t-1})$ instead of $P(y_t|z_{t},y_{1:t-1})$ for prediction in a Hidden Markov Model?
I am confused what to sample for getting the prediction $y_{t}$ if I have access to the previous observations $y_{1:t-1}$ and the hidden states $z_{1:t}$.
I want to predict the observation at time $t$ ...
-1
votes
0
answers
33
views
Help with Gambler's ruin problem, can't solve abstraction [duplicate]
I'm having difficulty solving this exercise. When I assume that p=0.4 and player A's fortune is 99 dollars and B's fortune is 1 dollar, I can find that the probability of player A losing to player B ...
0
votes
0
answers
22
views
HMM probability of sequence of observations using forward and backward probabilities
I've come across this statement whilst reading about HMMs:
Given $\alpha_{n}(j) = P(Y_{0}^{n}, X_{n} = j)$ and $\beta_{n}(j) = P(Y_{n+1}^{N} | X_{n} = j)$, then
$$P(Y_{0}^{N}) = \sum_{j} \alpha_{n}(j)\...
0
votes
0
answers
16
views
Hidden Markov Model: Robustness and `Forbidden` Transitions
I have an issue while using a HMM to estimate the state of a system where the state-transition matrix is a block-diagonal matrix. Specifically I have an issue with robustness and the HMM keeps ...
0
votes
0
answers
31
views
Help interpreting normalized HMM (or otherwise) results
I have run a hidden markov model with five variables on very different scales. Because of this I normalized the input data beforehand using Carets preprocessing:
...
0
votes
0
answers
24
views
How to feed multi-channel spectrograms to Deep Neural Network?
I am using a 14 channel EEG device. To do away with the need for any handcrafted features, I wish to implement an ML classification task with the EEG data collected using deep neural networks (such as ...
0
votes
0
answers
75
views
Data scaling for hidden Markov models?
I understand that scaling data is important for certain machine learning algorithms, and the idea makes sense. I've found this great description of the processes here https://ourcodingclub.github.io/...
2
votes
0
answers
23
views
Mean and covariance kernel for the posterior GP of a Hidden Markov Model
In a hidden Markov model (HMM) we have a process $X_k$ that evolves according to:
$$ X_{k+1} = X_k + W_{k+1}, \quad W_{k+1} \sim N(0, \sigma_{W}^2), $$
where $\{W_k \}$ are IID and $X_0 = W_0$. We can ...
0
votes
0
answers
15
views
Parameter estimation for HMM with different emission distribution for different states
I am trying to solve a parameter estimation problem where a HMM have different emission distribution for different states (i.e. Gaussian for one state and exponential for the other). However most ...
0
votes
0
answers
50
views
Identifying states (or clusters) in multivariate mixed-type time series
I have multivariate time series with mixed data types, which includes continuous variables, binary variables, and variables with bimodal distributions. I need to identify distinct states or epochs in ...
0
votes
0
answers
37
views
Interpretation of covariates HMM depmixS4
I would like advice on correctly interpreting the covariates for a hidden markov model I have run, using Depmixs4. I'm really struggling to find any examples at all that actually interpret covariates.
...
0
votes
0
answers
26
views
Scaling forward variable in Inhomogeneous Hidden Markov Model
Background
Ordinary HMM
Consider an ordinary Hidden Markov Model $\lambda = (\pi, A, B)$ with $N$ hidden states $\{1, 2, ..., N\}$ and $M$ observation symbols $\{v_1, ... v_m\}$. Let's denote a state $...
0
votes
0
answers
53
views
Q function in Baum-Welch algorithm
Assume there's a hidden Markov Model $\lambda=(\pi, \mathbf{A}, \mathbf{B})$, where $\pi$ is an initial distribution, $\mathbf{A}$ is a transition matrix and $\mathbf{B}$ is an emission matrix. Also, ...
1
vote
0
answers
62
views
Improve HMM state estimation in latest data
I have a time-series dataset that is poisson-distributed, where each day I get a new additional datapoint. If I input all the data into a HMM (I am using code I found from hmmlearn in python) it does ...
0
votes
0
answers
47
views
Inferring Hidden States in Hidden Markov Models
To decode an HMM, the usual approach is use the Viterbi algorithm where the probability of the most likely sequence of hidden states $z_1,..,z_n$ generating the observations $y_1,..,y_n$ is given by:
\...
0
votes
0
answers
15
views
Inhomogeneous Hidden Markov Model
I've recently been working on Inhomogeneous Hidden Markov Model (IHMM) as defined in this article. In short, the whole idea distinguishing IHMM from typical HMM is that a transition matrix $A = \{a_{...
0
votes
0
answers
55
views
Calculate posterior distribution and full conditional of a HMM
Set up a Bayesian analysis of an hidden Markov model and calculate the posterior distribution and the full conditionals, given this assumptions:
The state space of the hidden process has size m
$Z_t|...
0
votes
0
answers
21
views
Time Duration Modelling for Hidden Markov Models
As we know, one of the major weakness of conventional HMMs is related to the modelling of
state duration, as the probability of state occupancy decreases exponentially with time. There are multiple ...
0
votes
1
answer
45
views
Block sampling hidden state using forward algorithm only
In a hidden Markov model, I can't get my mind around why I can't sample the full hidden state $\vec x$ using only a forward sampling algorithm.
Let $\vec y$ be the observed data and $\theta$ the model ...
0
votes
0
answers
83
views
LMest for cluster membership over time
I have a dataset of 18 continuous variables measured over 3 time points for 90 patients. I hypothesise that there are clusters of patients with similar characteristics and that cluster membership may ...
0
votes
0
answers
85
views
Efficient method to detect large probability shifts in HMM model output
I am using an HMM model, the specifics of which I cannot disclose. However, my objective is to detect significant transitions in the model's output probability distribution. This probability ...
1
vote
1
answer
28
views
Canonical references for HMMs with covariates
What is/are the canonical reference(s) for HMMs with covariates?
I'm coding some up and I'd like to follow the standard notations, if they exist.
0
votes
0
answers
64
views
EM algorithm "maximization step" for product of two independent Bernoulli variables
We are given the following model, where the event $C=1$ is defined using two other Bernoulli variables $E$ and $R$:
$$P(C=1|q,d,k)=P(E=1|k)\cdot P(R=1|q,d)$$
Which we denote as:
$$\theta_k=P(E=1|k), \...
1
vote
0
answers
73
views
HMM model training issue in implementation
I am attempting to train an HMM on a series of sequences but the resulting prediction of the hidden states returns no change over the time series.
My dataset is structured where the state begins in a ...
1
vote
0
answers
123
views
Inferring a random walk from noisy "images"
I'm interested in the following inference / filtering problem in a hidden Markov model setting. Suppose we have a simple random walk $x_t\in\mathbb{Z}$ and observations are "images" ...
1
vote
0
answers
102
views
inequality constraints in mixture models using conrows in depmixS4
I would like to fix the states identified by depmixS4 in a certain order to prevent label switching. This question was asked here (Fix state labels of HMM in depmixS4), and the answer given ...
1
vote
0
answers
35
views
Understanding stage 2 of the PYIN algorithm [closed]
I am reading the PYIN[1] research paper, and I am having difficulty understanding stage 2. I have looked at the Librosa[2] implementation, however, I would like to clarify my understanding.
From ...
0
votes
0
answers
46
views
Amortized complexity of viterbi algorithm for first-order HMM
The Viterbi algorithm is a dynamic programming algorithm for obtaining the maximum a posteriori probability estimate of the most likely sequence of hidden states—called the Viterbi path—that results ...
1
vote
0
answers
197
views
Trouble with understanding alpha and beta in HMM
I'm implementing HMM myself and I'm stuck with this concept.
Let T be the total time steps.
$\pi$ be the initial probabilities.
A be the transition matrix.
B be emission matrix.
$\alpha_{t,i}$ ...
1
vote
0
answers
81
views
How to use Forwards algorithm for HMM with Continuous Observation model $P(y|z_t=k)$
I have implemented a Forwards-Backwards algorithm for discrete latents HMM given the observed distribution matrix $B$.
Now if the observed distribution matrix is a Gaussian instead of finite ...
1
vote
0
answers
98
views
How to calculate the variance of importance sampling estimate
I am given the following Hidden Markov Model:
$X_{k+1} = \alpha X_{k} + b W_{k+1}$
$Y_{k} = cX_{k} + dV_{k}$
Also, $V_{k}$ and $W_{k}$ are independent and iid following $N(0, 1)$
I am required to ...
0
votes
1
answer
105
views
Can the observation function in a POMDP be a function of the previous state?
I would like to model my problem with a Partially Observable Markov Decision Process (POMDP) but I have as an observation the previous state $o_t = s_{t-1}$.
However, I see in all formal definitions ...
0
votes
0
answers
122
views
MLE for initial probability for Hidden Markov Model (supervised learning)
Suppose I have a sequence of observations $\mathbf{o} = (o_1, ..., o_T)$ and a corresponding sequence of states natomiast $\mathbf{q} = (q_1, ..., q_T)$, where $q_i \in \{1,2,...,N\}$
Let $\mathcal{L}(...
0
votes
0
answers
52
views
Latent state model - marginal likelihood
Which likelihood do I use to assess model-data-fit for latent space models like e.g. hidden markov models (HMM)?
Let $X$ be the data, $\theta$ the model parameters and $Z$ be the latent variables. My ...
1
vote
0
answers
241
views
help me understand a part of the baum welch algorithm for hidden markov models
I am having troubles understanding a crucial part of the baum-welch algorithm in hidden markov models.
When we calculate zhe/digamma representing the probability of being in state i at timestep t and ...
1
vote
1
answer
149
views
Could the likelihood increase monotonically in a misspecified EM algorithm?
I am dealing with the estimation of a Gaussian Hidden Markov Model with conditional distribution given the first-order Markov state $S_t = j,\ j=1,...,J$
$$
Y_t|S_t=j\sim N(0,\sigma^2_j)
$$
where the ...
1
vote
1
answer
483
views
Creating synthetic data for time series, Hidden Markov Model
Suppose that I have a task of classifying a time series. I decide to use Hidden Markov Model $\lambda(A, B, \pi)$, where $A$ is a transition matrix, $B$ is an emission probability, $\pi$ is an initial ...
3
votes
1
answer
77
views
Estimate the HMM parameters (2states), backward
I fitted a 2-states-HMM model last week, and generate a bunch of 1s and 0s, but I forgot to store its parameters (transition matrix). Now, I only got these 1s and 0s, how do I backward/reverse-...
9
votes
2
answers
581
views
Reframing a HMM problem as an RNN
Inspired by this question I have been considering how one would reframe a HMM problem as RNN problem.
For HMMs we have some observable timeseries $y(t)$ which corresponds to a set of hidden states $q(...
1
vote
1
answer
19
views
How to get the probability of number t element in HMM?
Suppose I have 3 hidden states. I want to get the probability of the last element belongs to state 2. How do I achieve this probability?
I have looked at the forward algorithm,
It doesn't seem like ...
1
vote
0
answers
69
views
Observed hidden variables in HMM
I am studying Hidden Markov Models and I'm trying to understand the following exercise:
Consider Hidden Markov Model with hidden states $h_{1:T} = \{h_1,...,h_T\}$ and observed states $v_{1:T}=\{v_1,.....
1
vote
1
answer
77
views
Independence in Graphical model of $p(h_{1:T}|v_{1:T})$ of an HMM
I am studying Hidden Markov Models and I'm trying to understand the following exercise:
Consider Hidden Markov Model with hidden states $h_{1:T} = \{h_1,...,h_T\}$ and observed states $v_{1:T}=\{v_1,.....