model_best: Select Best Model

model_bestR Documentation

Select Best Model

Description

A function for selecting the best model fitted by the function model_est or model_est_single.

Usage

model_best(models, ic = BIC)

Arguments

models

An object generated by the funcion model_est or model_est_single.

ic

Information criterion: BIC or AIC.

Value

A list containing the following elements:

data

Tibble with the data used in fitting the model.

model

An lm object.

n_obs

Number of observations of the dependent variable.

h

Horizon used in direct estimation.

See Also

model_est, model_est_single

Examples


inf_head <- coreinf_br[["ipca"]]
inf_corems <- coreinf_br[["ipcams"]]
pq <- lags(2, 1)
model1 <- model_est(inf_head, inf_corems, 2, pq)
model_best(model1)

p <- unique(lags(2, 1)[, 1:2])
model2 <- model_est_single(inf_head, 2, p)
model_best(model2, ic = AIC)

nelson16silva/wavcoreinf documentation built on Feb. 17, 2025, 7:10 p.m.