fc_jags_mv: Fit a Bayesian forecast model to a multivariate set of...

Description Usage Arguments Details Value

View source: R/fc_jags_mv.R

Description

This function takes fitted values from a log-transformed forecast models and uses those as predictors in a Negative Binomial regression to model the discrete outcome time series. Multivariate covariance dependencies are incorporated via multivariate normal intercepts

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
fc_jags_mv(
  y,
  model = "arima",
  horizon,
  frequency,
  use_nb = TRUE,
  n.chains = 2,
  n.adapt = 1000,
  n.burnin = 10000,
  n.iter = 10000,
  thin = 10,
  auto_update = TRUE
)

Arguments

y

xts matrix. The discrete outcome series to be modelled. NAs are allowed

model

character either 'TBATS', 'arima' or 'stlf'

horizon

integer. The horizon to forecast. Defaults to frequency

frequency

integer. The seasonal frequency in y

use_nb

logical If TRUR, use a Negative Binomial likelihood with estimated overdispersion parameter r;

n.chains

integer the number of parallel chains for the model

n.adapt

integer the number of iterations for adaptation. See adapt for details. If n.adapt = 0 then no adaptation takes place

n.iter

integer the number of iterations of the Markov chain to run

auto_update

logical If TRUE, the model is run for up to 3 additional sets of n.iter iterations, or until the lower 15th percentile of effective sample sizes reaches 200

Details

The discrete series are first log-transformed and interpolated to fit univariate forecast models. Fitted values from the forecast models are then used as predictors in a Negative Binomial Bayesian regression to model the raw discrete series, while inter-series dependencies are captured using a multivariate normal intercept

Value

A list containing the posterior forecast from the forecast model and the original fitted jags.model


nicholasjclark/mvforecast documentation built on Dec. 22, 2021, 2:11 a.m.