Learn R Programming

⚠️There's a newer version (0.1.7) of this package.Take me there.

TSstudio

The TSstudio package provides a set of functions for time series analysis. That includes interactive data visualization tools based on the plotly package engine, supporting multiple time series objects such as ts, xts, and zoo. In addition, the package provides a set of utility functions for preprocessing time series data, and as well backtesting applications for forecasting models from the forecast, forecastHybrid and bsts packages.

Installation

Install the stable version from CRAN:

install.packages("TSstudio")

or install the development version from Github:

# install.packages("devtools")
devtools::install_github("RamiKrispin/TSstudio")

Usage

library(TSstudio)
data(USgas)

# Ploting time series object
ts_plot(USgas)

# Seasonal plot
ts_seasonal(USgas, type = "all")

# Lags plot
ts_lags(USgas, lags = 1:12)

# Seasonal lags plot
ts_lags(USgas, lags = c(12, 24, 36, 48))

# Heatmap plot
ts_heatmap(USgas)

# Forecasting applications
# Setting training and testing partitions
USgas_s <- ts_split(ts.obj = USgas, sample.out = 12)
train <- USgas_s$train
test <- USgas_s$test

# Forecasting with auto.arima
library(forecast)
md <- auto.arima(train)
fc <- forecast(md, h = 12)

# Plotting actual vs. fitted and forecasted
test_forecast(actual = USgas, forecast.obj = fc, test = test)

# Plotting the forecast 
plot_forecast(fc)

# Forecasting with backtesting 
USgas_backtesting <- ts_backtesting(USgas, 
                                    models = "abehntw", 
                                    periods = 6, 
                                    error = "RMSE", 
                                    window_size = 12, 
                                    h = 12)

hw_grid <- ts_grid(USgas, 
                   model = "HoltWinters",
                   periods = 6,
                   window_space = 6,
                   window_test = 12,
                   hyper_params = list(alpha = seq(0,1,0.1),
                                       beta = seq(0,1,0.1),
                                       gamma = seq(0,1,0.1)))
                                       
plot_grid(hw_grid, type = "3D")

Copy Link

Version

Install

install.packages('TSstudio')

Monthly Downloads

3,676

Version

0.1.4

License

GPL-3

Maintainer

Rami Krispin

Last Published

April 13th, 2019

Functions in TSstudio (0.1.4)

ts_sum

Summation of Multiple Time Series Objects
plot_forecast

Plotting Forecast Object
USUnRate

US Monthly Civilian Unemployment Rate
xts_to_ts

Converting 'xts' object to 'ts' object
zoo_to_ts

Converting 'zoo' object to 'ts' object
res_hist

Histogram Plot of the Residuals Values
ts_polar

Polor Plot for Time Series Object
check_res

Visualization of the Residuals of a Time Series Model
test_forecast

Visualize of the Fitted and the Forecasted vs the Actual Values
ts_reshape

Transform Time Series Object to Data Frame Format
ts_seasonal

Seasonality Visualization of Time Series Object
ts_surface

3D Surface Plot for Time Series
ts_quantile

Quantile Plot for Time Series
ts_to_prophet

Transform Time Series Object to Prophet input
forecast_sim

Forecasting simulation
ts_acf

A Visualization Function of the ACF Estimation
plot_grid

Visualizing Grid Search Results
ts_backtesting

Evaluation Function for Forecasting Models
ccf_plot

Time Series Cross Correlation Lags Visualization
USgas

US monthly natural gas consumption
ts_decompose

Visualization of the Decompose of a Time Series Object
ts_pacf

A Visualization Function of the PACF Estimation
ts_plot

Plotting Time Series Objects
ts_grid

Tuning Time Series Forecasting Models Parameters with Grid Search
ts_lags

Time Series Lag Visualization
ts_ma

Moving Average Method for Time Series Data
Michigan_CS

University of Michigan Consumer Survey, Index of Consumer Sentiment
USVSales

US Monthly Total Vehicle Sales
Coffee_Prices

Coffee Prices: Robusta and Arabica
US_indicators

US Key Indicators - data frame format
EURO_Brent

Crude Oil Prices: Brent - Europe
ts_heatmap

Heatmap Plot for Time Series
ts_info

Get the Time Series Information
ts_split

Split Time Series Object for Training and Testing Partitions