R Under development (unstable) (2024-10-26 r87273 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(tsDyn) > suppressWarnings(RNGversion("3.5.3")) > > > ############################ > ### Load data > ############################ > path_mod_uni <- system.file("inst/testdata/models_univariate.rds", package = "tsDyn") > if(path_mod_uni=="") path_mod_uni <- system.file("testdata/models_univariate.rds", package = "tsDyn") > > models_univariate <- readRDS(path_mod_uni) > > > > mod <- models_univariate$object > mod_no_aar <- subset(models_univariate, model != "aar")$object > names(mod_no_aar) <- with(subset(models_univariate, model != "aar"), + paste(model, include, lag, sep="_")) > mod_notrend_noaar <- subset(models_univariate, !include %in% c("trend", "both") & model != "aar")$object > mod_notrend <- subset(models_univariate, !include %in% c("trend", "both") )$object > mod_const_only <- subset(models_univariate, include =="const" )$object > > ### Extract methods > sapply(mod, AIC) [1] -74.04070 -73.87034 -65.29029 -65.88014 -75.40861 -74.21791 -63.34276 [8] -63.97585 -78.95328 -86.50578 -73.71933 -66.95094 -77.42569 -68.82104 [15] -77.01536 -85.02961 -83.50645 -78.51849 -84.74332 -62.89375 -72.03442 [22] -71.89382 -64.00770 -66.59737 -75.21548 -68.77001 -69.72243 -70.43651 [29] -75.66545 -65.96722 -83.58279 -61.43488 -76.86527 -71.68691 -75.39537 [36] -74.98353 -81.38956 -76.50257 -69.99726 -73.20598 -73.19615 -69.68015 [43] -73.67484 -68.16502 -59.59066 -50.70933 -40.92541 > sapply(mod, BIC) [1] -68.42710 -70.12793 -63.41909 -62.13774 -67.92381 -68.60431 -59.60036 [8] -58.36224 -65.85488 -65.92256 -64.36333 -51.98133 -71.81209 -59.46504 [15] -67.65936 -70.06000 -66.66564 -61.67769 -58.54651 -36.69694 -58.93601 [22] -58.79541 -43.42449 -46.01416 -65.85948 -59.41401 -54.75282 -55.46691 [29] -62.56705 -52.86882 -62.99958 -40.85167 -61.89566 -60.45970 -67.91057 [36] -63.75633 -62.67755 -57.79056 -55.02765 -58.23638 -61.96894 -58.45294 [43] -58.70523 -53.19541 -40.87865 -15.15651 11.46822 > sapply(mod, mse) [1] 0.18871552 0.19744432 0.24613354 0.23320527 0.17592819 0.18802008 [7] 0.24586463 0.23274074 0.14420394 0.10429447 0.17479302 0.17761366 [13] 0.17586558 0.19357213 0.16319327 0.12187204 0.12066736 0.13388126 [19] 0.09548184 0.15052594 0.16656265 0.16705125 0.16665539 0.15790233 [25] 0.16942879 0.19377803 0.16764881 0.16517319 0.15442754 0.18900462 [31] 0.11084290 0.17583193 0.14446860 0.17491113 0.17597672 0.16330152 [37] 0.12096156 0.13392569 0.16669165 0.15591286 0.16949704 0.18237874 [43] 0.15439734 0.17317755 0.19049322 0.15753448 0.13275109 > sapply(mod, MAPE) [1] 0.1543844 0.1550554 0.1455576 0.1523718 0.1489883 0.1525803 0.1496632 [8] 0.1537752 0.1382486 0.1153449 0.1557551 0.1515011 0.1572378 0.1583161 [15] 0.1349424 0.1292323 0.1287440 0.1262993 0.1106820 0.1440745 0.1497543 [22] 0.1411825 0.1414805 0.1411174 0.1530741 0.1428547 0.1390416 0.1386624 [29] 0.1299710 0.1553969 0.1213863 0.1532264 0.1384301 0.1557567 0.1572475 [36] 0.1352227 0.1289654 0.1264408 0.1497762 0.1286361 0.1531321 0.1493362 [43] 0.1301544 0.1475127 0.1518778 0.1364497 0.1213586 > > sapply(mod, coef) [[1]] const trend phi.1 0.960001423 0.007328862 0.529055888 [[2]] const phi.1 0.9998652 0.5859870 [[3]] phi.1 0.9836385 [[4]] trend phi.1 0.008879993 0.895448654 [[5]] const trend phi.1 phi.2 1.217407570 0.009017984 0.659082417 -0.254184319 [[6]] const phi.1 phi.2 1.2281886 0.7110028 -0.2217373 [[7]] phi.1 phi.2 0.95299035 0.03115904 [[8]] trend phi.1 phi.2 0.009393203 0.896697060 -0.004950298 [[9]] const.L trend.L phiL.1 const.H trend.H phiH.1 1.42273074 -0.02968137 0.88291124 0.79786963 0.01327191 0.52741426 th 1.80000000 [[10]] const.L trend.L phiL.1 const.M trend.M phiM.1 3.22293510 -0.02457655 -0.35761878 0.90425559 0.04283375 0.24330291 const.H trend.H phiH.1 th1 th2 0.05599371 -0.00264095 0.93518119 1.90000000 2.20000000 [[11]] const.L phiL.1 const.H phiH.1 th 0.47302326 0.94418605 0.05038815 0.90984409 2.10000000 [[12]] const.L phiL.1 const.M phiM.1 const.H phiH.1 th1 1.7146552 0.1925287 3.5680000 -0.5800000 -0.2878533 1.0194805 1.9000000 th2 2.5000000 [[13]] phiL.1 phiH.1 th 1.1985522 0.9280588 2.1000000 [[14]] phiL.1 phiM.1 phiH.1 th1 th2 1.1681179 1.0500465 0.9192732 2.0000000 2.3000000 [[15]] trend.L phiL.1 trend.H phiH.1 th -0.02604046 1.68387226 0.01130336 0.84977275 1.80000000 [[16]] trend.L phiL.1 trend.M phiM.1 trend.H phiH.1 -0.011651387 1.332184384 0.043713929 0.662675414 -0.002865971 0.957067105 th1 th2 1.900000000 2.200000000 [[17]] const.L trend.L phiL.1 phiL.2 const.H trend.H 1.55299825 -0.03320677 1.48464554 -0.55132947 1.20512847 0.01743190 phiH.1 phiH.2 th 0.65379158 -0.33276640 1.80000000 [[18]] const.L trend.L phiL.1 phiL.2 const.H trend.H 2.21251721 0.03588831 1.66543666 -2.63308831 1.54762122 0.01284603 phiH.1 phiH.2 th 0.47410782 -0.23230136 1.80000000 [[19]] const.L trend.L phiL.1 phiL.2 const.M trend.M 2.980334264 -0.023219247 -0.551749207 0.265750997 1.057551633 0.042597431 phiM.1 phiM.2 const.H trend.H phiH.1 phiH.2 0.233165151 -0.038381703 0.533080154 0.002353972 0.951025742 -0.249918744 th1 th2 1.900000000 2.200000000 [[20]] const.L trend.L phiL.1 phiL.2 const.M trend.M 1.184970088 0.010911539 0.956582321 -0.635316456 2.456904959 0.015509538 phiM.1 phiM.2 const.H trend.H phiH.1 phiH.2 0.291659922 -0.471610448 1.234187053 0.009628969 1.290752384 -0.844964120 th1 th2 1.900000000 2.700000000 [[21]] const.L phiL.1 phiL.2 const.H phiH.1 phiH.2 th 0.7047778 1.1279944 -0.2796141 0.2559569 1.0048340 -0.1821043 2.1000000 [[22]] const.L phiL.1 phiL.2 const.H phiH.1 phiH.2 th 4.0058223 1.1306673 -2.4834083 1.3306091 0.6184753 -0.1681338 1.8000000 [[23]] const.L phiL.1 phiL.2 const.M phiM.1 phiM.2 -0.10148835 1.11583261 0.20534944 0.78426057 0.83739377 -0.15102675 const.H phiH.1 phiH.2 th1 th2 -0.04949336 1.16464952 -0.25186593 1.80000000 2.30000000 [[24]] const.L phiL.1 phiL.2 const.M phiM.1 phiM.2 const.H 1.1712196 0.7452092 -0.2005154 0.9555311 -0.1308832 0.6455488 0.7480115 phiH.1 phiH.2 th1 th2 1.2893372 -0.5942363 2.1000000 2.7000000 [[25]] phiL.1 phiL.2 phiH.1 phiH.2 th 1.4153645 -0.1965539 1.0732823 -0.1568338 2.1000000 [[26]] phiL.1 phiL.2 phiH.1 phiH.2 th 0.7648152 0.4058041 0.4066658 0.4971261 2.1000000 [[27]] phiL.1 phiL.2 phiM.1 phiM.2 phiH.1 phiH.2 th1 1.0540197 0.2060383 1.1895750 -0.1352073 1.1511918 -0.2555858 1.8000000 th2 2.3000000 [[28]] phiL.1 phiL.2 phiM.1 phiM.2 phiH.1 phiH.2 0.76481520 0.40580406 -0.09307952 1.00445339 1.23432558 -0.32053789 th1 th2 2.10000000 2.90000000 [[29]] trend.L phiL.1 phiL.2 trend.H phiH.1 phiH.2 -0.02876815 2.24652986 -0.45922738 0.01337420 0.97991916 -0.15543698 th 1.80000000 [[30]] trend.L phiL.1 phiL.2 trend.H phiH.1 phiH.2 0.010578129 0.700609175 0.327049793 0.005853272 0.631863289 0.224391527 th 2.200000000 [[31]] trend.L phiL.1 phiL.2 trend.M phiM.1 -0.0105443453 0.5001720041 0.7119023147 0.0437121010 0.6947884500 phiM.2 trend.H phiH.1 phiH.2 th1 -0.0109609145 -0.0002254492 1.1084846358 -0.1920151800 1.9000000000 th2 2.2000000000 [[32]] trend.L phiL.1 phiL.2 trend.M phiM.1 phiM.2 0.016863611 1.059566001 -0.151223162 0.012786160 0.533350873 0.385415001 trend.H phiH.1 phiH.2 th1 th2 0.007683886 0.785735201 0.031870347 1.900000000 2.600000000 [[33]] const.L trend.L phiL.1 const.H trend.H phiH.1 1.43370800 -0.02966259 0.87556654 -0.63661707 0.04293221 -0.34786490 gamma th 100.00019265 1.85194148 [[34]] const.L phiL.1 const.H phiH.1 gamma th 0.47411494 0.94357001 -0.42952127 -0.03182726 100.00009014 2.15658961 [[35]] phiL.1 phiH.1 gamma th 1.1986045 -0.2707821 100.0000852 2.1559486 [[36]] trend.L phiL.1 trend.H phiH.1 gamma th -0.02603016 1.68389651 0.03734241 -0.83456175 100.00009216 1.86001670 [[37]] const.L trend.L phiL.1 phiL.2 const.H trend.H 1.56565862 -0.03320585 1.47439029 -0.54953857 -0.36115355 0.05063863 phiH.1 phiH.2 gamma th -0.82047433 0.21685433 100.00023062 1.85037146 [[38]] const.L trend.L phiL.1 phiL.2 const.H trend.H 2.22411721 0.03585816 1.67386732 -2.65115448 -0.67435749 -0.02300742 phiH.1 phiH.2 gamma th -1.19978847 2.41808989 100.00002137 1.83782851 [[39]] const.L phiL.1 phiL.2 const.H phiH.1 phiH.2 0.70339509 1.12684460 -0.27787073 -0.45170677 -0.12041161 0.09553601 gamma th 100.00009715 2.15440805 [[40]] const.L phiL.1 phiL.2 const.H phiH.1 phiH.2 17.4490888 0.2254781 -10.4443544 -16.2049730 0.4657153 10.2385747 gamma th 54.3076438 1.6824246 [[41]] phiL.1 phiL.2 phiH.1 phiH.2 gamma th 1.4125653 -0.1939265 -0.3383930 0.0357166 100.0000828 2.1587642 [[42]] phiL.1 phiL.2 phiH.1 phiH.2 gamma th 3.8187578 1.0393329 -3.3227450 -0.6927455 1.6751586 0.3556488 [[43]] trend.L phiL.1 phiL.2 trend.H phiH.1 phiH.2 -0.02874671 2.24216621 -0.45565335 0.04218107 -1.26111882 0.29751503 gamma th 100.00004531 1.86720893 [[44]] trend.L phiL.1 phiL.2 trend.H phiH.1 phiH.2 0.01672366 1.71910345 0.19677775 -0.01026890 -1.31684282 0.16940956 gamma th 1.70608996 1.19601061 [[45]] (Intercept) s(V1.0).1 s(V1.0).2 s(V1.0).3 s(V1.0).4 s(V1.0).5 2.40000000 -0.22106929 -0.09872850 0.03497379 0.13739012 0.19768828 s(V1.0).6 s(V1.0).7 s(V1.0).8 s(V1.0).9 0.36481064 0.50472992 0.65486512 0.80847261 [[46]] (Intercept) s(V1.0).1 s(V1.0).2 s(V1.0).3 s(V1.0).4 s(V1.0).5 2.40000000 -0.26407178 -0.08542210 0.11320455 0.21611584 0.30085736 s(V1.0).6 s(V1.0).7 s(V1.0).8 s(V1.0).9 s(V1..1).1 s(V1..1).2 0.47620533 0.58139461 0.70206523 0.82227368 -0.25686662 -0.07511363 s(V1..1).3 s(V1..1).4 s(V1..1).5 s(V1..1).6 s(V1..1).7 s(V1..1).8 -0.16029178 -0.38841476 -0.26723004 -0.26779247 -0.31189881 -0.20537840 s(V1..1).9 -0.14050113 [[47]] (Intercept) s(V1.0).1 s(V1.0).2 s(V1.0).3 s(V1.0).4 s(V1.0).5 2.400000000 -0.234812806 -0.073948983 0.112314716 0.170193750 0.266939179 s(V1.0).6 s(V1.0).7 s(V1.0).8 s(V1.0).9 s(V1..1).1 s(V1..1).2 0.435928747 0.527680004 0.637135480 0.745260099 -0.270106871 0.012224401 s(V1..1).3 s(V1..1).4 s(V1..1).5 s(V1..1).6 s(V1..1).7 s(V1..1).8 -0.059813919 -0.239044630 -0.118754193 -0.142859062 -0.227173913 -0.109453449 s(V1..1).9 s(V1..2).1 s(V1..2).2 s(V1..2).3 s(V1..2).4 s(V1..2).5 0.006333872 0.122679683 -0.044255357 -0.172853812 -0.308584902 -0.235792088 s(V1..2).6 s(V1..2).7 s(V1..2).8 s(V1..2).9 -0.269128951 -0.155474029 -0.146193886 -0.134507792 > sapply(mod, coef, hyperCoef = FALSE) [[1]] const trend phi.1 0.960001423 0.007328862 0.529055888 [[2]] const phi.1 0.9998652 0.5859870 [[3]] phi.1 0.9836385 [[4]] trend phi.1 0.008879993 0.895448654 [[5]] const trend phi.1 phi.2 1.217407570 0.009017984 0.659082417 -0.254184319 [[6]] const phi.1 phi.2 1.2281886 0.7110028 -0.2217373 [[7]] phi.1 phi.2 0.95299035 0.03115904 [[8]] trend phi.1 phi.2 0.009393203 0.896697060 -0.004950298 [[9]] const.L trend.L phiL.1 const.H trend.H phiH.1 1.42273074 -0.02968137 0.88291124 0.79786963 0.01327191 0.52741426 [[10]] const.L trend.L phiL.1 const.M trend.M phiM.1 3.22293510 -0.02457655 -0.35761878 0.90425559 0.04283375 0.24330291 const.H trend.H phiH.1 0.05599371 -0.00264095 0.93518119 [[11]] const.L phiL.1 const.H phiH.1 0.47302326 0.94418605 0.05038815 0.90984409 [[12]] const.L phiL.1 const.M phiM.1 const.H phiH.1 1.7146552 0.1925287 3.5680000 -0.5800000 -0.2878533 1.0194805 [[13]] phiL.1 phiH.1 1.1985522 0.9280588 [[14]] phiL.1 phiM.1 phiH.1 1.1681179 1.0500465 0.9192732 [[15]] trend.L phiL.1 trend.H phiH.1 -0.02604046 1.68387226 0.01130336 0.84977275 [[16]] trend.L phiL.1 trend.M phiM.1 trend.H phiH.1 -0.011651387 1.332184384 0.043713929 0.662675414 -0.002865971 0.957067105 [[17]] const.L trend.L phiL.1 phiL.2 const.H trend.H 1.55299825 -0.03320677 1.48464554 -0.55132947 1.20512847 0.01743190 phiH.1 phiH.2 0.65379158 -0.33276640 [[18]] const.L trend.L phiL.1 phiL.2 const.H trend.H 2.21251721 0.03588831 1.66543666 -2.63308831 1.54762122 0.01284603 phiH.1 phiH.2 0.47410782 -0.23230136 [[19]] const.L trend.L phiL.1 phiL.2 const.M trend.M 2.980334264 -0.023219247 -0.551749207 0.265750997 1.057551633 0.042597431 phiM.1 phiM.2 const.H trend.H phiH.1 phiH.2 0.233165151 -0.038381703 0.533080154 0.002353972 0.951025742 -0.249918744 [[20]] const.L trend.L phiL.1 phiL.2 const.M trend.M 1.184970088 0.010911539 0.956582321 -0.635316456 2.456904959 0.015509538 phiM.1 phiM.2 const.H trend.H phiH.1 phiH.2 0.291659922 -0.471610448 1.234187053 0.009628969 1.290752384 -0.844964120 [[21]] const.L phiL.1 phiL.2 const.H phiH.1 phiH.2 0.7047778 1.1279944 -0.2796141 0.2559569 1.0048340 -0.1821043 [[22]] const.L phiL.1 phiL.2 const.H phiH.1 phiH.2 4.0058223 1.1306673 -2.4834083 1.3306091 0.6184753 -0.1681338 [[23]] const.L phiL.1 phiL.2 const.M phiM.1 phiM.2 -0.10148835 1.11583261 0.20534944 0.78426057 0.83739377 -0.15102675 const.H phiH.1 phiH.2 -0.04949336 1.16464952 -0.25186593 [[24]] const.L phiL.1 phiL.2 const.M phiM.1 phiM.2 const.H 1.1712196 0.7452092 -0.2005154 0.9555311 -0.1308832 0.6455488 0.7480115 phiH.1 phiH.2 1.2893372 -0.5942363 [[25]] phiL.1 phiL.2 phiH.1 phiH.2 1.4153645 -0.1965539 1.0732823 -0.1568338 [[26]] phiL.1 phiL.2 phiH.1 phiH.2 0.7648152 0.4058041 0.4066658 0.4971261 [[27]] phiL.1 phiL.2 phiM.1 phiM.2 phiH.1 phiH.2 1.0540197 0.2060383 1.1895750 -0.1352073 1.1511918 -0.2555858 [[28]] phiL.1 phiL.2 phiM.1 phiM.2 phiH.1 phiH.2 0.76481520 0.40580406 -0.09307952 1.00445339 1.23432558 -0.32053789 [[29]] trend.L phiL.1 phiL.2 trend.H phiH.1 phiH.2 -0.02876815 2.24652986 -0.45922738 0.01337420 0.97991916 -0.15543698 [[30]] trend.L phiL.1 phiL.2 trend.H phiH.1 phiH.2 0.010578129 0.700609175 0.327049793 0.005853272 0.631863289 0.224391527 [[31]] trend.L phiL.1 phiL.2 trend.M phiM.1 -0.0105443453 0.5001720041 0.7119023147 0.0437121010 0.6947884500 phiM.2 trend.H phiH.1 phiH.2 -0.0109609145 -0.0002254492 1.1084846358 -0.1920151800 [[32]] trend.L phiL.1 phiL.2 trend.M phiM.1 phiM.2 0.016863611 1.059566001 -0.151223162 0.012786160 0.533350873 0.385415001 trend.H phiH.1 phiH.2 0.007683886 0.785735201 0.031870347 [[33]] const.L trend.L phiL.1 const.H trend.H phiH.1 1.43370800 -0.02966259 0.87556654 -0.63661707 0.04293221 -0.34786490 [[34]] const.L phiL.1 const.H phiH.1 0.47411494 0.94357001 -0.42952127 -0.03182726 [[35]] phiL.1 phiH.1 1.1986045 -0.2707821 [[36]] trend.L phiL.1 trend.H phiH.1 -0.02603016 1.68389651 0.03734241 -0.83456175 [[37]] const.L trend.L phiL.1 phiL.2 const.H trend.H 1.56565862 -0.03320585 1.47439029 -0.54953857 -0.36115355 0.05063863 phiH.1 phiH.2 -0.82047433 0.21685433 [[38]] const.L trend.L phiL.1 phiL.2 const.H trend.H 2.22411721 0.03585816 1.67386732 -2.65115448 -0.67435749 -0.02300742 phiH.1 phiH.2 -1.19978847 2.41808989 [[39]] const.L phiL.1 phiL.2 const.H phiH.1 phiH.2 0.70339509 1.12684460 -0.27787073 -0.45170677 -0.12041161 0.09553601 [[40]] const.L phiL.1 phiL.2 const.H phiH.1 phiH.2 17.4490888 0.2254781 -10.4443544 -16.2049730 0.4657153 10.2385747 [[41]] phiL.1 phiL.2 phiH.1 phiH.2 1.4125653 -0.1939265 -0.3383930 0.0357166 [[42]] phiL.1 phiL.2 phiH.1 phiH.2 3.8187578 1.0393329 -3.3227450 -0.6927455 [[43]] trend.L phiL.1 phiL.2 trend.H phiH.1 phiH.2 -0.02874671 2.24216621 -0.45565335 0.04218107 -1.26111882 0.29751503 [[44]] trend.L phiL.1 phiL.2 trend.H phiH.1 phiH.2 0.01672366 1.71910345 0.19677775 -0.01026890 -1.31684282 0.16940956 [[45]] (Intercept) s(V1.0).1 s(V1.0).2 s(V1.0).3 s(V1.0).4 s(V1.0).5 2.40000000 -0.22106929 -0.09872850 0.03497379 0.13739012 0.19768828 s(V1.0).6 s(V1.0).7 s(V1.0).8 s(V1.0).9 0.36481064 0.50472992 0.65486512 0.80847261 [[46]] (Intercept) s(V1.0).1 s(V1.0).2 s(V1.0).3 s(V1.0).4 s(V1.0).5 2.40000000 -0.26407178 -0.08542210 0.11320455 0.21611584 0.30085736 s(V1.0).6 s(V1.0).7 s(V1.0).8 s(V1.0).9 s(V1..1).1 s(V1..1).2 0.47620533 0.58139461 0.70206523 0.82227368 -0.25686662 -0.07511363 s(V1..1).3 s(V1..1).4 s(V1..1).5 s(V1..1).6 s(V1..1).7 s(V1..1).8 -0.16029178 -0.38841476 -0.26723004 -0.26779247 -0.31189881 -0.20537840 s(V1..1).9 -0.14050113 [[47]] (Intercept) s(V1.0).1 s(V1.0).2 s(V1.0).3 s(V1.0).4 s(V1.0).5 2.400000000 -0.234812806 -0.073948983 0.112314716 0.170193750 0.266939179 s(V1.0).6 s(V1.0).7 s(V1.0).8 s(V1.0).9 s(V1..1).1 s(V1..1).2 0.435928747 0.527680004 0.637135480 0.745260099 -0.270106871 0.012224401 s(V1..1).3 s(V1..1).4 s(V1..1).5 s(V1..1).6 s(V1..1).7 s(V1..1).8 -0.059813919 -0.239044630 -0.118754193 -0.142859062 -0.227173913 -0.109453449 s(V1..1).9 s(V1..2).1 s(V1..2).2 s(V1..2).3 s(V1..2).4 s(V1..2).5 0.006333872 0.122679683 -0.044255357 -0.172853812 -0.308584902 -0.235792088 s(V1..2).6 s(V1..2).7 s(V1..2).8 s(V1..2).9 -0.269128951 -0.155474029 -0.146193886 -0.134507792 > sapply(mod, function(x) head(residuals(x))) [,1] [,2] [,3] [,4] [,5] [,6] [1,] NA NA NA NA NA NA [2,] 0.16293558 -0.006233904 0.03926763 0.24204324 NA NA [3,] 0.15560672 -0.006233904 0.03926763 0.23316324 0.201819012 -0.002425877 [4,] -0.05172214 -0.206233904 -0.16073237 0.02428325 -0.007198971 -0.202425877 [5,] -0.05323983 -0.189036510 -0.06400467 0.09449299 0.015599528 -0.160225308 [6,] -0.60766310 -0.730437812 -0.56564083 -0.42484214 -0.578347077 -0.733472490 [,7] [,8] [,9] [,10] [,11] [,12] [1,] NA NA NA NA NA NA [2,] NA NA 0.32306425 0.10221238 0.16598604 0.224 [3,] 0.03804147 0.25041457 0.30979234 0.10485333 0.16598604 0.224 [4,] -0.16195853 0.04102136 0.09652043 -0.09250572 -0.03401396 0.024 [5,] -0.07136046 0.11096757 0.08873137 0.48914299 0.04795486 -0.192 [6,] -0.56982962 -0.40974599 -0.47179911 -0.12936047 -0.95581395 -0.850 [,13] [,14] [,15] [,16] [,17] [,18] [1,] NA NA NA NA NA NA [2,] 0.17265879 0.19374422 0.3492420 0.10590492 NA NA [3,] 0.17265879 0.19374422 0.3379387 0.10877089 0.4069792 0.25919726 [4,] -0.02734121 -0.00625578 0.1266353 -0.08836314 0.1895473 0.04635123 [5,] 0.05827056 -0.21010233 0.1852865 0.46725837 0.2028737 0.02832677 [6,] -1.01695967 -0.70509767 -0.3410396 -0.11018802 -0.4157323 -0.58356874 [,19] [,20] [,21] [,22] [,23] [,24] [1,] NA NA NA NA NA NA [2,] NA NA NA NA NA NA [3,] 0.18190908 0.35946676 0.16949165 -0.01142882 0.25881275 0.209271535 [4,] -0.02044489 0.14395723 -0.03050835 -0.21142882 0.05881275 0.009271535 [5,] 0.49380883 0.08677967 0.07045846 -0.18773376 -0.16406269 -0.116905114 [6,] -0.13314843 -0.59388596 -0.95841501 -0.75951298 -0.71052866 -0.600883675 [,25] [,26] [,27] [,28] [,29] [,30] [1,] NA NA NA NA NA NA [2,] NA NA NA NA NA NA [3,] 0.2005236781 0.23089944 0.25054566 0.21270272 0.4078686 0.3391352 [4,] 0.0005236781 0.03089944 0.05054566 0.01270272 0.1944944 0.1332819 [5,] 0.1151801293 0.01223259 -0.19256752 -0.10591319 0.2771040 0.1538013 [6,] -1.0398469190 -0.44767560 -0.70065148 -0.51433046 -0.2693657 -0.7331013 [,31] [,32] [,33] [,34] [,35] [,36] [1,] NA NA NA NA NA NA [2,] NA NA 0.32315552 0.16722375 0.17322608 0.3502843 [3,] 0.2006987552 0.18217574 0.30988590 0.16722375 0.17322608 0.3389721 [4,] 0.0009242043 -0.03061042 0.09661628 -0.03277625 -0.02677392 0.1276598 [5,] 0.4666353020 -0.03672640 0.08888698 0.04315043 0.05160205 0.1862145 [6,] -0.1097901369 -0.51909447 -0.47161247 -0.95388760 -1.01496373 -0.3401643 [,37] [,38] [,39] [,40] [,41] [,42] [1,] NA NA NA NA NA NA [2,] NA NA NA NA NA NA [3,] 0.4071060 0.25895533 0.17047583 -0.009108411 0.20169022 0.07385075 [4,] 0.1896733 0.04610459 -0.02952417 -0.209108411 0.00169022 -0.12614925 [5,] 0.2030237 0.02806962 0.06671278 -0.170869737 0.10603181 -0.10599011 [6,] -0.4155544 -0.58398615 -0.95631873 -0.742906353 -1.03798105 -0.67427985 [,43] [,44] [,45] [,46] [,47] [1,] NA NA NA NA NA [2,] NA NA 0.03777024 NA NA [3,] 0.4115839 0.23516425 0.03777024 0.11971863 NA [4,] 0.1981495 0.02754256 -0.16222976 -0.08028137 0.01530469 [5,] 0.2809246 0.03030149 -0.16193697 -0.04776205 0.03512666 [6,] -0.2660327 -0.54802649 -0.71555889 -0.74048224 -0.62515039 > sapply(mod, function(x) head(residuals(x, initVal = FALSE))) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.16293558 -0.006233904 0.03926763 0.24204324 0.201819012 -0.002425877 [2,] 0.15560672 -0.006233904 0.03926763 0.23316324 -0.007198971 -0.202425877 [3,] -0.05172214 -0.206233904 -0.16073237 0.02428325 0.015599528 -0.160225308 [4,] -0.05323983 -0.189036510 -0.06400467 0.09449299 -0.578347077 -0.733472490 [5,] -0.60766310 -0.730437812 -0.56564083 -0.42484214 0.582665957 0.470955485 [6,] 0.50244157 0.421154371 0.82454227 0.90354706 -0.106128551 -0.230889194 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.03804147 0.25041457 0.32306425 0.10221238 0.16598604 0.2240000 [2,] -0.16195853 0.04102136 0.30979234 0.10485333 0.16598604 0.2240000 [3,] -0.07136046 0.11096757 0.09652043 -0.09250572 -0.03401396 0.0240000 [4,] -0.56982962 -0.40974599 0.08873137 0.48914299 0.04795486 -0.1920000 [5,] 0.80508049 0.91838402 -0.47179911 -0.12936047 -0.95581395 -0.8500000 [6,] 0.06138364 0.18866299 -0.26900937 -0.23904761 0.41069767 0.2965517 [,13] [,14] [,15] [,16] [,17] [,18] [1,] 0.17265879 0.19374422 0.34924204 0.10590492 0.40697919 0.259197261 [2,] 0.17265879 0.19374422 0.33793868 0.10877089 0.18954728 0.046351235 [3,] -0.02734121 -0.00625578 0.12663532 -0.08836314 0.20287370 0.028326772 [4,] 0.05827056 -0.21010233 0.18528651 0.46725837 -0.41573232 -0.583568745 [5,] -1.01695967 -0.70509767 -0.34103957 -0.11018802 -0.15614081 0.464819783 [6,] 0.50217166 0.54782317 -0.06956562 0.37163175 -0.01429092 -0.008718896 [,19] [,20] [,21] [,22] [,23] [,24] [1,] 0.18190908 0.35946676 0.169491651 -0.01142882 0.25881275 0.209271535 [2,] -0.02044489 0.14395723 -0.030508349 -0.21142882 0.05881275 0.009271535 [3,] 0.49380883 0.08677967 0.070458456 -0.18773376 -0.16406269 -0.116905114 [4,] -0.13314843 -0.59388596 -0.958415015 -0.75951298 -0.71052866 -0.600883675 [5,] -0.29469131 0.31843941 0.490420201 0.39475882 0.29650561 0.432048833 [6,] -0.05968508 -0.19760398 0.006081218 -0.58124468 -0.18372614 -0.284427795 [,25] [,26] [,27] [,28] [,29] [,30] [1,] 0.2005236781 0.23089944 0.25054566 0.21270272 0.40786858 0.3391352 [2,] 0.0005236781 0.03089944 0.05054566 0.01270272 0.19449438 0.1332819 [3,] 0.1151801293 0.01223259 -0.19256752 -0.10591319 0.27710401 0.1538013 [4,] -1.0398469190 -0.44767560 -0.70065148 -0.51433046 -0.26936567 -0.7331013 [5,] 0.5897164121 0.30058869 0.28629004 0.30058869 0.03842345 0.5093910 [6,] 0.0667014939 -0.06778103 -0.23321162 -0.06778103 0.19909620 0.1345554 [,31] [,32] [,33] [,34] [,35] [,36] [1,] 0.2006987552 0.18217574 0.32315552 0.16722375 0.17322608 0.35028432 [2,] 0.0009242043 -0.03061042 0.30988590 0.16722375 0.17322608 0.33897207 [3,] 0.4666353020 -0.03672640 0.09661628 -0.03277625 -0.02677392 0.12765982 [4,] -0.1097901369 -0.51909447 0.08888698 0.04315043 0.05160205 0.18621452 [5,] 0.1074688595 0.62667139 -0.47161247 -0.95388760 -1.01496373 -0.34016425 [6,] 0.0398608026 -0.01134873 -0.26908229 0.41053005 0.50209322 -0.06966383 [,37] [,38] [,39] [,40] [,41] [,42] [1,] 0.40710604 0.25895533 0.170475826 -0.009108411 0.20169022 0.07385075 [2,] 0.18967325 0.04610459 -0.029524174 -0.209108411 0.00169022 -0.12614925 [3,] 0.20302366 0.02806962 0.066712780 -0.170869737 0.10603181 -0.10599011 [4,] -0.41555438 -0.58398615 -0.956318733 -0.742906353 -1.03798105 -0.67427985 [5,] -0.15718381 0.46430396 0.489866540 0.451231694 0.58839769 0.49929088 [6,] -0.01408211 -0.01242928 0.007017598 -0.001167867 0.06671800 -0.47366867 [,43] [,44] [,45] [,46] [,47] [1,] 0.41158387 0.23516425 0.03777024 0.11971863 0.01530469 [2,] 0.19814951 0.02754256 0.03777024 -0.08028137 0.03512666 [3,] 0.28092463 0.03030149 -0.16222976 -0.04776205 -0.62515039 [4,] -0.26603265 -0.54802649 -0.16193697 -0.74048224 0.35809963 [5,] 0.03735629 0.60093329 -0.71555889 0.34579920 -0.13038136 [6,] 0.20019233 -0.27161310 0.34906191 -0.35508927 -0.14562518 > > > lapply(mod_const_only, predict, n.ahead=10) [[1]] Time Series: Start = 49 End = 58 Frequency = 1 [1] 2.699227 2.581577 2.512636 2.472237 2.448564 2.434692 2.426563 2.421799 [9] 2.419008 2.417372 [[2]] Time Series: Start = 49 End = 58 Frequency = 1 [1] 2.624885 2.451451 2.389142 2.383297 2.392958 2.401122 2.404785 2.405579 [9] 2.405332 2.404980 [[3]] Time Series: Start = 49 End = 58 Frequency = 1 [1] 2.688936 2.496901 2.322178 2.163208 2.018571 2.378929 2.214843 2.065550 [9] 2.423287 2.255201 [[4]] Time Series: Start = 49 End = 58 Frequency = 1 [1] 1.886000 2.474120 2.133010 2.330854 2.216105 2.282659 2.244058 2.266447 [9] 2.253461 2.260993 [[5]] Time Series: Start = 49 End = 58 Frequency = 1 [1] 2.623663 2.364200 2.153806 1.989643 2.346850 2.251829 2.091300 2.434109 [9] 2.320998 2.144913 [[6]] Time Series: Start = 49 End = 58 Frequency = 1 [1] 2.619786 2.463294 2.413621 2.409211 2.414836 2.419056 2.420720 2.421040 [9] 2.420958 2.420853 [[7]] Time Series: Start = 49 End = 58 Frequency = 1 [1] 2.759622 2.657174 2.592584 2.553970 2.531390 2.518313 2.510772 2.506433 [9] 2.503938 2.502505 [[8]] Time Series: Start = 49 End = 58 Frequency = 1 [1] 2.512616 2.498763 2.250501 2.274052 2.110704 2.147287 2.037050 2.075094 [9] 1.998951 2.033476 [[9]] Time Series: Start = 49 End = 58 Frequency = 1 [1] 2.688648 2.495949 2.320257 2.160071 2.220225 2.069728 2.426964 2.257361 [9] 2.102747 2.455937 [[10]] Time Series: Start = 49 End = 58 Frequency = 1 [1] 2.623340 2.363133 2.151698 2.261527 2.135446 2.416972 2.294843 2.120596 [9] 2.439264 2.319986 [[11]] Time Series: Start = 49 End = 58 Frequency = 1 [1] 2.631237 2.466048 2.407177 2.400477 2.407962 2.414513 2.417501 2.418219 [9] 2.418100 2.417870 > > lapply(mod_const_only, predict, n.ahead=3, type="MC", seed=1234) [[1]] [[1]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.699227 2.632057 2.535147 [[1]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4405458 0.5947133 [[1]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.699227 2.699227 50 1.882137 3.577706 51 1.566999 3.602226 [[2]] [[2]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.624885 2.500711 2.417268 [[2]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4299034 0.6137172 [[2]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.624885 2.624885 50 1.768907 3.423516 51 1.412091 3.509741 [[3]] [[3]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.688936 2.544397 2.427185 [[3]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.414506 0.5842433 [[3]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.688936 2.688936 50 1.838803 3.434150 51 1.382525 3.468059 [[4]] [[4]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 1.886000 2.521998 2.098536 [[4]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4178371 0.4794762 [[4]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 1.886000 1.886000 50 1.810734 3.418901 51 1.222540 2.872624 [[5]] [[5]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.623663 2.410565 2.283101 [[5]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4046295 0.5906226 [[5]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.623663 2.623663 50 1.721783 3.279117 51 1.220608 3.302889 [[6]] [[6]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.619786 2.509727 2.435836 [[6]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4052226 0.5549299 [[6]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.619786 2.619786 50 1.819935 3.379552 51 1.530686 3.426148 [[7]] [[7]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.759622 2.703551 2.624925 [[7]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4047422 0.6121789 [[7]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.759622 2.759622 50 2.014577 3.572345 51 1.619070 3.688199 [[8]] [[8]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.512616 2.543906 2.238271 [[8]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.3939699 0.4296933 [[8]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.512616 2.512616 50 1.873270 3.389578 51 1.515958 3.016589 [[9]] [[9]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.688648 2.543461 2.448394 [[9]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.414646 0.5734492 [[9]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.688648 2.688648 50 1.837628 3.433514 51 1.379960 3.467149 [[10]] [[10]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.623340 2.409516 2.309587 [[10]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4047862 0.5657879 [[10]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.623340 2.623340 50 1.720467 3.278405 51 1.247822 3.301740 [[11]] [[11]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.631237 2.510906 2.431900 [[11]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.3914802 0.553873 [[11]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.631237 2.631237 50 1.844508 3.351233 51 1.525315 3.421465 > lapply(mod_const_only, predict, n.ahead=3, type="bootstrap", seed=1234) [[1]] [[1]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.699227 2.582197 2.491020 [[1]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4831608 0.5027584 [[1]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.699227 2.699227 50 1.975343 3.739643 51 1.717334 3.615281 [[2]] [[2]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.624885 2.465465 2.340347 [[2]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4732725 0.5643452 [[2]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.624885 2.624885 50 1.893373 3.670861 51 1.455743 3.610034 [[3]] [[3]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.688936 2.483265 2.432078 [[3]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4584072 0.4941755 [[3]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.688936 2.688936 50 1.918761 3.484796 51 1.475615 3.475700 [[4]] [[4]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 1.886000 2.472542 2.119201 [[4]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4597205 0.4623248 [[4]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 1.886000 1.886000 50 1.870672 3.570736 51 1.351098 3.080134 [[5]] [[5]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.623663 2.381322 2.227751 [[5]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4262948 0.5594472 [[5]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.623663 2.623663 50 1.759541 3.444184 51 1.195565 3.304635 [[6]] [[6]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.619786 2.471301 2.375166 [[6]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4484792 0.4805357 [[6]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.619786 2.619786 50 1.883685 3.632222 51 1.565057 3.500204 [[7]] [[7]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.759622 2.680781 2.552442 [[7]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4245623 0.5774809 [[7]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.759622 2.759622 50 1.992117 3.773470 51 1.627136 3.732379 [[8]] [[8]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.512616 2.531013 2.213672 [[8]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4215896 0.4081695 [[8]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.512616 2.512616 50 1.921616 3.558615 51 1.630914 3.270256 [[9]] [[9]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.688648 2.482492 2.447136 [[9]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.458624 0.4836025 [[9]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.688648 2.688648 50 1.917765 3.484768 51 1.518187 3.477827 [[10]] [[10]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.623340 2.380427 2.235120 [[10]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4264558 0.5591045 [[10]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.623340 2.623340 50 1.758617 3.442734 51 1.196882 3.304137 [[11]] [[11]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.631237 2.473523 2.341821 [[11]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4400343 0.5202436 [[11]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.631237 2.631237 50 1.909633 3.669851 51 1.553871 3.525138 > lapply(mod_const_only, predict, n.ahead=3, type="block-bootstrap", seed=1234) [[1]] [[1]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.699227 2.643203 2.651336 [[1]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.5031153 0.5624952 [[1]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.699227 2.699227 50 1.851139 3.726936 51 1.808777 3.746130 [[2]] [[2]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.624885 2.490311 2.254758 [[2]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.478542 0.5107298 [[2]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.624885 2.624885 50 1.913685 3.706673 51 1.489050 3.412472 [[3]] [[3]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.688936 2.541781 2.534744 [[3]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.5483532 0.5275412 [[3]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.688936 2.688936 50 1.541087 3.524343 51 1.521310 3.495101 [[4]] [[4]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 1.886000 2.549788 2.190231 [[4]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.5230574 0.5368726 [[4]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 1.886000 1.886000 50 1.624120 3.612913 51 1.351974 3.335432 [[5]] [[5]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.623663 2.379794 2.191166 [[5]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4218404 0.4330247 [[5]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.623663 2.623663 50 1.745137 3.417631 51 1.418244 3.085196 [[6]] [[6]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.619786 2.497780 2.287442 [[6]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4066408 0.4302233 [[6]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.619786 2.619786 50 1.973205 3.671035 51 1.741850 3.140380 [[7]] [[7]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.759622 2.703508 2.463683 [[7]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4676553 0.5107835 [[7]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.759622 2.759622 50 1.992117 3.907056 51 1.514316 3.638794 [[8]] [[8]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.512616 2.602617 2.054608 [[8]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.3974978 0.331419 [[8]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.512616 2.512616 50 1.921616 3.539660 51 1.561994 2.872041 [[9]] [[9]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.688648 2.541385 2.596026 [[9]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.5482398 0.4954715 [[9]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.688648 2.688648 50 1.542061 3.523408 51 1.805157 3.494865 [[10]] [[10]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.623340 2.378904 2.189639 [[10]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4220065 0.4335335 [[10]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.623340 2.623340 50 1.744270 3.417798 51 1.418685 3.087398 [[11]] [[11]]$pred Time Series: Start = 49 End = 51 Frequency = 1 [1] 2.631237 2.457292 2.322464 [[11]]$se Time Series: Start = 49 End = 49 Frequency = 1 Series 1 Series 2 Series 3 49 0 0.4339069 0.4221474 [[11]]$ci Time Series: Start = 49 End = 51 Frequency = 1 2.5% 97.5% 49 2.631237 2.631237 50 1.922385 3.705454 51 1.723155 3.101810 > > ## charac root > lapply(mod_notrend_noaar, charac_root) [[1]] root value_all 1 1 1.706523 [[2]] root value_all 1 1 1.016634 [[3]] root value_all 1 1 2.123638 2 2 2.123638 [[4]] root value_all 1 1 1.015604 2 2 31.600320 [[5]] root value_L value_H 1 1 1.059113 1.099089 [[6]] root value_L value_M value_H 1 1 5.19403 1.724138 0.9808917 [[7]] root value_L value_H 1 1 0.8343399 1.077518 [[8]] root value_L value_M value_H 1 1 0.856078 0.9523388 1.087816 [[9]] root value_L value_H 1 1 1.315517 1.302773 2 2 2.718594 4.215132 [[10]] root value_L value_H 1 1 0.6345647 2.438779 2 2 0.6345647 2.438779 [[11]] root value_L value_M value_H 1 1 0.7832821 1.740588 1.139364 2 2 6.2171057 3.804084 3.484721 [[12]] root value_L value_M value_H 1 1 2.233192 1.350111 1.29724 2 2 2.233192 1.147364 1.29724 [[13]] root value_L value_H 1 1 0.7941044 1.112610 2 2 6.4067928 5.730827 [[14]] root value_L value_H 1 1 0.8885719 1.067078 2 2 2.7732628 1.885112 [[15]] root value_L value_M value_H 1 1 0.8179617 0.9413566 1.175396 2 2 5.9336103 7.8567987 3.328735 [[16]] root value_L value_M value_H 1 1 0.8885719 1.0451893 1.158978 2 2 2.7732628 0.9525225 2.691817 [[17]] root value_L value_H 1 1 1.059805 31.4196 [[18]] root value_L value_H 1 1 0.8343035 3.693007 [[19]] root value_L value_H 1 1 1.311726 3.926308 2 2 2.743558 2.665929 [[20]] root value_L value_H 1 1 0.3094277 0.2906050 2 2 0.3094277 0.3360914 [[21]] root value_L value_H 1 1 0.7946169 2.364861 2 2 6.4894067 11.839251 [[22]] root value_L value_H 1 1 0.2454663 0.3226616 2 2 3.9197055 4.4738254 > lapply(mod_notrend_noaar, ar_mean) [[1]] ar_mean 2.415057 [[2]] ar_mean 0 [[3]] ar_mean 2.40475 [[4]] ar_mean 0 [[5]] ar_mean_H ar_mean_L 0.5589001 8.4750000 [[6]] ar_mean_H ar_mean_L ar_mean_M 14.776471 2.123488 2.258228 [[7]] ar_mean 0 [[8]] ar_mean 0 [[9]] ar_mean_H ar_mean_L 1.443880 4.648326 [[10]] ar_mean_H ar_mean_L 2.420793 1.702619 [[11]] ar_mean_H ar_mean_L ar_mean_M -0.5674776 0.3159839 2.5005680 [[12]] ar_mean_H ar_mean_L ar_mean_M 2.453308 2.572378 1.968810 [[13]] ar_mean 0 [[14]] ar_mean 0 [[15]] ar_mean 0 [[16]] ar_mean 0 [[17]] ar_mean_H ar_mean_L -0.4162725 8.4018252 [[18]] ar_mean 0 [[19]] ar_mean_H ar_mean_L -0.440743 4.657440 [[20]] ar_mean_H ar_mean_L 1.669877 1.555333 [[21]] ar_mean 0 [[22]] ar_mean 0 > > ### Utility functions > sapply(mod, getTh) [[1]] NULL [[2]] NULL [[3]] NULL [[4]] NULL [[5]] NULL [[6]] NULL [[7]] NULL [[8]] NULL [[9]] th 1.8 [[10]] th1 th2 1.9 2.2 [[11]] th 2.1 [[12]] th1 th2 1.9 2.5 [[13]] th 2.1 [[14]] th1 th2 2.0 2.3 [[15]] th 1.8 [[16]] th1 th2 1.9 2.2 [[17]] th 1.8 [[18]] th 1.8 [[19]] th1 th2 1.9 2.2 [[20]] th1 th2 1.9 2.7 [[21]] th 2.1 [[22]] th 1.8 [[23]] th1 th2 1.8 2.3 [[24]] th1 th2 2.1 2.7 [[25]] th 2.1 [[26]] th 2.1 [[27]] th1 th2 1.8 2.3 [[28]] th1 th2 2.1 2.9 [[29]] th 1.8 [[30]] th 2.2 [[31]] th1 th2 1.9 2.2 [[32]] th1 th2 1.9 2.6 [[33]] th 1.851941 [[34]] th 2.15659 [[35]] th 2.155949 [[36]] th 1.860017 [[37]] th 1.850371 [[38]] th 1.837829 [[39]] th 2.154408 [[40]] th 1.682425 [[41]] th 2.158764 [[42]] th 0.3556488 [[43]] th 1.867209 [[44]] th 1.196011 [[45]] NULL [[46]] NULL [[47]] NULL > > > ## Output of mod_no_aar[-44] is platform/machine specific... > ## Output of mod_no_aar[-23] is platform/machine specific: doesn't work on M1mac > suppressMessages(suppressWarnings(sapply(mod_no_aar[-c(23, 44)], tsDyn:::mod_refit_check))) linear_both_1 linear_const_1 linear_none_1 linear_trend_1 linear_both_2 TRUE TRUE TRUE TRUE TRUE linear_const_2 linear_none_2 linear_trend_2 setar_both_1 setar_both_1 TRUE TRUE TRUE TRUE TRUE setar_const_1 setar_const_1 setar_none_1 setar_none_1 setar_trend_1 TRUE TRUE TRUE TRUE TRUE setar_trend_1 setar_both_2 setar_both_2 setar_both_2 setar_both_2 TRUE TRUE TRUE TRUE TRUE setar_const_2 setar_const_2 setar_const_2 setar_none_2 setar_none_2 TRUE TRUE TRUE TRUE TRUE setar_none_2 setar_none_2 setar_trend_2 setar_trend_2 setar_trend_2 TRUE TRUE TRUE TRUE TRUE setar_trend_2 lstar_both_1 lstar_const_1 lstar_none_1 lstar_trend_1 TRUE TRUE TRUE TRUE TRUE lstar_both_2 lstar_both_2 lstar_const_2 lstar_const_2 lstar_none_2 TRUE TRUE TRUE TRUE TRUE lstar_none_2 lstar_trend_2 TRUE TRUE > > > ### Pred Roll, acc_stat: > x <- log10(lynx) > mod <- list() > mod[["linear"]] <- linear(x, m=2) > mod[["setar"]] <- setar(x, m=2, thDelay=1, trace = FALSE) Warning message: Possible unit root in the high regime. Roots are: 0.9943 0.9943 > mod[["star"]] <- star(x, m=2, thDelay=1, trace = FALSE) > mod[["lstar"]] <- lstar(x, m=2, thDelay=1, trace = FALSE) > mod[["aar"]] <- aar(x, m=2) > > > 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, th=getTh(mod[["setar"]]), trace = FALSE) Warning message: Possible unit root in the high regime. Roots are: 1 1 > mod_small[["lstar"]] <- lstar(x_small, m=2, thDelay=1, th=getTh(mod[["lstar"]]), gamma=coef(mod[["lstar"]])["gamma"], 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, function(x) x$pred[[1]]) linear setar lstar aar [1,] 2.449169 2.342137 2.324301 2.326990 [2,] 2.801369 2.697924 2.683048 2.700009 [3,] 2.889222 2.862200 2.863382 2.885772 [4,] 3.332712 3.330000 3.338820 3.383900 [5,] 3.451233 3.554839 3.570747 3.536110 [6,] 3.432912 3.417157 3.431750 3.432964 [7,] 3.189822 3.113776 3.082955 3.116714 [8,] 2.866751 2.752102 2.736573 2.803772 [9,] 2.438809 2.662520 2.605173 2.478764 [10,] 2.733730 2.813357 2.834554 2.815797 [11,] 2.948166 2.999893 3.017057 3.018300 [12,] 3.093844 3.167923 3.189365 3.178690 [13,] 3.237219 3.345161 3.365831 3.318405 [14,] 3.393691 3.540102 3.509327 3.445134 > sapply(pred_rolls_1, accuracy_stat)[-1,] ## removing first line as gave 'factor' under R<4 linear setar lstar aar ME 0.05258699 0.02826967 0.03157037 0.03953898 RMSE 0.1328027 0.06883358 0.07072864 0.09035348 MAE 0.1148975 0.0477577 0.05207567 0.067775 MPE 1.478991 0.8449191 0.9954425 1.241795 MAPE 3.886218 1.57141 1.736354 2.294182 > > > pred_rolls_12 <- lapply(mod_small, predict_rolling, n.ahead=1:2, newdata=x[101:114]) > sapply(pred_rolls_12, function(x) x$pred[[1]]) linear setar lstar aar [1,] 2.449169 2.342137 2.324301 2.326990 [2,] 2.801369 2.697924 2.683048 2.700009 [3,] 2.889222 2.862200 2.863382 2.885772 [4,] 3.332712 3.330000 3.338820 3.383900 [5,] 3.451233 3.554839 3.570747 3.536110 [6,] 3.432912 3.417157 3.431750 3.432964 [7,] 3.189822 3.113776 3.082955 3.116714 [8,] 2.866751 2.752102 2.736573 2.803772 [9,] 2.438809 2.662520 2.605173 2.478764 [10,] 2.733730 2.813357 2.834554 2.815797 [11,] 2.948166 2.999893 3.017057 3.018300 [12,] 3.093844 3.167923 3.189365 3.178690 [13,] 3.237219 3.345161 3.365831 3.318405 [14,] 3.393691 3.540102 3.509327 3.445134 [15,] 2.769011 2.521265 2.481914 2.487292 [16,] 2.924473 2.675607 2.638771 2.657630 [17,] 3.165373 2.984457 2.965647 3.016514 [18,] 3.105854 3.088332 3.101479 3.152158 [19,] 3.377850 3.484268 3.511201 3.533075 [20,] 3.292461 3.419838 3.458278 3.407461 [21,] 3.142011 3.033462 3.024515 3.065340 [22,] 2.871090 2.636055 2.572339 2.704950 [23,] 2.636274 2.698643 2.622371 2.586239 [24,] 2.393450 2.784074 2.734128 2.544266 [25,] 2.828102 2.990434 3.034126 3.011475 [26,] 3.022416 3.167788 3.210641 3.204061 [27,] 3.089008 3.302950 3.350724 3.286149 [28,] 3.135763 3.440191 3.431994 3.289626 > lapply(pred_rolls_12, accuracy_stat) $linear var ME RMSE MAE MPE MAPE n.ahead 1 x 0.05258699 0.1328027 0.1148975 1.478991 3.886218 1 2 x 0.08869508 0.2623455 0.2303860 2.150715 7.700665 2 3 x 0.07064104 0.1975741 0.1726418 1.814853 5.793442 all $setar var ME RMSE MAE MPE MAPE n.ahead 1 x_small 0.02826967 0.06883358 0.04775770 0.8449191 1.571410 1 2 x_small 0.05482161 0.11615818 0.09038796 1.4996555 2.955445 2 3 x_small 0.04154564 0.09249588 0.06907283 1.1722873 2.263427 all $lstar var ME RMSE MAE MPE MAPE n.ahead 1 x_small 0.03157037 0.07072864 0.05207567 0.9954425 1.736354 1 2 x_small 0.06119571 0.11465237 0.09023093 1.8366383 2.987023 2 3 x_small 0.04638304 0.09269050 0.07115330 1.4160404 2.361689 all $aar var ME RMSE MAE MPE MAPE n.ahead 1 x 0.03953898 0.09035348 0.06777500 1.241795 2.294182 1 2 x 0.07490225 0.13588307 0.10322410 2.232238 3.381539 2 3 x 0.05722061 0.11311828 0.08549955 1.737016 2.837860 all > > > proc.time() user system elapsed 8.59 0.50 9.07