ewnet {epicasting}R Documentation

Ewnet: An Ensemble Wavelet Neural Network for Forecasting and Epicasting

Description

Ewnet: An Ensemble Wavelet Neural Network for Forecasting and Epicasting

Usage

ewnet(
  ts,
  Waveletlevels = floor(log(length(ts))),
  MaxARParam,
  boundary = "periodic",
  FastFlag = TRUE,
  NForecast,
  NVal = 0,
  measure = Metrics::mase,
  PI = FALSE,
  xreg_train = NULL,
  xreg_test = NULL,
  ret_fit = FALSE
)

Arguments

ts

A numeric vector or time series

Waveletlevels

An integer specifying the levels of decomposition. The default is set to floor(log(length(ts))).

MaxARParam

An integer indicating the maximum lagged observations to be included in the neural network. The default is selected based on AIC using linear AR process.

boundary

A character string indicating which boundary method to use. boundary = "periodic" (default) and boundary = "reflection".

FastFlag

A logical flag which, if true (default), indicates that the pyramid algorithm is computed with an internal C function. Otherwise, only R code is used in all computations.

NForecast

An integer specifying the forecast horizon.

NVal

An integer indicating the size of validation set. Default is set to 0.

measure

The performance metric used for selecting the best value of MaxARParam based on validation set. Defaults to Metrics::mase.

PI

A logical flag which, if true generates the confidence interval for the forecast horizon. Default is set to false.

xreg_train

Optionally, a vector or matrix of external regressors, which must have the same number of rows as ts. Must be numeric.

xreg_test

Optionally, a vector or matrix of external regressors, which must have the same number of rows as NForecast to be used for the forecast. Must be numeric.

ret_fit

A logical flag specifying that the fitted values of the model on the training set should be returned if true, otherwise, false (default).

Value

The parameters of the fitted model indicating the number of lagged observations included in the model and the number of nodes in the hidden layer. The forecast of the time series of size NForecast is generated along with the optional output of fitted values (ret_fit = TRUE) and confidence interval (PI = TRUE) for the forecast.

Author(s)

Madhurima Panja and Tanujit Chakraborty

References

Examples

ewnet(ts = datasets::lynx, MaxARParam = 1, NForecast = 3)

[Package epicasting version 0.1.0 Index]