Overview

Describes the package

fabletools fabletools-package

fabletools: Core Tools for Packages in the 'fable' Framework

Data structures

Data classes for models, forecasts and decompositions.

mable()

Create a new mable

as_mable()

Coerce a dataset to a mable

is_mable()

Is the object a mable

fable()

Create a fable object

as_fable()

Coerce to a fable object

is_fable()

Is the object a fable

dable()

Create a dable object

as_dable()

Coerce to a dable object

is_dable()

Is the object a dable

mable_vars()

Return model column variables

response_vars()

Return response variables

distribution_var()

Return distribution variable

Models

Models which make use of models from other packages, or are useful for programming.

decomposition_model()

Decomposition modelling

combination_model()

Combination modelling

combination_ensemble()

Ensemble combination

combination_weighted()

Weighted combination

null_model() is_null_model()

NULL model

Forecast reconciliation

Use reconciliation techniques to ensure that forecasts are coherent with the hierarchical structure of data.

reconcile()

Forecast reconciliation

min_trace()

Minimum trace forecast reconciliation

bottom_up()

Bottom up forecast reconciliation

middle_out()

Middle out forecast reconciliation

top_down()

Top down forecast reconciliation

aggregate_key()

Expand a dataset to include other levels of aggregation

aggregate_index()

Expand a dataset to include temporal aggregates

agg_vec()

Create an aggregation vector

is_aggregated()

Is the element an aggregation of smaller data

Accuracy evaluation

Functionality for evaluating model performance

accuracy(<mdl_df>) accuracy(<mdl_ts>) accuracy(<fbl_ts>)

Evaluate accuracy of a forecast or model

ME() MSE() RMSE() MAE() MPE() MAPE() MASE() RMSSE() ACF1() point_accuracy_measures

Point estimate accuracy measures

MAAPE()

Mean Arctangent Absolute Percentage Error

winkler_score() pinball_loss() scaled_pinball_loss() interval_accuracy_measures

Interval estimate accuracy measures

percentile_score() quantile_score() CRPS() distribution_accuracy_measures

Distribution accuracy measures

MDA() MDV() MDPV() directional_accuracy_measures

Directional accuracy measures

skill_score()

Forecast skill score measure

Methods

The fabletools package facilitates the handling of key structures for these generics.

reexports %>% as_tsibble vars autoplot autolayer accuracy equation interpolate components augment glance tidy hypothesize generate refit forecast hilo

Objects exported from other packages

model()

Estimate models

report()

Report information about an object

stream()

Extend a fitted model with new data

outliers()

Identify outliers

model_sum()

Provide a succinct summary of a model

forecast(<mdl_df>) forecast(<mdl_ts>)

Produce forecasts

generate(<mdl_df>) generate(<mdl_ts>)

Generate responses from a mable

interpolate(<mdl_df>) interpolate(<mdl_ts>)

Interpolate missing values

refit(<mdl_df>) refit(<mdl_ts>)

Refit a mable to a new dataset

augment(<mdl_df>) augment(<mdl_ts>)

Augment a mable

glance(<mdl_df>) glance(<mdl_ts>)

Glance a mable

tidy(<mdl_df>) coef(<mdl_df>) tidy(<mdl_ts>) coef(<mdl_ts>)

Extract model coefficients from a mable

components(<mdl_df>) components(<mdl_ts>)

Extract components from a fitted model

fitted(<mdl_df>) fitted(<mdl_ts>)

Extract fitted values from models

residuals(<mdl_df>) residuals(<mdl_ts>)

Extract residuals values from models

estimate()

Estimate a model

response()

Extract the response variable from a model

scenarios()

A set of future scenarios for forecasting

IRF()

Compute Impulse Response Function (IRF)

hypothesize(<mdl_df>) hypothesize(<mdl_ts>)

Run a hypothesis test from a mable

is_model()

Is the object a model

Features

Functions for using and defining features across a dataset.

features() features_at() features_all() features_if()

Extract features from a dataset

feature_set()

Create a feature set from tags

register_feature()

Register a feature function

Transformations

Commonly used transformation functions.

box_cox() inv_box_cox()

Box Cox Transformation

new_transformation() invert_transformation()

Create a new modelling transformation

Graphics

Some autoplot() and autolayer() methods are defined for classes commonly used within fabletools.

autoplot(<tbl_ts>) autolayer(<tbl_ts>)

Plot time series from a tsibble

autoplot(<fbl_ts>) autolayer(<fbl_ts>)

Plot a set of forecasts

autoplot(<dcmp_ts>)

Decomposition plots

Extension package helpers

Functions provided to help develop extension packages.

special_xreg()

Helper special for producing a model matrix of exogenous regressors

new_specials()

Create evaluation environment for specials

new_model_class() new_model_definition()

Create a new class of models

model_lhs()

Extract the left hand side of a model

model_rhs()

Extract the right hand side of a model

common_periods() get_frequencies()

Extract frequencies for common seasonal periods

common_xregs

Common exogenous regressors