Generic calculate_aic()
returns the Akaike's 'An Information Criterion' for
the given input.
calculate_aic(x, ...)
# S3 method for default
calculate_aic(x, ...)
# S3 method for trending_model
calculate_aic(x, data, as_tibble = FALSE, ...)
# S3 method for list
calculate_aic(x, data, ...)
# S3 method for trending_fit
calculate_aic(x, as_tibble = FALSE, ...)
# S3 method for trending_fit_tbl
calculate_aic(x, ...)
An R object.
Not currently used.
a data.frame
containing data (including the response variable
and all predictors) used in the specified model.
Should the result be returned as tibble
(as_tibble = TRUE
) or a list (as_tibble = FALSE
).
For a single trending_fit
input, if
as_tibble = FALSE
the object returned will be a list with entries:
metric: "AIC"
result: the resulting AIC value fit (NULL if the calculation failed)
warnings: any warnings generated during calculation
errors: any errors generated during calculation
If as_tibble = TRUE
, or the input is a
trending_fit_tbl
, then the output
will be a tibble with one row for each fitted model
columns corresponding to output generated with single model input.
Specific methods are given for
trending_fit
and
trending_fit_tbl
objects. The default
method applies stats::AIC()
directly.