cbind() (e.g.
mutate(fit, joint = cbind(ets, arima))) into a model group (the new
mdl_df class): a data frame of model columns for the same series, which
can be stacked with rbind(). Model groups are printed compactly within a
mable (<ets+arima>), and forecast() and generate() label their models
as joint$ets and joint$arima. This is scaffolding for modifiers applied
jointly across a series' models (e.g. joint bootstrapping). Other mable
verbs don't support model groups yet.bootstrap_iid(), bootstrap_block(), and simulate_iid(), which
wrap a fitted model (via mutate()) so that forecast()/generate()
produce forecasts from bootstrapped or simulated sample paths instead of
closed-form/analytical results (#434). This replaces forecast()'s
simulate=/bootstrap=/times= arguments and generate()'s bootstrap=/
bootstrap_block_size= arguments, which are now deprecated in favour of
wrapping the model directly, e.g.
fit %>% mutate(ets = bootstrap_iid(ets)) %>% forecast(). These modifiers
compose with reconcile()/min_trace() (and each other, across model
columns) since they only add an extra class to the wrapped model. When
applied to a mdl_lst column spanning multiple series, bootstrap_iid()/
bootstrap_block() sample jointly across the series (the same historical
time point is drawn for every series at a given replicate/step), so their
historical cross-sectional relationship carries over into the simulated
forecasts; if the series don't share the same historical time domain,
sampling is restricted to the overlapping period and a warning is raised.
They can also be applied directly to a model specification inside
model(), e.g. model(ets = bootstrap_iid(ETS(value))), in which case
each series is fitted and wrapped independently (not jointly).conformal_scp() for producing forecast distributions using split
conformal prediction, e.g. fit %>% mutate(ets = conformal_scp(ets)).reconcile_mint(), reconcile_bu(), reconcile_td(), and
reconcile_mo() as short aliases for min_trace(), bottom_up(),
top_down(), and middle_out() respectively, bringing reconciliation
into the same <family>_<variant> naming used by bootstrap_*()/
simulate_*(). The original names remain the canonical, documented
functions.coverage() interval accuracy measure for the proportion of actual
values within the prediction interval (#368).interval() is a mixtime
time unit (or a list of them) and the index can be a mixtime vector.
common_periods() and get_frequencies() work with these intervals, so
seasonal models, season(), fourier(), lag("year"), accuracy() and
features() work again. Older tsibble versions are still supported.get_frequencies() now accepts mixtime durations, so seasonal periods and
forecast horizons can be given as e.g. forecast(h = mixtime::years(2L))
or season(period = mixtime::weeks(1L)).trend(), season() and fourier() now count steps of the interval for
mixtime indices using the index's own time units, rather than
default_time_units(), which measures sub-daily intervals in seconds.forecast(), fitted(), augment() and accuracy(),
are empty with the same structure as for a mable with models (except for
components(), which depends on the models). The response variable(s) of a mable are
now retained when it is modified rather than recomputed from its models,
which also allows mables with missing (NULL) models to be combined (#234).
as_mable() gains a response argument for constructing mables without any
models.box_cox(resp(value), lambda), now work with fitted(), residuals(),
refit(), stream() and min_trace() reconciliation. The parameters are
stored with the model's data, alongside the response. forecast(),
generate(), refit() and stream() give an informative error if the
parameter isn't in new_data (#382).trend() for irregular time series is now proportional to elapsed time in
the units of the time index, instead of NaN.trend() now converts knots and origin to the class of the time index,
and errors if they're incompatible. Previously other classes (e.g. a Date
origin for a yearmonth index, or text knots) silently gave wrong trends.common_periods() giving incorrect frequencies for sub-daily
intervals made of several units (e.g. 1 hour 30 minutes).select(), transmute(), rename() and relocate() dropping the
fable class or distribution column (#324, #348, #403).[[<- not registering model columns in a mable (#402, #323).min_trace() positive definite check not being scale invariant (#358).min_trace() (#309).top_down() and middle_out() reconciliation collapsing sample path
forecasts (e.g. from simulate_iid()) to degenerate distributions (#408).generate() erroring for mables with model columns of different
classes, such as models using different reconciliation methods (#408).future::plan() is set
without attaching future (#363, #420)..model or .rep columns in
forecast() and generate() (#275).generate()'s seed argument not restoring R's global RNG state
afterwards (it was overwriting its own snapshot of the prior state with the
seed itself before restoring it, so the ambient RNG stream was left
altered, and a stale .Random.seed value triggered spurious "not an
integer vector" warnings on the next seeded call). generate(seed = ) is
now deprecated in favour of calling set.seed() before generate().future::plan(multisession) that reference global variables (#412).stream() failing for every model with an "argument is of length
zero" error, caused by stream.mdl_ts() not setting the model definition's
stage before evaluating specials on the new data (unlike forecast(),
generate(), interpolate() and refit(), which all set a stage).lag() (used in specials such as xreg()) returning NA for the
first observation(s) of a stream() call, by having it recognise the new
"stream" stage as a source of short-term memory (#446).lag()-based regressors (and other specials relying on short-term
memory via self$recent_data) resolving incorrectly whenever a model
definition is reused for more than one call, including repeated
(chained) stream() calls, forecast() or generate() following a
stream()/refit(), and (most commonly) model()/forecast() across
multiple series or multiple training windows (e.g. from
stretch_tsibble()), since every series shares the same model definition
object (#318, #326). The short-term memory is now snapshotted onto each
fitted model individually, rather than only ever living on the shared,
mutable model definition.forecast() and generate() no longer require new_data for regressors
that are only used through lag(), e.g. ARIMA(y ~ lag(x, 3)) can now be
forecast with h = 3. Missing regressors are treated as NA, so forecasts
beyond the lag use the short-term memory and are NA after that (#318).origin argument of the fourier() special, which had no
effect. Fourier terms are anchored to the time index's epoch, consistent
with season().reconcile() is soft-deprecated in favour of mutate() with the
reconcile_*() functions (e.g. mutate(lm = reconcile_mint(lm))).forecast(), generate(), accuracy(),
report(), augment(), glance(), tidy(), and others) now dispatch on
mbl_df rather than mdl_df, completing the class rename announced in
0.8.0. mdl_df is kept as a trailing class on mable objects for this
release so old inherits(x, "mdl_df") checks in downstream code keep
working, but packages defining their own methods for mables (rather than
relying on is_mable()) need to dispatch on mbl_df to keep working once
mdl_df is dropped in the next minor release. mdl_df itself remains
reserved for an upcoming joint-model group class.fbl_ts class for fable data frames will be renamed to fbl_df (a
fable data frame), for consistency with the mable (mbl_df) class. Fables
now have the fbl_df class before fbl_ts, and all of the fable's S3
methods now dispatch on fbl_df. The fbl_ts class is kept for this
release so old inherits(x, "fbl_ts") checks continue working, but it is
recommended to use is_fable() instead.mdl_defn class for model specifications is renamed to mdl_spec.
The mdl_defn class is kept for this release, and will be removed in the
next minor release.sum(), mean(), and weighted.mean() S3 methods for mdl_ts and
mdl_lst objects, providing explicit N-way model combination with equal,
uniform, or custom weights respectively.+, -, *, /) now produce a single
model_combination object with correctly implied weights. Arbitrary nested
expressions such as ((m1 + m2)/2 + m3)/2 automatically flatten into a
single joint combination.combination_ensemble() now computes inverse-variance weights using
response residuals (type = "response") rather than innovation residuals.
This is particularly important for models where the innovation residual
variance is not comparable to the variance on the response scale, e.g. for
multiplicative ETS models (#320).(A + B + C)/3 as ((A + B) + C)/3) which used
pairwise covariances that yield different results for different orders of
models (#321).accuracy() with global models.with_bottom argument to coherent_smat() for inclusion of identity
matrix entries for bottom level time series. Setting this to FALSE produces
the A matrix (aggregated series only)."bottom" attribute for coherent_smat() for safely identifying the
index positions of bottom level series via graph coherency structures.mdl_df class for mable data frames will be renamed to mbl_df (a
mable data frame). This is to avoid a naming inconsistency with the mdl_ts
and mdl_lst (for local and global models respectively), and free the class
name for an eventual mdl_df multi-model class. The mbl_df class has been
added, and mdl_df will be removed in the next minor release (v0.9.0).bias_adjust() has been deprecated.
The forecast mean has been correctly calculated (including 'bias adjustments')
in the mean() function of distributional objects for a long time. The
forecast median can be obtained using median() on a forecast distribution.coherent_smat() and coherent_cmat() for obtaining the structural and
zero-constraint matrices that encode the coherency structure of related time
series (#429).mdl_lst class to the previously named lst_mdl class
for consistency with other model list classes mdl_df and mdl_ts (#433).mdl_lst methods for augment(), glance(), and tidy() to enable global models (including reconciliation models) to
provide statistics for these methods (#424).hfitted() used on models without refit() method (#432).Small patch to progress deprecation of graphics functionality that required updating reverse dependencies to require fabletools >=0.6.0.
autoplot() and autolayer() methods for graphics functions now require the fabletools to be attached (not just loaded). If you previously used library() to load fabletools (or fable, fpp3), your code will continue to work. We do however recommend that you also include library(ggtime) (or fpp3) for time-series graphics going forward.This release migrates graphics functionality to {ggtime}. The commonly used graphics functions are currently exported with a soft deprecation message. To use the autoplot() and autolayer() time series plot helper functions please include library(ggtime) in your code.
After a (very) gradual deprecation process, the {ggtime} dependency will be removed and the graphics functions will stop being re-exported. This deprecation process is planned to span approximately 2 years, after which explicitly using {ggtime} will be required.
Compatibility release for upcoming ggplot2 4.0.0 release.
accuracy(<fbl_ts>) when not all key variables were
specified in by (#421).IRF() generic and appropriate mable methods for computing
impulse response functions from fitted models.generate() bootstrap sample paths for
multivariate models.progressr::with_progress()autoplot() and length 1 forecasts (#400).Minor patch to build package with latest R version as requested by CRAN.
Minor patch for upcoming release of ggdist v3.3.1
interval_accuracy_measures (#379).combination_model() when used with transformed
component models.autoplot(<fbl_ts>), autolayer(<fbl_ts>) and autoplot(<dcmp_ts>) now use
the ggdist package visualising uncertainty with distributional vectors.fable::ARIMA(box_cox(y, feasts::guerrero(y))).autoplot(<fbl_ts>) not identifying multiple point
forecasts by linetype.top_down() and middle_out()
reconciliation methods (#362, #364 @FedericoGarza). in a model formula for xreg implemented with special_xreg() will now
include all measured variables (excluding the index and key variables).accuracy(<fbl_ts>) can now summarise accuracy over key variables. This is
done by specifying the accuracy by argument and not including some (or all)
of the fable's key variables (#341).forecast(), generate() will now keep exogenous regressors in the
output table.generics::forecast() for better compatibility with registering
methods alongside other packages (#375).hypothesize() generic for running statistical tests on a trained model.combination_weighted() function for producing a combination model with
arbitrary weights.type = "innovation".0.7*mdl1 + 0.3*mdl2 -
if mdl1 and mdl2 are models with the same response variables, then the
resulting combination model will also have the same response variable.xreg) in reconciliation methods that
partially forecast the hierarchy.mdl_df (mable) objects were
combined.outliers() generic for identifying the outliers of a fitted model.special_xreg() special generator, for producing a model matrix of
exogenous regressors. It supports an argument for controlling the default
inclusion of an intercept.common_xregs helper from fable to fabletools for providing a
common and consistent interface for common time series exogenous regressors.features()
functions if the .index argument is used in the function.fitted(h > 1) method (#302).scenarios() function for providing multiple scenarios to the
new_data argument. This allows different sets of future exogenous regressors
to be provided to functions like forecast(), generate(), and
interpolate() (#110).quantile_score(), which is similar to percentile_score() except it
allows a set of quantile probs to be provided (#280).autoplot(<dable>). If the decomposition
provides distributions for its components, then the uncertainty of the
components will be plotted with interval ribbons.generate().fitted(<mable>, h > 1).as_fable(<forecast>) for converting older forecast class objects to
fable data structures.top_down(method = "forecast_proportion") for reconciliation using the
forecast proportions techniques.middle_out() forecast reconciliation method.MDA(), MDV() and MDPV()
(#273, @davidtedfordholt).fill_gaps(<fable>).pinball_loss() and percentile_score() accuracy measures are now scaled
up by 2x for improved meaning. The loss at 50% equals absolute error and the
average loss equals CRPS (#280)..x, preventing conflicts with values named .x.box_cox() and inv_box_cox() are now vectorised over the transformation
parameter lambda.RMSSE() accuracy measure is now included in default accuracy() measures.response variable in as_fable() will no longer
error, it now sets the provided response value as the distribution's new
response.autoplot() are now always grouped by the data's key.bottom_up() aggregation mismatch for redundant leaf nodes (#266).min_trace() reconciliation for degenerate hierarchies (#267).select(<mable>) not keeping required key variables (#297).... not being passed through in report().bottom_up() forecast reconciliation method.skill_score() accuracy measure modifier.agg_vec() for manually producing aggregation vectors.augment(), tidy() and glance()) with model methods (such as forecast()
and generate()).agg_vec classes, aggregated values will now
always match regardless of the value used.summarise() with a fable will now retain the fable class if the
distribution still exists under the same variable name.as_fable.forecast() to convert forecast objects from the forecast
package to work with fable.CRPS() performance when using sampling distributions (#240).features() (#258).future.apply() to parallelize
forecast() when the future package is attached (#268).augment() function are no longer controlled
by the type argument. Response residuals (y - yhat) are now always found
in the .resid column, and innovation residuals (the model's error) are now
found in the .innov column. Response residuals will differ from innovation
residuals when transformations are used, and if the model has non-additive
residuals.dist_*() functions are now removed, and are completely replaced by the
distributional package. These are removed to prevent masking issues when
loading packages.fortify(<fable>) will now return a tibble with the same structure as the
fable, which is more useful for plotting forecast distributions with the
ggdist package. It can no longer be used to extract intervals from the
forecasts, this can be done using hilo(), and numerical values from a
<hilo> can be extracted with unpack_hilo() or interval$lower.View() panel.aggregate_key() can now be used with non-syntactic variable names.refit() dropping reconciliation attributes (#251).mean(), median(), variance(), quantile(), cdf() and density().autoplot.fbl_ts() and autolayer.fbl_ts() now accept the point_forecast
argument, which is a named list of functions that describe the method used to
obtain the point forecasts. If multiple are specified, each method will be
identified using the linetype.RMSSE(), pinball_loss(), scaled_pinball_loss().mable_vars()), response variables
(response_vars()) and distribution variables (distribution_var()).bind_*() and *_join() operations
on mables, dables, and fables. More verbs are supported by these extension
data classes, and so behaviour should work closer to what is expected.progressr::with_progress() function. Progress will no longer be
displayed automatically during lengthy calculations.hilo.fbl_ts() now keeps existing columns of a fable.forecast() will now return an empty fable instead of erroring when no
forecasts are requested.is_aggregated() now works for non-aggregated data types.forecast() now stores the distribution in the column
named the response variable (previously, this was the point forecast). Point
forecasts are now stored in the .mean column, which can be customised using
the point_forecast argument.bias_adjust option for forecast() is replaced by point_forecast,
allowing you to specify which point forecast measures to display (fable/#226).
This has been done to reduce confusion around the argument's usage,
disambiguate the returned point forecast's meaning, and also allow users
to specify which (if any) point forecasts to provide.as_mable, as_dable, and as_fable have been
changed to accept character vectors for specifying common attributes (such as
response variables, and distributions).models argument for mable and as_mable has been replaced with model
for consistency with the lack of plural in key.hilo intervals. The columns are the response variables. Similar structures
are returned when computing other distributional statistics like the mean.hilo intervals can no longer be unnested as they are now stored more
efficiently as a vctrs record type. The unpack_hilo() function will continue
to function as expected, and you can now obtain the components of the interval
with x$lower, x$upper, and x$level,rbind() methods are deprecated in favour of bind_rows()accuracy()) has
changed (due to shift to pivot_longer() from gather()). Model column name
values are now nested within key values, rather than key values nested in
model name values.show_gap option not working when more than one forecast is plotted.autolayer() plotting issues due to inherited aesthetics.aggregate_key() no longer drops keys, instead they are kept as forecast() producing forecasts via h when new_data does not
include a given series (#202).xreg() can now be called directly as a special.accuracy.fbl_ts() error when certain names were used in the fable.autoplot.fbl_ts() and autolayer.fbl_ts() now support
the show_gap argument. This can be used to connect the historical observations
to the forecasts (#113).components().
For example, tourism %>% STL(Trips) is now tourism %>% model(STL(Trips)) %>% components().
This change allows for more flexible decomposition specifications, and better interfaces for decomposition modelling.select.mdl_df() usage with negative select values (#120).features() for a tsibble with key variables but only one series.stream() causing issues with subsequent methods (#144).min_trace() reconciliation (@GeorgeAthana).CRPS()) accuracy measure.scale(value) to be used.min_trace(method = "wls_struct")) forecast reconciliation (@GeorgeAthana).mdl_df) which is a tibble-like data structure for applying multiple models to a dataset. Each row of the mable refers to a different time series from the data (identified by the key columns). A mable must contain at least one column of time series models (mdl_ts), where the list column itself (lst_mdl) describes how these models are related.fbl_ts) which is a tsibble-like data structure for representing forecasts. In extension to the key and index from the tsibble (tbl_ts) class, a fable (fbl_ts) must contain columns of point forecasts for the response variable(s), and a single distribution column (fcdist).dcmp_ts) which is a tsibble-like data structure for representing decompositions. This data class is useful for representing decompositions, as its print method describes how its columns can be combined to produce the original data, and has a more appropriate autoplot() method for displaying decompositions. Beyond this, a dable (dcmp_ts) behaves very similarly to a tsibble (tbl_ts).new_model_class(), new_model_definition()) and decomposition definitions (new_decomposition_class(), new_decomposition_definition()).GDP/CPI, the response will be the ratio of the pair. To transform a variable by some other data variable, the response can be specified using resp(), giving resp(GDP)/CPI. Multiple variables (and separate transformations for each), can be specified using vars(): vars(log(GDP), CPI). The inputs to the model are specified on the right hand side, and are handled using model defined specials (new_specials()).model() is the recommended interface, which can fit many model definitions to each time series in the input dataset returning a mable (mdl_df). The lower level interface for model estimation is accessible using estimate() which will return a time series model (mdl_ts), however using this interface is discouraged.forecast(), which allows you to produce future predictions of a time series from fitted models. The methods provided in fabletools handle the application of new data (such as the future index or exogenous regressors) to model specials, giving a simple and consistent interface to forecasting any model. The forecast methods will automatically backtransform and bias adjust any transformations specified in the model formula. This function returns a fable (fbl_ts) object.fcdist) which is used to describe the distribution of forecasts. Common forecast distributions have been added to the package, including the normal distribution (dist_normal()), multivariate normal (dist_mv_normal()) and simulated/sampled distributions (dist_sim()). In addition to this, dist_unknown() is available for methods that don't support distributional forecasts. A new distribution can be added using the new_fcdist() function. The forecast distribution class handles transformations on the distribution, and is used to create forecast intervals of the hilo class using the hilo() function. Mathematical operations on the normal distribution are supported.new_transformation()), and bias adjustment (bias_adjust()) methods.aggregate_key(), which is used to compute all levels of aggregation in a specified key structure. It supports nested structures using parent / key and crossed structures using keyA * keyB.reconcile(). This function modifies the way in which forecasts from a model column are combined to give coherent forecasts. In this version the MinT (min_trace()) reconciliation technique is available. This is commonly used in combination with aggregate_key().augment(), tidy(), and glance().components(), which returns a dable (dcmp_ts) that describes how the fitted values of a model were obtained from its components. This is commonly used to visualise the states of a state space model.equation(), which returns a formatted display of a fitted model's equation. This is commonly used to conveniently add model equations to reports, and to better understand the structure of the model.fitted(), model residuals with residuals(), and the response variable with response(). These functions return a tsibble (tbl_ts) object.refit(), which allows an estimated model to be applied to a new dataset.report(), which provides a detailed summary of an estimated model.generate() support, which is used to simulate future paths from an estimated model.stream(), which allows an estimated model to be extended using newly available data.interpolate(), which allows missing values from a dataset to be interpolated using an estimated model (and model appropriate interpolation strategy).features(), along with scoped variants features_at(), features_if() and features_all(). These functions make it easy to compute a large collection of features for each time series in the input dataset.feature_set(), which allows a collection of registered features from loaded packages to be accessed using a tagging system.decomposition_model(), which allows the components from any decomposition method that returns a dable (dcmp_ts) to be modelled separately and have their forecasts combined to give forecasts on the original response variable.combination_model(), which allows any model to be combined with any other. This function accepts a function which describes how the models are combined (such as combination_ensemble()). A combination model can also be obtained by using mathematical operations on model definitions or estimated models.null_model(), which can be used as a empty model in a mable (mdl_df). This is most commonly used as a substitute for models which encountered an error, preventing the successfully estimated models from being lost.accuracy(), which allows the accuracy of a model to be evaluated. This function can be used to summarise model performance on the training data (accuracy.mdl_df(), accuracy.mdl_ts()), or to evaluate the accuracy of forecasts over a test dataset (accuracy.fbl_ts()). Several accuracy measures are supported, including point_accuracy_measures (ME, MSE, RMSE, MAE, MPE, MAPE, MASE, ACF1), interval_accuracy_measures (winkler_score) and distribution_accuracy_measures (percentile_score). These accuracy functions can be used in conjunction with the rolling functions in the tsibble package (stretch_tsibble(), slide_tsibble(), tile_tsibble()) to computed time series cross-validated accuracy measures.