modsel: Select the model based on given information criteria

Description Usage Arguments Details Value Author(s) Examples

View source: R/modsel.R

Description

Selects the model with minimum of given information criteria and model type

Usage

1
2
3
4
5
6
7
modsel(
  x,
  IC = x$IC[1],
  test = x$test[1],
  type = c("restricted", "unrestricted"),
  print = TRUE
)

Arguments

x

a midas_r_ic_table object

IC

the name of information criteria to base the choosing of the model

test

the name of the test for which to print out the p-value

type

the type of MIDAS model, either restricted or unrestricted

print

logical, if TRUE, prints the summary of the best model.

Details

This function selects the model from the model selection table for which the chosen information criteria achieves the smallest value. The function works with model tables produced by functions lf_lags_table, hf_lags_table, amidas_table and midas_r_ic_table.

Value

(invisibly) the best model based on information criteria, midas_r object

Author(s)

Virmantas Kvedaras, Vaidotas Zemlys

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
data("USunempr")
data("USrealgdp")
y <- diff(log(USrealgdp))
x <- window(diff(USunempr),start=1949)
trend <- 1:length(y)

mhfr <- hf_lags_table(y~trend+fmls(x,12,12,nealmon),
                      start=list(x=rep(0,3)),
                      from=list(x=0),to=list(x=c(4,6)))

mlfr <- lf_lags_table(y~trend+fmls(x,12,12,nealmon),
                      start=list(x=rep(0,3)),
                      from=list(x=0),to=list(x=c(2,3)))

modsel(mhfr,"BIC","unrestricted")

modsel(mlfr,"BIC","unrestricted")

midasr documentation built on Feb. 23, 2021, 5:11 p.m.