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)

Copy Link

Version

Install

install.packages('TSstudio')

Monthly Downloads

3,381

Version

0.1.2

License

GPL-3

Maintainer

Rami Krispin

Last Published

September 21st, 2018

Functions in TSstudio (0.1.2)

Michigan_CS

University of Michigan Consumer Survey, Index of Consumer Sentiment
USUnRate

US Monthly Civilian Unemployment Rate
ts_pacf

A Visualization Function of the PACF Estimation
ts_polar

Polor Plot for Time Series Object
ts_plot

Plotting Time Series Objects
res_hist

Histogram Plot of the Residuals Values
ts_info

Get the Time Series Information
zoo_to_ts

Converting 'zoo' object to 'ts' object
ts_heatmap

Heatmap Plot for Time Series
plot_forecast

Plotting Forecast Object
ts_lags

Time Series Lag Visualization
USgas

US monthly natural gas consumption
ts_surface

3D Surface Plot for Time Series
xts_to_ts

Converting 'xts' object to 'ts' object
check_res

Visualization of the Residuals of a Time Series Model
ts_ma

Moving Average Method for Time Series Data
ts_reshape

Transform Time Series Object to Data Frame Format
ts_quantile

Quantile Plot for Time Series
ts_decompose

Visualization of the Decompose of a Time Series Object
ts_seasonal

Seasonality Visualization of Time Series Object
ts_split

Split Time Series Object for Training and Testing Partitions
ts_sum

Summation of Multiple Time Series Object
Coffee_Prices

Coffee Prices: Robusta and Arabica
US_indicators

US Key Indicators - data frame format
USVSales

US Monthly Total Vehicle Sales
EURO_Brent

Crude Oil Prices: Brent - Europe
ts_backtesting

Evaluation Function for Forecasting Models
test_forecast

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

A Visualization Function of the ACF Estimation