apollon.hmm.poisson.poisson_hmm module

poisson_hmm.py – HMM with Poisson-distributed state dependent process. Copyright (C) 2018 Michael Blaß <michael.blass@uni-hamburg.de>

Functions:

to_txt Serializes model to text file. to_json JSON serialization.

is_tpm Check weter array is stochastic matrix. _check_poisson_intput Check wheter input is suitable for PoissonHMM.

Classes:
PoissonHMM HMM with univariat Poisson-distributed states.
class apollon.hmm.poisson.poisson_hmm.Params(lambda_, gamma_, delta_)

Bases: object

Easy access to estimated HMM parameters and quality measures.

class apollon.hmm.poisson.poisson_hmm.PoissonHmm(X: numpy.ndarray, m_states: int, init_lambda: Union[numpy.ndarray, str] = 'quantile', init_gamma: Union[numpy.ndarray, str] = 'uniform', init_delta: Union[numpy.ndarray, str] = 'stationary', g_dirichlet: Optional[Iterable[T_co]] = None, d_dirichlet: Optional[Iterable[T_co]] = None, fill_diag: float = 0.8, verbose: bool = True)

Bases: object

Hidden-Markov Model with univariate Poisson-distributed states.

decoding
fit(X: numpy.ndarray) → bool

Fit the initialized PoissonHMM to the input data set.

Parameters:X (np.ndarray) –
Returns:(int) True on success else False.
hyper_params
init_params
params
quality
score(X: numpy.ndarray)

Compute the log-likelihood of X under this HMM.

success
to_dict()

Returns HMM parameters as dict.

training_date
verbose
version
class apollon.hmm.poisson.poisson_hmm.QualityMeasures(aic, bic, nll, n_iter)

Bases: object

apollon.hmm.poisson.poisson_hmm.assert_poisson_input_data(X: numpy.ndarray)

Raise if X is not a array of integers.

Parameters:X (np.ndarray) –
Raises:ValueError