2/5/2019

Agenda

  • Introduction

  • Key functions

  • Demo

  • Work on Progress

Any experince with time series analysis?

  • forecast package?
  • plotly package?

Introduction

The TSstudio package provides a set of functions for time series analysis and forecasting such as:

  • Utility functions for pre-processing time series data
  • Interactive data visualization tools for descriptive analysis, based on the plotly package engine
  • Set of functions for predictive analysis and forecasting automation with the use of models from the forecast, forecastHybrid, and bsts packages

The primary goal of the package is to simplify the analysis workflow (or, minimum code - maximum results)

Installation

Install from CRAN:

install.packages("TSstudio")

Or from Github:

devtools::install_github("RamiKrispin/TSstudio")

Package structure

Key functions

  • Data visualization tools
  • Seasonal analysis
  • Correlation analysis
  • Forecasting applications

Demo

Work on progress - version 0.1.4

Forecast simulation

library(forecast)
library(TSstudio)
data(USgas)
md <- auto.arima(USgas)

fc_sim <- forecast_sim(md, h = 60, n = 200)

Work on progress - version 0.1.4

Forecast simulation

fc_sim$plot

Work on progress - version 0.1.4

HoltWinters tuning parameters with grid search

hw_grid_shallow <- ts_grid(ts.obj = USgas,
                            periods = 6,
                            model = "HoltWinters",
                            optim = "MAPE",
                            window_space = 6,
                            window_test = 12,
                            hyper_params = list(alpha = seq(0.01, 1,0.1),
                                                beta =  seq(0.01, 1,0.1),
                                                gamma = seq(0.01, 1,0.1)),
                            parallel = TRUE,
                            n.cores = 8)

Work on progress - version 0.1.4

HoltWinters tuning parameters with grid search

plot_grid(hw_grid_shallow, type = "parcoords")

Work on progress - version 0.1.4

HoltWinters tuning parameters with grid search

plot_grid(hw_grid_shallow, type = "3D", top = 200)

Work on progress - version 0.1.4

Backtesting with both expending and sliding windows and parallel option

fc <- ts_test(ts.obj = USgas,
             window_type = "expending",
             h = 60,
             window_space = 6,
             window_test = 12,
             parallel = TRUE,
             n_cores = 8,
             top = 6)

Work on progress - version 0.1.4

Backtesting with both expending and sliding windows and parallel option

plot_backtesting(fc,by = "MAPE", type = "all", palette = "viridis", top = NULL)

Questions?

Thank you!