Learn R Programming

mvgam (version 1.1.4)

mvgam_diagnostics: Extract diagnostic quantities of mvgam models

Description

Extract quantities that can be used to diagnose sampling behavior of the algorithms applied by Stan at the back-end of mvgam.

Usage

# S3 method for mvgam
nuts_params(object, pars = NULL, ...)

# S3 method for mvgam log_posterior(object, ...)

# S3 method for mvgam rhat(x, pars = NULL, ...)

# S3 method for mvgam neff_ratio(object, pars = NULL, ...)

Value

The exact form of the output depends on the method.

Arguments

object, x

A mvgam or jsdgam object.

pars

An optional character vector of parameter names. For nuts_params these will be NUTS sampler parameter names rather than model parameters. If pars is omitted all parameters are included.

...

Arguments passed to individual methods.

Details

For more details see bayesplot-extractors.

Examples

Run this code
# \donttest{
simdat <- sim_mvgam(n_series = 1, trend_model = 'AR1')
mod <- mvgam(y ~ s(season, bs = 'cc', k = 6),
            trend_model = AR(),
            noncentred = TRUE,
            data = simdat$data_train,
            chains = 2)
np <- nuts_params(mod)
head(np)

# extract the number of divergence transitions
sum(subset(np, Parameter == "divergent__")$Value)

head(neff_ratio(mod))
# }

Run the code above in your browser using DataLab