A fitted mvgam
object returned by function mvgam
.
Run methods(class = "mvgam")
to see an overview of available methods.
Details
A mvgam
object contains the following elements:
call
the original observation model formulatrend_call
If atrend_formula was supplied
, the original trend model formula is returned. OtherwiseNULL
family
character
description of the observation distributiontrend_model
character
description of the latent trend modeltrend_map
data.frame
describing the mapping of trend states to observations, if supplied in the original model. OtherwiseNULL
drift
Logical specifying whether a drift term was used in the trend modelpriors
If the model priors were updated from their defaults, the priordataframe
will be returned. OtherwiseNULL
model_output
TheMCMC
object returned by the fitting engine. If the model was fitted usingStan
, this will be an object of classstanfit
(seestanfit-class
for details). IfJAGS
was used as the backend, this will be an object of classrunjags
(seerunjags-class
for details)model_file
Thecharacter
string model file used to describe the model in eitherStan
orJAGS
syntaxmodel_data
Ifreturn_model_data
was set toTRUE
when fitting the model, thelist
object containing all data objects needed to condition the model is returned. Each item in thelist
is described in detail at the top of themodel_file
. OtherwiseNULL
inits
Ifreturn_model_data
was set toTRUE
when fitting the model, the initial value functions used to initialise the MCMC chains will be returned. OtherwiseNULL
monitor_pars
The parameters that were monitored during MCMC sampling are returned as acharacter vector
sp_names
Acharacter vector
specifying the names for each smoothing parametermgcv_model
An object of classgam
containing themgcv
version of the observation model. This object is used for generating the linear predictor matrix when making predictions for new data. The coefficients in this model object will contain the posterior median coefficients from the GAM linear predictor, but these are only used if generating plots of smooth functions thatmvgam
currently cannot handle (such as plots for three-dimensional smooths). This model therefore should not be used for inference. SeegamObject
for detailstrend_mgcv_model
If atrend_formula was supplied
, an object of classgam
containing themgcv
version of the trend model. OtherwiseNULL
ytimes
Thematrix
object used in model fitting for indexing which series and timepoints were observed in each row of the supplied data. Used internally by some downstream plotting and prediction functionsresids
A namedlist
object containing posterior draws of Dunn-Smyth randomized quantile residualsuse_lv
Logical flag indicating whether latent dynamic factors were used in the modeln_lv
Ifuse_lv == TRUE
, the number of latent dynamic factors used in the modelupper_bounds
If bounds were supplied in the original model fit, they will be returned. OtherwiseNULL
obs_data
The original data object (either alist
ordataframe
) supplied in model fitting.test_data
If test data were supplied (as argumentnewdata
in the original model), it will be returned. OthweriseNULL
fit_engine
Character
describing the fit engine, either asstan
orjags
backend
Character
describing the backend used for modelling, either asrstan
,cmdstanr
orrjags
algorithm
Character
describing the algorithm used for finding the posterior, either assampling
,laplace
,pathfinder
,meanfield
orfullrank
max_treedepth
If the model was fitted usingStan
, the value supplied for the maximum treedepth tuning parameter is returned (seestan
for details). OtherwiseNULL
adapt_delta
If the model was fitted usingStan
, the value supplied for the adapt_delta tuning parameter is returned (seestan
for details). OtherwiseNULL