apaMarkov.PathProbability.Unconditional(StatePath, InitialStateDistribution, TransProbs)
=apaMarkov.PathProbability.Unconditional(StatePath, InitialStateDistribution, TransProbs)Result
Calculates the unconditional probability of an observed state path.
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
InitialStateDistribution: 1 x k or k x 1 vector of first-state probabilities, non-negative and summing to one
TransProbs: matrix of transition probabilities, each row summing to one
Algorithm
Inputs are validated: TransProbs is square, every element of StatePath is an integer between 1 and k, and InitialStateDistribution has k non-negative elements whose sum differs from one by at most 1e-6.
Take the probability of the first state from the initial state distribution and multiply by the transition probabilities along the path:
Return the unconditional path probability.
