These functions take a fitted mvgam or jsdgam object and
return various useful summaries
# S3 method for mvgam
summary(object, include_betas = TRUE, smooth_test = TRUE, digits = 2, ...)# S3 method for mvgam_prefit
summary(object, ...)
# S3 method for mvgam
coef(object, summarise = TRUE, ...)
For summary.mvgam, an object of class mvgam_summary containing:
model_spec: Model specification details (formulas, family, dimensions)
parameters: Parameter estimates and significance tests
diagnostics: MCMC convergence diagnostics
sampling_info: Sampling algorithm details
For summary.mvgam_prefit, a list is printed on-screen showing
the model specifications
For coef.mvgam, either a matrix of posterior coefficient
distributions (if summarise == FALSE or data.frame of
coefficient summaries)
list object returned from mvgam
Logical. Print a summary that includes posterior
summaries of all linear predictor beta coefficients (including spline
coefficients)? Defaults to TRUE but use FALSE for a more
concise summary
Logical. Compute estimated degrees of freedom and
approximate p-values for smooth terms? Defaults to TRUE, but users
may wish to set to FALSE for complex models with many smooth or
random effect terms
The number of significant digits for printing out the summary;
defaults to 2.
Ignored
logical. Summaries of coefficients will be returned
if TRUE. Otherwise the full posterior distribution will be returned
Nicholas J Clark
summary.mvgam and summary.mvgam_prefit return brief summaries of
the model's call, along with posterior intervals for some of the key
parameters in the model. Note that some smooths have extra penalties on the
null space, so summaries for the rho parameters may include more
penalty terms than the number of smooths in the original model formula.
Approximate p-values for smooth terms are also returned, with methods used
for their calculation following those used for mgcv equivalents (see
summary.gam for details). The Estimated Degrees of
Freedom (edf) for smooth terms is computed using either edf.type = 1 for
models with no trend component, or edf.type = 0 for models with trend
components. These are described in the documentation for
jagam. Experiments suggest these p-values tend to be
more conservative than those that might be returned from an equivalent model
fit with summary.gam using method = 'REML'
coef.mvgam returns either summaries or full posterior estimates for GAM
component coefficients
if (FALSE) {
simdat <- sim_mvgam(seasonality = "hierarchical")
mod <- mvgam(
y ~ series +
s(season, bs = "cc", k = 6) +
s(season, series, bs = "fs", k = 4),
data = simdat$data_train,
chains = 2,
silent = 2
)
mod_summary <- summary(mod)
mod_summary
}
Run the code above in your browser using DataLab