Calculates the distribution function at each point for a dthmm
process given the complete observed process except the given point.
probhmm(logalpha, logbeta, Pi, delta, cumprob)
an \(n \times m\) matrix containing the logarithm of the forward probabilities.
an \(n \times m\) matrix containing the logarithm of the backward probabilities.
is the \(m \times m\) transition probability matrix of the hidden Markov chain.
is the marginal probability distribution of the \(m\) hidden states at the first time point.
an \(n \times m\) matrix where the \((i,k)\)th element is \(\Pr\{ X_i \le x_i \,|\, C_k = c_k\}\).
A vector containing the probability.
Let \(X^{(-i)}\) denote the entire process, except with the point \(X_i\) removed. The distribution function at the point \(X_i\) is $$ \Pr\{ X_i \le x_i \,|\, X^{(-i)} = x^{(-i)} \}\,. $$ This R function calculates the distribution function for each point \(X_i\) for \(i=1, \cdots, n\). This is done by using the forward and backward probabilities before and after the \(i\)th point, respectively.
In the programming code, note the subtraction of the mean. This is to stop underflow when the exponential is taken. Removal of the mean is automatically compensated for by the fact that the same factor is removed in both the numerator and denominator.