comb_forec: Combinate the forecasts and prediction intervals by assigned...

Description Usage Arguments Details Value

View source: R/comb_forec.R

Description

The combinated forecasts and prediction intervals are calculated by weights given by weightprob. Besides, the methods used for model averaging are filtered by threshold ratios for yearly, quarterly and monthly series.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
comb_forec(
  dataset,
  weightprob,
  Threshold,
  level,
  combine = "mean",
  methodname = "comb",
  show.methods = FALSE,
  parallel = FALSE,
  num.cores = 2
)

Arguments

dataset

a list of time series. See details for the required format.

weightprob

a matrix with n (number of time series) rows and F (number of benchmark methods) matrix. The matrix is applied to assign weights to each benchmark method for each time series.

Threshold

a vector with 3 threshold ratios that are used for selecting appropriate methods for yearly, quarterly and monthly series, respectively.

level

the confidence level of prediction intervals that are used for combination.

combine

string representing the interval combination methods. "mean", "weightedmean" or "median".

methodname

string. the name used to name the combined forecasting results.

show.methods

logical. If TRUE, then each element of the returned dataset will be appended to a vector. This vector contains the names of methods that are selected for model averaging.

parallel

logical. If TRUE then the calculations are conducted in parallel.

num.cores

the specified amount of parallel processes to be used if parallel = TRUE.

Details

dataset must be a list with each element having the following format:

n

the number of observations in the time series.

h

the number of required forecasts.

period

interval of the time series. Possible values are "YEARLY", "QUARTERLY", "MONTHLY" & "OTHER".

x

a time series of length n (the historical data).

xx

a time series of length h (the future data).

ff

a matrix with F rows and h columns. Each row contains the forecasts of each method in methods.

lower

a list with each element being the matrix of lower bounds for certain confidence level.

upper

a list with each element being the matrix of upper bounds for certain confidence level.

Value

A list with the elements having the following structure

ff

a matrix with F+1 rows and h columns where the first F rows represent the point forecasts of benchmark methods and the last row represents the point forecasts by model averaging.

lower

a list with one element that contains a matrix. The matrix with F+1 rows and h columns where the first F rows represent the lower bounds of benchmark methods and the last row represents the lower bounds by model averaging.

upper

a list with one element that contains a matrix. The matrix with F+1 rows and h columns where the first F rows represent the upper bounds of benchmark methods and the last row represents the upper bounds by model averaging.


xqnwang/fuma documentation built on May 29, 2021, 6:38 a.m.