explain.Specification: Create a user-friendly text describing the model.

Description Usage Arguments Value Examples

Description

The function creates a user-friendly text describing any of the three elements of the model. It includes the hidden states, variables, densities, bounds, priors, and fixed parameters. It also records environment details for easier reproducibility (package version, R version, time, OS).

Usage

1
2
3
## S3 method for class 'Specification'
explain(spec, observation = TRUE,
  initial = TRUE, transition = TRUE, print = TRUE)

Arguments

spec

An object returned by either specify or hmm.

observation

An optional logical indicating whether the observation model should be included in the description. It defaults to TRUE.

initial

An optional logical indicating whether the initial distribution model should be included in the description. It defaults to TRUE.

transition

An optional logical indicating whether the transition model should be included in the description. It defaults to TRUE.

print

An optional logical indicating whether the description should be printing out.

Value

A character string with the model description.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
mySpec <- hmm(
  K = 2, R = 1,
  observation = Gaussian(
    mu    = Gaussian(0, 10),
    sigma = Student(
      mu = 0, sigma = 10, nu = 1, bounds = list(0, NULL)
    )
  ),
  initial     = Dirichlet(alpha = c(1, 1)),
  transition  = Dirichlet(alpha = c(1, 1)),
  name = "Univariate Gaussian Hidden Markov Model"
)

explain(mySpec)

luisdamiano/BayesHMM documentation built on May 20, 2019, 2:59 p.m.