apollon.hmm.poisson.poisson_core module

poisson_core.py Core functionality for Poisson HMM.

apollon.hmm.poisson.poisson_core.log_poisson_fwbw(x, m, _lambda, _gamma, _delta)

Compute forward and backward probabilities for Poisson HMM.

Note: this alogorithm fails if _delta has zeros.

Params:
x (np.ndarray) One-dimensional array of integer values. theta (tuple) Initial guesses (lambda, gamma, delta). maxiter (int) Mmaximum number of EM iterations. tol (float) Convergence criterion.
apollon.hmm.poisson.poisson_core.poisson_EM(x, m, theta, maxiter=1000, tol=1e-06)

Estimate the parameters of an m-state PoissonHMM.

Params:
x (np.ndarray) One-dimensional array of integer values. theta (tuple) Initial guesses (lambda, gamma, delta). maxiter (int) Mmaximum number of EM iterations. tol (float) Convergence criterion.
apollon.hmm.poisson.poisson_core.poisson_viterbi(mod, x)

Calculate the Viterbi path (global decoding) of a PoissonHMM given some data x.

Params:
x (array-like) observations mod (HMM-Object)
Return:
(np.ndarray) Most probable sequence of hidden states given x.