nbh_gen {RIPSeeker} | R Documentation

## Simulate data from a negative binomial HMM.

### Description

Generate count data and the hidden states based on the user-supplied HMM paramters.

### Usage

    nbh_gen(TRANS, alpha, beta, Total)

### Arguments

`TRANS` | Expected a squared matrix of probabilities (0 ≤ p ≤ 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.
`Total` | Total number of data points to generate.

### Value

A list containing:

`count` | Simulation count data.
`label` | Hidden states associated with the simulated data.

### Author(s)

Yue Li

### References

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, randindx`

### Examples

    # Simulate data using user-supplied transition prob, alpha and beta for the NB HMM parameters
    TRANS_s <- matrix(c(0.9, 0.1, 0.3, 0.7), nrow=2, byrow=TRUE)
    alpha_s <- c(2, 4)
    beta_s  <- c(1, 0.25)
    Total <- 100
    x <- nbh_gen(TRANS_s, alpha_s, beta_s, Total)

[Package RIPSeeker version 1.24.0 Index]