initHMM: Random Initialization for a Hidden Markov Model with...

Description Usage Arguments Value References Examples

Description

Function used to generate a hidden Markov model with categorical variables and random parameters. The code for the methods with continuous values or discrete data can be viewed in "initGHMM" and "initPHMM", respectively.

Usage

1
initHMM(n, m)

Arguments

n

the number of hidden states to use.

m

the number of possible categories (labels) generated by the hidden states.

Value

A "list" that contains the required values to specify the model.

Model

it specifies that the observed values are to be modeled as a multinomial distribution.

StateNames

the set of hidden state names.

ObservationNames

the set of possible observed values.

A

the transition probabilities matrix.

B

the emission probabilities matrix.

Pi

the initial probability vector.

References

Cited references are listed on the RcppHMM manual page.

Examples

1
2
3
4
n <- 2
m <- 2
model <- initHMM(n,m)
print(model)

Example output

Attaching package: 'RcppHMM'

The following object is masked from 'package:stats':

    setNames

$Model
[1] "HMM"

$StateNames
[1] "x1" "x2"

$ObservationNames
[1] "y1" "y2"

$A
          [,1]      [,2]
[1,] 0.4533246 0.5466754
[2,] 0.8037148 0.1962852

$B
          [,1]      [,2]
[1,] 0.1510980 0.8489020
[2,] 0.4375402 0.5624598

$Pi
[1] 0.8153173 0.1846827

RcppHMM documentation built on May 2, 2019, 8:56 a.m.