Giter VIP home page Giter VIP logo

tspred's Introduction

codecov cran version downloads Research software impact

TSPred Package for R : Framework for Nonstationary Time Series Prediction

Current Version: 5.1 Date: 2021-01

Authors: Rebecca Pontes Salles ([email protected]) and Eduardo Ogasawara ([email protected])

Description: Functions for defining and conducting a time series prediction process including pre(post)processing, decomposition, modeling, prediction, and accuracy assessment. The generated models and their yielded prediction errors can be used for benchmarking other time series prediction methods and for creating a demand for the refinement of such methods. For this purpose, benchmark data from prediction competitions may be used.

Available at CRAN: https://CRAN.R-project.org/package=TSPred

Reference manual: TSPred.pdf

Acknowledgements: The authors thank CNPq, CAPES, and FAPERJ for partially sponsoring this research.


Usage:

#Install TSPred package
> install.packages("TSPred")

#Load TSPred package
> library("TSPred")

ARIMA model prediction application using TSPred

#loading CATS dataset
 > data("CATS")

#defining the time series application
 > tspred_arima <- tspred( subsetting = subsetting(test_len = 20),
                           modeling = ARIMA(), 
                           evaluating = list(MSE = MSE(),AIC = AIC()) )

#performing the prediction application and obtaining results
 > tspred_arima_res <- workflow( tspred_arima, data = CATS[5] )

Definition of components/steps of a time series prediction process in TSPred

#Obtaining objects of the processing class
 > proc_subset <- subsetting( test_len = 20 )
 > proc_bct <- BCT()
 > proc_wt <- WT( level = 1, filter = "bl14" )
 > proc_sw <- SW( window_len = 6 )
 > proc_mm <- MinMax()

#Obtaining objects of the modeling class
 > modl_nnet <- NNET( size = 5, sw = proc_sw, proc = list(MM = proc_mm) )

#Obtaining objects of the evaluating class
 > eval_mse <- MSE()

MLM prediction application using TSPred

#Defining a time series prediction process
 > tspred_mlm <- tspred( subsetting = proc_subset, 
                         processing = list(BCT = proc_bct, WT = proc_wt), 
                         modeling = modl_nnet,
                         evaluating = list(MSE = eval_mse) )

#Running the time series prediction process and obtaining results
 > tspred_mlm_res <- tspred_mlm %>% 
                     subset(data = CATS[5]) %>%
                     preprocess(prep_test = TRUE) %>% 
                     train() %>%
                     predict(input_test_data = TRUE) %>% 
                     postprocess() %>% 
                     evaluate()

#Benchmarking tspred objects
 > bmrk_results <- benchmark( tspred_arima_res, list(tspred_mlm_res) )

A user-defined MLM using TSPred

#Subclass my.model
 > my.model <- function(train_par=NULL, pred_par=NULL){
      MLM(train_func = my.model.func, train_par = c(train_par),
          pred_func = my.model.pred.func, pred_par = c(pred_par),
          method = "Name of my model", subclass = "my.model" )
 }

#Obtaining an instance of the subclass my.model
 > model <- my.model(train_par = list(par1="a", par2="b"), pred_par = list(par3="c"))

Other relevant functions:

Nonstationarity treatment:

  • LogT - Logarithmic transform.
  • BCT - Box-Cox transform.
  • an - Adaptive normalization.
  • Diff - Differencing. MAS
  • mas - Moving average smoothing.
  • pct - Percentage change transform.
  • WaveletT - Wavelet transform.
  • emd - Empirical mode decomposition.

Fittest linear models:

  • fittestLM - Automatically finding fittest linear model for prediction.
  • fittestArima - Automatic ARIMA fitting, prediction and accuracy evaluation.
  • fittestArimaKF - Automatic ARIMA fitting and prediction with Kalman filter.
  • fittestPolyR - Automatic fitting and prediction of polynomial regression.
  • fittestPolyRKF - Automatic fitting and prediction of polynomial regression with Kalman filter.

Automatic preprocessing/decomposition and prediction:

  • fittestMAS - Automatic prediction with moving average smoothing.
  • fittestWavelet - Automatic prediction with wavelet transform.
  • fittestEMD - Automatic prediction with empirical mode decomposition.

tspred's People

Contributors

rebeccasalles avatar eogasawara avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.