data("air")
x.air <- seq(min(air$xtab), max(air$xtab),
length.out = 101)
# Optimal polynomial degrees via the AIC criterion
(p.aic.air <- poly_degree(air$xtab, air$ytab,
type = "AIC"))
# Optimal polynomial degrees via the BIC criterion
(p.bic.air <- poly_degree(air$xtab, air$ytab,
type = "BIC"))
Run the code above in your browser using DataLab