Skip to contents

Lists every s() and t2() term of every predictor. The predictors are each response's mean, each distributional or non-linear parameter with a formula and the trend. posterior_smooths.mvgam() and conditional_smooths.mvgam() take these labels.

Usage

# S3 method for class 'mvgam'
smooths(x)

smooths(x)

Arguments

x

A fitted mvgam object.

Value

A character vector of term labels, one per term of each predictor, in the order of the panels of conditional_smooths.mvgam(). Empty for a fit without smooths.

Author

Nicholas J Clark

Examples

# \dontrun{
set.seed(13)
simdat <- sim_mvgam(family = poisson(), n_series = 1L,
                    n_timepoints = 120L, trend_model = AR())
mod <- mvgam(y ~ s(x, k = 5) + s(time, k = 6),
             trend_formula = ~ AR(p = 1),
             data = simdat$data_train, family = poisson(),
             chains = 2, silent = 2)
#> Warning: 61 of 2000 (3.0%) transitions ended with a divergence.
#> See https://mc-stan.org/misc/warnings for details.

# The labels posterior_smooths() takes
smooths(mod)
#> [1] "s(x, k = 5)"    "s(time, k = 6)"

# Next, posterior_smooths(mod, smooth = "s(x, k = 5)") draws one of
# them
# }