Learn R Programming

RIPSeeker (version 1.12.0)

nbh_chk: Check the parameters of the negative binomial HMM

Description

The function verifies the numerical range and dimension of the NBH paramters alpha, beta, and TRANS and returns the number of hidden states. It is used in nbh_em before running EM.

Usage

nbh_chk(TRANS, alpha, beta)

Arguments

TRANS
Expected a squared matrix of probabilities ($0 \le p \le 1$) with row and column length equal to that of alpha and beta and row sum and column sum both equal to 1 (within some numerical deviation of 1e-6).
alpha
Expected a vector of positive values with length equal to that of beta and the row/column of TRANS.
beta
Expected a vector of positive values with length equal to that of alpha and the row/column of TRANS.

Value

  • NNumber of components or equivalently the length of alpha, beta, or wght.

References

Bishop, Christopher. Pattern recognition and machine learning. Number 605-631 in Information Science and Statisitcs. Springer Science, 2006.

Capp'e, O. (2001). H2M : A set of MATLAB/OCTAVE functions for the EM estimation of mixtures and hidden Markov models. (http://perso.telecom-paristech.fr/cappe/h2m/)

See Also

nbh_em, nbm_chk

Examples

Run this code
# two hidden states
TRANS <- matrix(c(0.9, 0.1, 0.3, 0.7), nrow=2, byrow=TRUE)

alpha <- c(2, 4)

beta  <- c(1, 0.25)

nbh_chk(TRANS, alpha, beta)

Run the code above in your browser using DataLab