new-dcmp-class.Rd
Suitable for extension packages to create new decompositions for fable.
new_decomposition_class(method = "Unknown model", train = function(.data, formula, specials, ...) abort("This decomposition has not defined a training method."), specials = new_specials(), check = function(.data) { if (NROW(.data) == 0) abort("There is no data to decompose!") }, prepare = function(...) { }, ..., .env = caller_env(), .inherit = decomposition_definition)
method | The name of the decomposition method |
---|---|
train | A function that trains the model to a dataset. |
specials | Special functions produced using |
check | A function that is used to check the data for suitability with the model. This can be used to check for missing values (both implicit and explicit), regularity of observations, ordered time index, and univariate responses. |
prepare | This allows you to modify the model class according to user
inputs. |
... | Further arguments to |
.env | The environment from which functions should inherit from. |
.inherit | A model class to inherit from. |
This function produces a new R6 decomposition definition. An understanding of R6 is
not required, however could be useful to provide more sophisticated model
interfaces. All functions have access to self
, allowing the functions for
training the model and evaluating specials to access the model class itself.
This can be useful to obtain elements set in the