Home   >   User Resources   >   Online Help   >   apaMarkov.PathProbability.Conditional
 

 

Function index Version 3.0.0

apaMarkov.PathProbability.Conditional(StatePath, TransProbs)

Excel=apaMarkov.PathProbability.Conditional(StatePath, TransProbs)

Result

Calculates the probability of an observed state path, given a transition probability matrix and conditional on the first state.

Syntax

StatePath: n x 1 or 1 x n vector of integer state labels from 1 to k, where k is the number of rows of TransProbs

TransProbs: matrix of transition probabilities, each row summing to one

Algorithm

Inputs are validated: TransProbs is square and every element of StatePath is an integer between 1 and k. A path with a single observation has conditional probability 1.

Treat the first state in StatePath as given. The conditional probability of the path is the product of all one-step transition probabilities along the path:

P(s2,…,sn∣s1)=∏t=2npst−1,st.P(s_{2},\ldots,s_{n} \mid s_{1}) = \prod_{t = 2}^{n}p_{s_{t - 1},s_{t}}. Return the conditional path probability.