fc_jags_uni: Fit a Bayesian forecast model to a univariate discrete time...

Description Usage Arguments Details Value

View source: R/fc_jags_uni.R

Description

This function takes fitted values from a log-transformed forecast model and uses those as a predictor in a Negative Binomial regression to predict the discrete outcome time series

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
fc_jags_uni(
  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 vector. 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 is first log-transformed and interpolated to fit a forecast model. Fitted values from the forecast model are then used as a predictor in a Negative Binomial Bayesian regression to model the raw discrete series

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.