nbm_chk {RIPSeeker} | R Documentation

## Check the parameters of the negative binomial mixture model

### Description

The function verifies the numerical range and dimension of the NBM paramters alpha, beta, and wght and returns the number of components. It is used in `nbm_em` before running EM.

### Usage

    nbm_chk(alpha, beta, wght)

### Arguments

`alpha` | Expected a vector of positive values with length equal to that of beta and wght.
`beta` | Expected a vector of positive values with length equal to that of alpha and wght.
`wght` | Expected a vector of probabilities (0 ≤ p ≤ 1) with length equal to that of alpha and beta and summed to 1 (within some numerical deviation of 1e-6).

### Value

`N` | Number of components or equivalently the length of alpha, beta, or wght.

### Author(s)

Yue Li

### References

Christopher Bishop. 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

`nbm_em, nbh_chk`

### Examples

    # two mixing components
    wght <- c(0.5,0.5)

    alpha <- c(1, 20)

    beta <- c(1, 1)

    nbm_chk(alpha, beta, wght)

[Package RIPSeeker version 1.22.0 Index]