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
list
or an object of classfHMM_controls
.The
list
can 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
, alist
of controls that define the data,fit
, alist
of 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
controls
always override individual specifications.- hierarchy
A
logical
, set toTRUE
for 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
,states
must be avector
of length 2. The first entry corresponds to the coarse-scale layer, while the second entry corresponds to the fine-scale layer.By default,
states = 2
ifhierarchy = FALSE
andstates = 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
,sdds
must be avector
of 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 = FALSE
andsdds = c("normal", "normal")
ifhierarchy = TRUE
.- Gamma, Gamma_star
A transition probability
matrix
.It should have dimension
states[1]
.Gamma_star
is alist
of fine-scale transition probability matrices. Thelist
must be of lengthstates[1]
. Each transition probability matrix must be of dimensionstates[2]
.- mu, mu_star
A
numeric
vector of expected values for the state-dependent distribution in the different states.For the gamma- or Poisson-distribution,
mu
must be positive.It should have length
states[1]
.mu_star
is alist
ofvectors
with fine-scale expectations. Thelist
must be of lengthstates[1]
. Eachvector
must be of lengthstates[2]
.- sigma, sigma_star
A positive
numeric
vector of standard deviations for the state-dependent distribution in the different states.It should have length
states[1]
.sigma_star
is alist
ofvectors
with fine-scale standard deviations. Thelist
must be of lengthstates[1]
. Each vector must be of lengthstates[2]
.- df, df_star
A positive
numeric
vector 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_star
is alist
ofvectors
with fine-scale degrees of freedom. Thelist
must 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
numeric
vector of length two, containing scales for sampled expectations and standard deviations.The first entry is the scale for
mu
andsigma
, the second entry is the scale formu_star
andsigma_star
(if any).- seed
Sets a seed for the sampling of parameters.
- check_controls
Either
TRUE
to check the defined controls orFALSE
to 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.