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).

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

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)
#> ________________________________________________________________________________ #> UNIVARIATE GAUSSIAN HIDDEN MARKOV MODEL #> ________________________________________________________________________________ #> #> Univariate observations (R = 1). #> Observation model for Variable 1 in State 1 #> Variable Density: Gaussian (-infty, infty) #> Free parameters: 2 (mu, sigma) #> mu : real mu11; #> Prior Density: Gaussian (-infty, infty) #> Fixed parameters: 2 (mu = 0, sigma = 10), #> sigma : real<lower = 0> sigma11; #> Prior Density: Student [0, infty) #> Fixed parameters: 3 (mu = 0, sigma = 10, nu = 1) #> #> Observation model for Variable 1 in State 2 #> Variable Density: Gaussian (-infty, infty) #> Free parameters: 2 (mu, sigma) #> mu : real mu21; #> Prior Density: Gaussian (-infty, infty) #> Fixed parameters: 2 (mu = 0, sigma = 10), #> sigma : real<lower = 0> sigma21; #> Prior Density: Student [0, infty) #> Fixed parameters: 3 (mu = 0, sigma = 10, nu = 1) #> #> #> Initial distribution model #> Prior Density: Dirichlet (-infty, infty) #> Fixed parameters: 1 (alpha = [1, 1]) #> #> Transition model #> Prior Density: Dirichlet (-infty, infty) #> Fixed parameters: 1 (alpha = [1, 1]) #> #>