augment.mvgam {mvgam}R Documentation

Augment an mvgam object's data

Description

Add fits and residuals to the data, implementing the generic augment from the package broom.

Usage

## S3 method for class 'mvgam'
augment(x, robust = FALSE, probs = c(0.025, 0.975), ...)

Arguments

x

An object of class mvgam.

robust

If FALSE (the default) the mean is used as the measure of central tendency and the standard deviation as the measure of variability. If TRUE, the median and the median absolute deviation (MAD) are applied instead.

probs

The percentiles to be computed by the quantile function.

...

Unused, included for generic consistency only.

Details

A list is returned if class(x$obs_data) == 'list', otherwise a tibble is returned, but the contents of either object is the same.

The arguments robust and probs are applied to both the fit and residuals calls (see fitted.mvgam() and residuals.mvgam() for details).

Value

A list or tibble (see details) combining:

See Also

residuals.mvgam, fitted.mvgam

Examples


set.seed(0)
dat <- sim_mvgam(T = 80,
                 n_series = 3,
                 mu = 2,
                 trend_model = AR(p = 1),
                 prop_missing = 0.1,
                 prop_trend = 0.6)

mod1 <- mvgam(formula = y ~ s(season, bs = 'cc', k = 6),
              data = dat$data_train,
              trend_model = AR(),
              family = poisson(),
              noncentred = TRUE,
              chains = 2,
              silent = 2)

augment(mod1, robust = TRUE, probs = c(0.25, 0.75))



[Package mvgam version 1.1.51 Index]