mvgam-class {mvgam} | R Documentation |
Fitted mvgam
object description
Description
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 formula -
trend_call
If atrend_formula was supplied
, the original trend model formula is returned. OtherwiseNULL
-
family
character
description of the observation distribution -
trend_model
character
description of the latent trend model -
trend_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 model -
priors
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
syntax -
model_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 parameter -
mgcv_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 details -
trend_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 functions -
resids
A namedlist
object containing posterior draws of Dunn-Smyth randomized quantile residuals -
use_lv
Logical flag indicating whether latent dynamic factors were used in the model -
n_lv
Ifuse_lv == TRUE
, the number of latent dynamic factors used in the model -
upper_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
Author(s)
Nicholas J Clark