This function sets and checks model parameters. Unspecified parameters are sampled.
Usage
fHMM_parameters(
controls = list(),
hierarchy = FALSE,
states = if (!hierarchy) 2 else c(2, 2),
sdds = if (!hierarchy) "normal" else c("normal", "normal"),
Gamma = NULL,
mu = NULL,
sigma = NULL,
df = NULL,
Gamma_star = NULL,
mu_star = NULL,
sigma_star = NULL,
df_star = NULL,
scale_par = c(1, 1),
seed = NULL,
check_controls = TRUE
)
# S3 method for class 'fHMM_parameters'
print(x, ...)Arguments
- controls
[
list()|fHMM_controls]
Either alistor an object of classfHMM_controls.The
listcan contain the following elements, which are described in more detail below:hierarchy, defines a hierarchical HMM,states, defines the number of states,sdds, defines the state-dependent distributions,horizon, defines the time horizon,period, defines a flexible, periodic fine-scale time horizon,data, alistof controls that define the data,fit, alistof controls that define the model fitting
Either none, all, or selected elements can be specified.
Unspecified parameters are set to their default values.
Important: Specifications in
controlsalways override individual specifications.- hierarchy
[
logical(1)]
Alogical, set toTRUEfor a hierarchical HMM.If
hierarchy = TRUE, some of the other controls must be specified for the coarse-scale and the fine-scale layer.By default,
hierarchy = FALSE.- states
[
integer(1)|integer(2)]
Aninteger, the number of states of the underlying Markov chain.If
hierarchy = TRUE,statesmust be avectorof length 2. The first entry corresponds to the coarse-scale layer, while the second entry corresponds to the fine-scale layer.By default,
states = 2ifhierarchy = FALSEandstates = c(2, 2)ifhierarchy = TRUE.- sdds
[
character(1)|character(2)]
Acharacter, specifying the state-dependent distribution. One of"normal"(the normal distribution),"lognormal"(the log-normal distribution),"t"(the t-distribution),"gamma"(the gamma distribution),"poisson"(the Poisson distribution).
The distribution parameters, i.e. the
mean
mu,standard deviation
sigma(not for the Poisson distribution),degrees of freedom
df(only for the t-distribution),
can be fixed via, e.g.,
"t(df = 1)"or"gamma(mu = 0, sigma = 1)". To fix different values of a parameter for different states, separate by "|", e.g."poisson(mu = 1|2|3)".If
hierarchy = TRUE,sddsmust be avectorof length 2. The first entry corresponds to the coarse-scale layer, while the second entry corresponds to the fine-scale layer.By default,
sdds = "normal"ifhierarchy = FALSEandsdds = c("normal", "normal")ifhierarchy = TRUE.- Gamma, Gamma_star
[
NULL|matrix()|list()]
A transition probabilitymatrix.It should have dimension
states[1].Gamma_staris alistof fine-scale transition probability matrices. Thelistmust be of lengthstates[1]. Each transition probability matrix must be of dimensionstates[2].- mu, mu_star
[
NULL|numeric()|list()]
Anumericvector of expected values for the state-dependent distribution in the different states.For the gamma- or Poisson-distribution,
mumust be positive.It should have length
states[1].mu_staris alistofvectorswith fine-scale expectations. Thelistmust be of lengthstates[1]. Eachvectormust be of lengthstates[2].- sigma, sigma_star
[
NULL|numeric()|list()]
A positivenumericvector of standard deviations for the state-dependent distribution in the different states.It should have length
states[1].sigma_staris alistofvectorswith fine-scale standard deviations. Thelistmust be of lengthstates[1]. Each vector must be of lengthstates[2].- df, df_star
[
NULL|numeric()|list()]
A positivenumericvector of degrees of freedom for the state-dependent distribution in the different states.It should have length
states[1].Only relevant in case of a state-dependent t-distribution.
df_staris alistofvectorswith fine-scale degrees of freedom. Thelistmust be of lengthstates[1]. Each vector must be of lengthstates[2]. Only relevant in case of a fine-scale state-dependent t-distribution.- scale_par
[
numeric(2)]
A positivenumericvector of length two, containing scales for sampled expectations and standard deviations.The first entry is the scale for
muandsigma, the second entry is the scale formu_starandsigma_star(if any).- seed
[
NULL|integer(1)]
Sets a seed for the sampling of parameters.- check_controls
[
logical(1)]
EitherTRUEto check the defined controls orFALSEto not check them (which saves computation time), else.- x
[
fHMM_parameters]
An object of classfHMM_parameters.- ...
Currently not used.
Details
See the package vignettes at https://loelschlaeger.de/fHMM/articles/ for details.
