Learn R Programming

dLagM (version 0.0.9)

sortScore: Sort ACI, BIC and MASE scores

Description

A function that displays sorted AIC, BIC, and MASE scores.

Usage

sortScore(x, score = c("bic", "aic", "mase"))

Arguments

x

A vector of AIC, BIC, or MASE values.

score

The type of scores to be sorted.

Details

This function sorts the AIC, BIC, or MASE scores to display the smallest one at the top of a bunch of AIC, BIC, or MASE scores.

Examples

Run this code
# NOT RUN {
data(warming)
model.poly1 = polyDlm(x = warming$NoMotorVehicles , y = warming$Warming , 
                     q = 2 , k = 2 , show.beta = TRUE ,  show.summary = TRUE)
model.poly2 = polyDlm(x = warming$NoMotorVehicles , y = warming$Warming , 
                      q = 3 , k = 2 , show.beta = TRUE ,  show.summary = TRUE)
model.poly3 = polyDlm(x = warming$NoMotorVehicles , y = warming$Warming , 
                      q = 4 , k = 2 , show.beta = TRUE ,  show.summary = TRUE)

aic = AIC(model.poly1$model, model.poly2$model, model.poly3$model)
bic = BIC(model.poly1$model, model.poly2$model, model.poly3$model)
mase = MASE(model.poly1$model, model.poly2$model, model.poly3$model)

sortScore(aic , score = "aic")
sortScore(bic , score = "bic")
sortScore(mase , score = "mase")

# }

Run the code above in your browser using DataLab