Package 'ForecastTB'

Title: Test Bench for the Comparison of Forecast Methods
Description: Provides a test bench for the comparison of forecasting methods in uni-variate time series. Forecasting methods are compared using different error metrics. Proposed forecasting methods and alternative error metrics can be used. Detailed discussion is provided in the vignette.
Authors: Neeraj Dhanraj Bokde [aut, cre] , Gorm Bruun Andersen [aut]
Maintainer: Neeraj Dhanraj Bokde <[email protected]>
License: CC0
Version: 1.0.1
Built: 2024-11-17 03:55:07 UTC
Source: https://github.com/neerajdhanraj/forecasttb

Help Index


Function to append new methods in the study

Description

Function to append new methods in the study

Usage

append_(object, Method, MethodName, ePara, ePara_name)

Arguments

object

as output of 'prediction_errors()' function

Method

as the list of locations of function for the proposed prediction method

MethodName

as list of names for function for the proposed prediction method in order

ePara

as type of error calculation (RMSE and MAE are default), add an error parameter of your choice in the following manner: ePara = c("errorparametername") where errorparametername is should be a source/function which returns desired error set

ePara_name

as list of names of error parameters passed in order

Value

Returns error comparison for additional forecasting methods

Examples

## Not run: 
library(forecast)
test3 <- function(data, nval){return(as.numeric(forecast(ets(data), h = nval)$mean))}
a <- prediction_errors(data = nottem)
b <- append_(object = a, Method = c("test3(data,nval)"), MethodName = c('ETS'))
choose_(object = a)

## End(Not run)

Function to select the desired methods in the study

Description

Function to select the desired methods in the study

Usage

choose_(object)

Arguments

object

as output of 'prediction_errors()' function

Value

Returns error comparison for selected forecasting methods

Examples

## Not run: 
a <- prediction_errors(data = nottem)
choose_(object = a)

## End(Not run)

Function to use Monte Carlo strategy

Description

Function to use Monte Carlo strategy

Usage

monte_carlo(object, size, iteration, fval = 0, figs = 0)

Arguments

object

as output of 'prediction_errors()' function

size

as volume of time series used in Monte Carlo strategy

iteration

as number of iterations models to be applied

fval

as a flag to view forecasted values in each iteration (default: 0, don't view values)

figs

as a flag to view plots for each iteration (default: 0, don't view plots)

Value

Error values with provided models in each iteration along with the mean values

Examples

## Not run: 
library(forecast)
test3 <- function(data, nval){return(as.numeric(forecast(ets(data), h = nval)$mean))}
a <- prediction_errors(data = nottem,
    Method = c("test3(data, nval)"),
    MethodName = c("ETS"), append_ = 1)
monte_carlo(object = a1, size = 144, iteration = 10)

## End(Not run)

Function to plot comparison of Predicted values in a circular ring

Description

Function to plot comparison of Predicted values in a circular ring

Usage

plot_circle(x, ...)

Arguments

x

as output object of 'prediction_errors()' function

...

arguments passed to or from other methods

Value

Returns error comparison plots for forecasting methods

Examples

a <- prediction_errors(data = nottem)
plot_circle(a)

Function to plot comparison of Prediction methods

Description

Function to plot comparison of Prediction methods

Usage

## S3 method for class 'prediction_errors'
plot(x, ...)

Arguments

x

as output object of 'prediction_errors()' function

...

arguments passed to or from other methods

Value

Returns error comparison plots for forecasting methods

Examples

a <- prediction_errors(data = nottem)
b <- plot(a)

Function working as testbench for comparison of Prediction methods

Description

Function working as testbench for comparison of Prediction methods

Usage

prediction_errors(
  data,
  nval,
  ePara,
  ePara_name,
  Method,
  MethodName,
  strats,
  dval,
  append_
)

Arguments

data

as input time series for testing

nval

as an integer to decide number of values to predict

ePara

as type of error calculation (RMSE and MAE are default), add an error parameter of your choice in the following manner: ePara = c("errorparametername") where errorparametername is should be a source/function which returns desired error set

ePara_name

as list of names of error parameters passed in order

Method

as the list of locations of function for the proposed prediction method (should be recursive) (default:arima)

MethodName

as list of names for function for the proposed prediction method in order

strats

as list of forecasting strategies. Available : recursive and dirrec

dval

as last d values of the data to be used for forecasting

append_

suggests if the function is used to append to another instance

Value

Returns error comparison for forecasting methods

Examples

prediction_errors(data = nottem)