choose.threshold: Search the optimal threshold ratio used for model averaging

Description Usage Arguments Details Value

View source: R/choose.threshold.R

Description

According to the fitted values of the pre-trained algorithm, the optimal threshold ratio used for model averaging is searched from a set of pre-set threshold ratios.

Usage

1
2
3
4
5
6
7
8
9
choose.threshold(
  dataset,
  fitProb,
  ratio,
  combine = "mean",
  level,
  parallel = FALSE,
  num.cores = 2
)

Arguments

dataset

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

fitProb

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.

ratio

a vector with pre-set threshold ratios. The threshold ratio quantifies as a number between 0 and 1, where 0 indicates all the benchmark methods are selected and 1 indicates only the benchmark method with the minimal value of scores is selected.

combine

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

level

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

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 following elements

threshold_y

numeric, the optimal threshold ratio searched for yearly data.

threshold_q

numeric, the optimal threshold ratio searched for quarterly data.

threshold_m

numeric, the optimal threshold ratio searched for monthly data.

msis_y

a matrix of MSIS values for each pre-set threshold ratio to yearly data.

msis_q

a matrix of MSIS values for each pre-set threshold ratio to quarterly data.

msis_m

a matrix of MSIS values for each pre-set threshold ratio to monthly data.


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