MatthieuStigler / tsDyn

tsDyn
tsdyn.googlecode.com
33 stars 20 forks source link

accuracy_stat: Small inconsistency in output names #29

Open MatthieuStigler opened 3 years ago

MatthieuStigler commented 3 years ago

Some called x and some x_small?

library(tsDyn)
#> Registered S3 method overwritten by 'quantmod':
#>   method            from
#>   as.zoo.data.frame zoo
x <- log10(lynx)
x_small <- x[1:100]
mod_small <- list()
mod_small[["linear"]] <- linear(x_small, m=2)
mod_small[["setar"]] <- setar(x_small, m=2, thDelay=1, trace = FALSE)
#> Warning: Possible unit root in the high regime. Roots are: 1 1
mod_small[["lstar"]] <- lstar(x_small, m=2, thDelay=1, trace = FALSE)
mod_small[["aar"]] <- aar(x_small, m=2)

pred_rolls_1 <- lapply(mod_small, predict_rolling, n.ahead=1, newdata=x[101:114])
sapply(pred_rolls_1, accuracy_stat)
#>      linear     setar      lstar      aar       
#> var  "x"        "x_small"  "x_small"  "x"       
#> ME   0.05258699 0.02826967 0.03237135 0.03953898
#> RMSE 0.1328027  0.06883358 0.07287524 0.09035348
#> MAE  0.1148975  0.0477577  0.05523015 0.067775  
#> MPE  1.478991   0.8449191  1.027387   1.241795  
#> MAPE 3.886218   1.57141    1.852648   2.294182

Created on 2020-12-05 by the reprex package (v0.3.0)