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
Either a
listor an object of classfHMM_controls.The
listcan contain the following elements, which are described in more detail below:hierarchy, defines an 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
A
logical, set toTRUEfor an 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
An
integer, 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
A
character, 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
A transition probability
matrix.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
A
numericvector 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
A positive
numericvector 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
A positive
numericvector 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
A positive
numericvector 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
Sets a seed for the sampling of parameters.
- check_controls
Either
TRUEto check the defined controls orFALSEto not check them (which saves computation time), else.- x
An object of class
fHMM_parameters.- ...
Currently not used.
Details
See the vignette on the model definition for more details.
