Skip to contents

Time Series Cross-Validation

Functions and utilities for time series cross-validation

make_accuracy()
Estimate accuracy metrics to evaluate point forecast
make_errors()
Calculate forecast errors and percentage errors
make_future()
Convert the forecasts from a fable to a future_frame
make_split()
Create a split_frame for train and test splits per time series.
make_tsibble()
Convert tibble to tsibble
slice_train()
Slice the train data from the complete data
slice_test()
Slice the test data from the complete data

Data visualization

Functions and utilities for data visualization

plot_bar()
Plot data as bar chart
plot_density()
Plot the density via Kernel Density Estimator
plot_histogram()
Plot data as histogram
plot_line()
Plot data as line chart
plot_point()
Plot data as scatterplot
plot_qq()
Quantile-Quantile plot
theme_tscv()
Custom ggplot2 theme for tscv package
theme_tscv_dark()
Dark ggplot2 theme for tscv package
scale_color_tscv()
Color scale constructor for tscv colors.
scale_fill_tscv()
Fill scale constructor for tscv colors.
tscv_cols()
Function to extract tscv colors as hex codes.
tscv_pal()
Return function to interpolate a tscv color palette.

Forecasting

DSHW

The DSHW model and its supported methods

DSHW()
Automatic train a DSHW model
forecast(<DSHW>)
Forecast a trained DSHW model
fitted(<DSHW>)
Extract fitted values from a trained DSHW model
residuals(<DSHW>)
Extract residuals from a trained DSHW model
model_sum(<DSHW>)
Provide a succinct summary of a trained DSHW model
train_dshw()
Double Seasonal Holt-Winters model

ELM

The ELM model and its supported methods

ELM()
Extreme Learning Machine (ELM)
forecast(<ELM>)
Forecast a trained ELM model
fitted(<ELM>)
Extract fitted values from a trained ELM model
residuals(<ELM>)
Extract residuals from a trained ELM model
model_sum(<ELM>)
Provide a succinct summary of a trained ELM model
train_elm()
Extreme Learning Machine (ELM)

MLP

The MLP model and its supported methods

MLP()
Automatic training of MLPs
forecast(<MLP>)
Forecast a trained MLP model
fitted(<MLP>)
Extract fitted values from a trained MLP model
residuals(<MLP>)
Extract residuals from a trained MLP model
model_sum(<MLP>)
Provide a succinct summary of a trained MLP model
train_mlp()
Multilayer Perceptron (MLP)

SMEAN

The SMEAN model and its supported methods

SMEAN()
Seasonal mean model
forecast(<SMEAN>)
Forecast a trained seasonal mean model
fitted(<SMEAN>)
Extract fitted values from a trained seasonal mean model
residuals(<SMEAN>)
Extract residuals from a trained seasonal mean model
model_sum(<SMEAN>)
Provide a succinct summary of a trained seasonal mean model
train_smean()
Seasonal mean model

SMEDIAN

The SMEDIAN model and its supported methods

SMEDIAN()
Seasonal median model
forecast(<SMEDIAN>)
Forecast a trained seasonal median model
fitted(<SMEDIAN>)
Extract fitted values from a trained seasonal median model
residuals(<SMEDIAN>)
Extract residuals from a trained seasonal median model
model_sum(<SMEDIAN>)
Provide a succinct summary of a trained seasonal median model
train_smedian()
Seasonal median model

MEDIAN

The MEDIAN model and its supported methods

MEDIAN()
Median model
forecast(<MEDIAN>)
Forecast a trained median model
fitted(<MEDIAN>)
Extract fitted values from a trained median model
residuals(<MEDIAN>)
Extract residuals from a trained median model
model_sum(<MEDIAN>)
Provide a succinct summary of a trained median model
train_median()
Median model

SNAIVE2

The SNAIVE2 model and its supported methods

SNAIVE2()
Seasonal naive model
forecast(<SNAIVE2>)
Forecast a trained seasonal naive model
fitted(<SNAIVE2>)
Extract fitted values from a trained seasonal naive model
residuals(<SNAIVE2>)
Extract residuals from a trained seasonal naive model
model_sum(<SNAIVE2>)
Provide a succinct summary of a trained seasonal naive model
train_snaive2()
Seasonal naive model

TBATS

The TBATS model and its supported methods

TBATS()
Automatic train a TBATS model
forecast(<TBATS>)
Forecast a trained TBATS model
fitted(<TBATS>)
Extract fitted values from a trained TBATS model
residuals(<TBATS>)
Extract residuals from a trained TBATS model
model_sum(<TBATS>)
Provide a succinct summary of a trained TBATS model
train_tbats()
TBATS model

EXPERT

The EXPERT model and its supported methods

EXPERT()
Automatic train a EXPERT model
forecast(<EXPERT>)
Forecast a trained EXPERT model
fitted(<EXPERT>)
Extract fitted values from a trained EXPERT model
residuals(<EXPERT>)
Extract residuals from a trained EXPERT model
model_sum(<EXPERT>)
Provide a succinct summary of a trained EXPERT model
train_expert()
EXPERT model

Miscellaneous

Functions and utilities for data preparation, etc.

estimate_mode()
Estimate mode of a distribution based on Kernel Density Estimation
estimate_kurtosis()
Estimate kurtosis
estimate_skewness()
Estimate skewness
acf_vec()
Estimate the sample autocorrelation of a numeric vector
estimate_acf()
Estimate the sample autocorrelation
pacf_vec()
Estimate the sample partial autocorrelation of a numeric vector
estimate_pacf()
Estimate the sample partial autocorrelation
interpolate_missing()
Interpolate missing values
smooth_outlier()
Identify and replace outliers
lst_to_env()
Assign objects within a list to an environment
check_data()
Check, convert and shape the input data
summarise_data()
Summary statistics for time series data
summarise_stats()
Summary statistics for time series data
summarise_split()
Summary table of the splitting into training and testing
initialize_split()
Initialize a plan for train-test split
split_index()
Create indices for train and test splits.
expand_split()
Expand the split_frame
file_name()
Create a name for a folder or file
number_string()
Helper function to create numbered strings.
`%out%`
Negated value matching
glue_header()
Create a header from text
log_platform()
Create platform info
log_time()
Create string with elapsed time.

Data sets

Example data sets

elec_load
Hourly electricity load (actual values and forecasts)
elec_price
Hourly day-ahead electricity spot prices
M4_monthly_data
Monthly time series data from the M4 Competition
M4_quarterly_data
Quarterly time series data from the M4 Competition