Home   >   User Resources   >   Online Help   >   apaMarkov.Hidden.MVT.Estimate
 

 

Function index Version 3.0.0

apaMarkov.Hidden.MVT.Estimate(DataMatrix, numStates, nMultiStarts, Seed)

Excel=apaMarkov.Hidden.MVT.Estimate(DataMatrix, numStates, nMultiStarts, Seed)

Result

Estimates a hidden Markov model with multivariate Student t emissions and state-specific degrees of freedom, and returns the parameters and the state probabilities. The function is non-volatile.

Syntax

DataMatrix: r x c matrix of data, each column containing a series

numStates: number of states to impose

nMultiStarts: optional; number of multi-starts. Default value: 1 (also used if omitted or below 1)

Seed: optional; seed of the random number generator. Default value: 1 (also used if omitted or 0)

Algorithm

Inputs are validated: non-empty DataMatrix, numStates ≥ 1.

The parameters are estimated with an expectation conditional maximization (ECM) algorithm. The E-step computes the smoothed state probabilities γ(t,k) with a scaled forward-backward recursion and, for each state, the latent precision weights u(t,k) = (ν(k) + p) / (ν(k) + δ(t,k)), where δ(t,k) is the Mahalanobis distance of observation t and p the number of series. The means and covariances are the γ·u-weighted averages. The degrees of freedom of state k solve −ψ(ν/2) + ln(ν/2) + 1 + Σ γ(t,k) (E[ln u(t,k)] − u(t,k)) / Σ γ(t,k) = 0, with ψ the digamma function, and are bounded to the interval [2.01, 500]. Transition and initial probabilities are updated from the smoothed transition and state probabilities. The iterations stop when the change of the log-likelihood falls below 1E-7. With numStates = 1 the same iterations start from the sample means and covariance matrix, giving the maximum likelihood fit of a single multivariate Student t distribution with estimated degrees of freedom.

Remarks

Covariances are maximum-likelihood (EM) estimates: probability-weighted, population-type, no small-sample correction.