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-10-18 03:45:39 UTC |
Source: | https://github.com/neerajdhanraj/forecasttb |
Function to append new methods in the study
append_(object, Method, MethodName, ePara, ePara_name)
append_(object, Method, MethodName, ePara, ePara_name)
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 |
Returns error comparison for additional forecasting methods
## 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)
## 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
choose_(object)
choose_(object)
object |
as output of 'prediction_errors()' function |
Returns error comparison for selected forecasting methods
## Not run: a <- prediction_errors(data = nottem) choose_(object = a) ## End(Not run)
## Not run: a <- prediction_errors(data = nottem) choose_(object = a) ## End(Not run)
Function to use Monte Carlo strategy
monte_carlo(object, size, iteration, fval = 0, figs = 0)
monte_carlo(object, size, iteration, fval = 0, figs = 0)
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) |
Error values with provided models in each iteration along with the mean values
## 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)
## 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
plot_circle(x, ...)
plot_circle(x, ...)
x |
as output object of 'prediction_errors()' function |
... |
arguments passed to or from other methods |
Returns error comparison plots for forecasting methods
a <- prediction_errors(data = nottem) plot_circle(a)
a <- prediction_errors(data = nottem) plot_circle(a)
Function to plot comparison of Prediction methods
## S3 method for class 'prediction_errors' plot(x, ...)
## S3 method for class 'prediction_errors' plot(x, ...)
x |
as output object of 'prediction_errors()' function |
... |
arguments passed to or from other methods |
Returns error comparison plots for forecasting methods
a <- prediction_errors(data = nottem) b <- plot(a)
a <- prediction_errors(data = nottem) b <- plot(a)
Function working as testbench for comparison of Prediction methods
prediction_errors( data, nval, ePara, ePara_name, Method, MethodName, strats, dval, append_ )
prediction_errors( data, nval, ePara, ePara_name, Method, MethodName, strats, dval, append_ )
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 |
Returns error comparison for forecasting methods
prediction_errors(data = nottem)
prediction_errors(data = nottem)