hindcast.mvgam {mvgam} | R Documentation |
Extract hindcasts for a fitted mvgam
object
Description
Extract hindcasts for a fitted mvgam
object
Usage
hindcast(object, ...)
## S3 method for class 'mvgam'
hindcast(object, type = "response", ...)
Arguments
object |
|
... |
Ignored |
type |
When this has the value |
Details
Posterior retrodictions are drawn from the fitted mvgam
and
organized into a convenient format
Value
An object of class mvgam_forecast
containing hindcast distributions.
See mvgam_forecast-class
for details.
See Also
Examples
simdat <- sim_mvgam(n_series = 3, trend_model = AR())
mod <- mvgam(y ~ s(season, bs = 'cc'),
trend_model = AR(),
noncentred = TRUE,
data = simdat$data_train,
chains = 2)
# Hindcasts on response scale
hc <- hindcast(mod)
str(hc)
plot(hc, series = 1)
plot(hc, series = 2)
plot(hc, series = 3)
# Hindcasts as expectations
hc <- hindcast(mod, type = 'expected')
str(hc)
plot(hc, series = 1)
plot(hc, series = 2)
plot(hc, series = 3)
# Estimated latent trends
hc <- hindcast(mod, type = 'trend')
str(hc)
plot(hc, series = 1)
plot(hc, series = 2)
plot(hc, series = 3)