## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
library(ahead)

attention_types <- c("dot_product", "scaled_dot_product", 
  "cosine", "exponential", 
  "gaussian", "linear",
  "value_based", "hybrid", 
  "parametric")

results <- data.frame(matrix(0, ncol=length(attention_types), nrow=8))

colnames(results) <- attention_types

rmse <- function(obj, y_test)
{
  sqrt(mean((obj$mean - y_test)**2))
}

y <- AirPassengers

y_split <- misc::splitts(y, split_prob = 0.9)

y_train <- y_split$training

y_test <- y_split$testing

h <- length(y_test)

for (attention_type in attention_types)
{
   misc::debug_print(attention_type)
  
   (obj <- suppressWarnings(ahead::glmthetaf(y_train, h=h, fit_func=MASS::glm.nb, attention = TRUE, attention_type = attention_type)))
  print(obj)
  results[1, attention_type] <- rmse(obj, y_test)
  plot(obj)
  
  (obj <- suppressWarnings(ahead::glmthetaf(y_train, h=h, fit_func=stats::glm, attention = TRUE, attention_type = attention_type)))
  results[2, attention_type] <- rmse(obj, y_test)
  print(obj)
  plot(obj)
  
  (obj <- suppressWarnings(ahead::glmthetaf(y_train, h=h, fit_func=MASS::rlm, attention = TRUE, attention_type = attention_type)))
  results[3, attention_type] <- rmse(obj, y_test)
  print(obj)
  plot(obj)
  
  (obj <- suppressWarnings(ahead::glmthetaf(y_train, h=h, fit_func=MASS::lqs, attention = TRUE, attention_type = attention_type)))
  results[4, attention_type] <- rmse(obj, y_test)
  print(obj)
  plot(obj) 
  
  
  (obj <- suppressWarnings(ahead::glmthetaf(y_train, h=h, fit_func=MASS::glm.nb, attention = FALSE, attention_type = attention_type)))
  print(obj)
  results[5, attention_type] <- rmse(obj, y_test)
  plot(obj)
  
  (obj <- suppressWarnings(ahead::glmthetaf(y_train, h=h, fit_func=stats::glm, attention = FALSE, attention_type = attention_type)))
  results[6, attention_type] <- rmse(obj, y_test)
  print(obj)
  plot(obj)
  
  (obj <- suppressWarnings(ahead::glmthetaf(y_train, h=h, fit_func=MASS::rlm, attention = FALSE, attention_type = attention_type)))
  results[7, attention_type] <- rmse(obj, y_test)
  print(obj)
  plot(obj)
  
  (obj <- suppressWarnings(ahead::glmthetaf(y_train, h=h, fit_func=MASS::lqs, attention = FALSE, attention_type = attention_type)))
  results[8, attention_type] <- rmse(obj, y_test)
  print(obj)
  plot(obj) 

}
## 
## [1] "attention_type's value:"
## [1] "dot_product"
## 
##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1971 385.8734 422.5207
## Nov 1959       350.9076 326.1395 375.6757
## Dec 1959       394.2226 364.3703 424.0750
## Jan 1960       399.0770 364.8883 433.2657
## Feb 1960       389.1656 351.1319 427.1994
## Mar 1960       446.5541 405.0297 488.0784
## Apr 1960       428.8844 384.1409 473.6278
## May 1960       428.7145 380.9685 476.4604
## Jun 1960       487.5523 436.9817 538.1228
## Jul 1960       536.0592 482.8137 589.3047
## Aug 1960       532.3238 476.5314 588.1161
## Sep 1960       465.3666 407.1386 523.5945
## Oct 1960       404.3403 343.7747 464.9059
## Nov 1960       351.0295 288.2131 413.8458
## Dec 1960       394.3582 329.3690 459.3475

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.3808 389.0571 425.7045
## Nov 1959       356.7342 331.9661 381.5023
## Dec 1959       403.8456 373.9932 433.6979
## Jan 1960       411.9036 377.7150 446.0923
## Feb 1960       404.6573 366.6235 442.6911
## Mar 1960       467.7272 426.2029 509.2516
## Apr 1960       452.4585 407.7151 497.2020
## May 1960       455.4952 407.7492 503.2411
## Jun 1960       521.6432 471.0727 572.2138
## Jul 1960       577.5161 524.2706 630.7616
## Aug 1960       577.4186 521.6263 633.2110
## Sep 1960       508.2070 449.9791 566.4349
## Oct 1960       444.5208 383.9552 505.0864
## Nov 1960       388.4716 325.6552 451.2880
## Dec 1960       439.2889 374.2996 504.2781

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.3690 389.0453 425.6926
## Nov 1959       356.7125 331.9444 381.4806
## Dec 1959       403.8096 373.9572 433.6619
## Jan 1960       411.8556 377.6669 446.0442
## Feb 1960       404.5991 366.5653 442.6329
## Mar 1960       467.6475 426.1231 509.1718
## Apr 1960       452.3696 407.6261 497.1130
## May 1960       455.3939 407.6479 503.1399
## Jun 1960       521.5141 470.9436 572.0847
## Jul 1960       577.3588 524.1133 630.6043
## Aug 1960       577.2472 521.4549 633.0396
## Sep 1960       508.0438 449.8159 566.2718
## Oct 1960       444.3675 383.8019 504.9331
## Nov 1960       388.3285 325.5121 451.1449
## Dec 1960       439.1168 374.1276 504.1060

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.3073 388.9836 425.6309
## Nov 1959       356.5992 331.8311 381.3673
## Dec 1959       403.6218 373.7695 433.4742
## Jan 1960       411.6046 377.4159 445.7933
## Feb 1960       404.2953 366.2615 442.3291
## Mar 1960       467.2313 425.7070 508.7557
## Apr 1960       451.9053 407.1619 496.6487
## May 1960       454.8655 407.1195 502.6115
## Jun 1960       520.8402 470.2697 571.4108
## Jul 1960       576.5379 523.2924 629.7834
## Aug 1960       576.3528 520.5604 632.1451
## Sep 1960       507.1926 448.9647 565.4206
## Oct 1960       443.5678 383.0022 504.1334
## Nov 1960       387.5819 324.7656 450.3983
## Dec 1960       438.2193 373.2301 503.2085

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1894 385.8658 422.5131
## Nov 1959       350.8928 326.1247 375.6610
## Dec 1959       394.1985 364.3461 424.0508
## Jan 1960       399.0451 364.8564 433.2337
## Feb 1960       389.1273 351.0935 427.1611
## Mar 1960       446.5020 404.9777 488.0264
## Apr 1960       428.8267 384.0833 473.5702
## May 1960       428.6494 380.9034 476.3953
## Jun 1960       487.4699 436.8993 538.0405
## Jul 1960       535.9596 482.7141 589.2051
## Aug 1960       532.2159 476.4236 588.0083
## Sep 1960       465.2646 407.0367 523.4926
## Oct 1960       404.2452 343.6796 464.8108
## Nov 1960       350.9412 288.1249 413.7576
## Dec 1960       394.2528 329.2636 459.2421

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4667 387.1431 423.7904
## Nov 1959       353.0102 328.2421 377.7783
## Dec 1959       397.7100 367.8577 427.5624
## Jan 1960       403.7465 369.5579 437.9352
## Feb 1960       394.8302 356.7964 432.8640
## Mar 1960       454.3289 412.8045 495.8532
## Apr 1960       437.5761 392.8326 482.3195
## May 1960       438.6268 390.8809 486.3728
## Jun 1960       500.2172 449.6467 550.7878
## Jul 1960       551.5150 498.2694 604.7605
## Aug 1960       549.1919 493.3996 604.9843
## Sep 1960       481.4419 423.2140 539.6698
## Oct 1960       419.4623 358.8967 480.0279
## Nov 1960       365.1601 302.3438 427.9765
## Dec 1960       411.3593 346.3701 476.3485

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4620 387.1383 423.7857
## Nov 1959       353.0023 328.2342 377.7704
## Dec 1959       397.6970 367.8446 427.5493
## Jan 1960       403.7291 369.5404 437.9178
## Feb 1960       394.8090 356.7752 432.8428
## Mar 1960       454.2998 412.7755 495.8242
## Apr 1960       437.5436 392.8001 482.2870
## May 1960       438.5898 390.8438 486.3358
## Jun 1960       500.1699 449.5994 550.7405
## Jul 1960       551.4572 498.2117 604.7027
## Aug 1960       549.1289 493.3366 604.9213
## Sep 1960       481.3819 423.1540 539.6098
## Oct 1960       419.4058 358.8402 479.9714
## Nov 1960       365.1074 302.2910 427.9237
## Dec 1960       411.2958 346.3066 476.2850

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4371 387.1134 423.7607
## Nov 1959       352.9610 328.1929 377.7291
## Dec 1959       397.6284 367.7760 427.4807
## Jan 1960       403.6373 369.4486 437.8260
## Feb 1960       394.6976 356.6639 432.7314
## Mar 1960       454.1470 412.6226 495.6713
## Apr 1960       437.3727 392.6293 482.1161
## May 1960       438.3949 390.6490 486.1409
## Jun 1960       499.9210 449.3504 550.4915
## Jul 1960       551.1534 497.9079 604.3989
## Aug 1960       548.7974 493.0050 604.5898
## Sep 1960       481.0660 422.8380 539.2939
## Oct 1960       419.1087 358.5431 479.6743
## Nov 1960       364.8297 302.0133 427.6461
## Dec 1960       410.9618 345.9725 475.9510

## 
## [1] "attention_type's value:"
## [1] "scaled_dot_product"
## 
##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1971 385.8734 422.5207
## Nov 1959       350.9076 326.1395 375.6757
## Dec 1959       394.2226 364.3703 424.0750
## Jan 1960       399.0770 364.8883 433.2657
## Feb 1960       389.1656 351.1319 427.1994
## Mar 1960       446.5541 405.0297 488.0784
## Apr 1960       428.8844 384.1409 473.6278
## May 1960       428.7145 380.9685 476.4604
## Jun 1960       487.5523 436.9817 538.1228
## Jul 1960       536.0592 482.8137 589.3047
## Aug 1960       532.3238 476.5314 588.1161
## Sep 1960       465.3666 407.1386 523.5945
## Oct 1960       404.3403 343.7747 464.9059
## Nov 1960       351.0295 288.2131 413.8458
## Dec 1960       394.3582 329.3690 459.3475

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.3808 389.0571 425.7045
## Nov 1959       356.7342 331.9661 381.5023
## Dec 1959       403.8456 373.9932 433.6979
## Jan 1960       411.9036 377.7150 446.0923
## Feb 1960       404.6573 366.6235 442.6911
## Mar 1960       467.7272 426.2029 509.2516
## Apr 1960       452.4585 407.7151 497.2020
## May 1960       455.4952 407.7492 503.2411
## Jun 1960       521.6432 471.0727 572.2138
## Jul 1960       577.5161 524.2706 630.7616
## Aug 1960       577.4186 521.6263 633.2110
## Sep 1960       508.2070 449.9791 566.4349
## Oct 1960       444.5208 383.9552 505.0864
## Nov 1960       388.4716 325.6552 451.2880
## Dec 1960       439.2889 374.2996 504.2781

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.3690 389.0453 425.6926
## Nov 1959       356.7125 331.9444 381.4806
## Dec 1959       403.8096 373.9572 433.6619
## Jan 1960       411.8556 377.6669 446.0442
## Feb 1960       404.5991 366.5653 442.6329
## Mar 1960       467.6475 426.1231 509.1718
## Apr 1960       452.3696 407.6261 497.1130
## May 1960       455.3939 407.6479 503.1399
## Jun 1960       521.5141 470.9436 572.0847
## Jul 1960       577.3588 524.1133 630.6043
## Aug 1960       577.2472 521.4549 633.0396
## Sep 1960       508.0438 449.8159 566.2718
## Oct 1960       444.3675 383.8019 504.9331
## Nov 1960       388.3285 325.5121 451.1449
## Dec 1960       439.1168 374.1276 504.1060

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.3036 388.9799 425.6272
## Nov 1959       356.5924 331.8242 381.3605
## Dec 1959       403.6105 373.7581 433.4628
## Jan 1960       411.5895 377.4008 445.7781
## Feb 1960       404.2769 366.2432 442.3107
## Mar 1960       467.2062 425.6819 508.7306
## Apr 1960       451.8773 407.1338 496.6207
## May 1960       454.8336 407.0876 502.5796
## Jun 1960       520.7996 470.2290 571.3701
## Jul 1960       576.4884 523.2429 629.7339
## Aug 1960       576.2988 520.5064 632.0911
## Sep 1960       507.1413 448.9134 565.3692
## Oct 1960       443.5195 382.9539 504.0851
## Nov 1960       387.5369 324.7205 450.3532
## Dec 1960       438.1651 373.1759 503.1543

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1894 385.8658 422.5131
## Nov 1959       350.8928 326.1247 375.6610
## Dec 1959       394.1985 364.3461 424.0508
## Jan 1960       399.0451 364.8564 433.2337
## Feb 1960       389.1273 351.0935 427.1611
## Mar 1960       446.5020 404.9777 488.0264
## Apr 1960       428.8267 384.0833 473.5702
## May 1960       428.6494 380.9034 476.3953
## Jun 1960       487.4699 436.8993 538.0405
## Jul 1960       535.9596 482.7141 589.2051
## Aug 1960       532.2159 476.4236 588.0083
## Sep 1960       465.2646 407.0367 523.4926
## Oct 1960       404.2452 343.6796 464.8108
## Nov 1960       350.9412 288.1249 413.7576
## Dec 1960       394.2528 329.2636 459.2421

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4667 387.1431 423.7904
## Nov 1959       353.0102 328.2421 377.7783
## Dec 1959       397.7100 367.8577 427.5624
## Jan 1960       403.7465 369.5579 437.9352
## Feb 1960       394.8302 356.7964 432.8640
## Mar 1960       454.3289 412.8045 495.8532
## Apr 1960       437.5761 392.8326 482.3195
## May 1960       438.6268 390.8809 486.3728
## Jun 1960       500.2172 449.6467 550.7878
## Jul 1960       551.5150 498.2694 604.7605
## Aug 1960       549.1919 493.3996 604.9843
## Sep 1960       481.4419 423.2140 539.6698
## Oct 1960       419.4623 358.8967 480.0279
## Nov 1960       365.1601 302.3438 427.9765
## Dec 1960       411.3593 346.3701 476.3485

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4620 387.1383 423.7857
## Nov 1959       353.0023 328.2342 377.7704
## Dec 1959       397.6970 367.8446 427.5493
## Jan 1960       403.7291 369.5404 437.9178
## Feb 1960       394.8090 356.7752 432.8428
## Mar 1960       454.2998 412.7755 495.8242
## Apr 1960       437.5436 392.8001 482.2870
## May 1960       438.5898 390.8438 486.3358
## Jun 1960       500.1699 449.5994 550.7405
## Jul 1960       551.4572 498.2117 604.7027
## Aug 1960       549.1289 493.3366 604.9213
## Sep 1960       481.3819 423.1540 539.6098
## Oct 1960       419.4058 358.8402 479.9714
## Nov 1960       365.1074 302.2910 427.9237
## Dec 1960       411.2958 346.3066 476.2850

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4373 387.1137 423.7610
## Nov 1959       352.9614 328.1933 377.7295
## Dec 1959       397.6291 367.7768 427.4815
## Jan 1960       403.6383 369.4496 437.8269
## Feb 1960       394.6988 356.6651 432.7326
## Mar 1960       454.1486 412.6243 495.6730
## Apr 1960       437.3745 392.6311 482.1180
## May 1960       438.3970 390.6511 486.1430
## Jun 1960       499.9236 449.3531 550.4942
## Jul 1960       551.1567 497.9112 604.4022
## Aug 1960       548.8009 493.0086 604.5933
## Sep 1960       481.0693 422.8414 539.2973
## Oct 1960       419.1118 358.5462 479.6775
## Nov 1960       364.8327 302.0163 427.6490
## Dec 1960       410.9653 345.9761 475.9545

## 
## [1] "attention_type's value:"
## [1] "cosine"
## 
##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1945 385.8709 422.5182
## Nov 1959       350.9013 326.1332 375.6694
## Dec 1959       394.2125 364.3602 424.0649
## Jan 1960       399.0639 364.8752 433.2525
## Feb 1960       389.1501 351.1163 427.1839
## Mar 1960       446.5333 405.0090 488.0577
## Apr 1960       428.8617 384.1183 473.6052
## May 1960       428.6893 380.9433 476.4352
## Jun 1960       487.5209 436.9503 538.0914
## Jul 1960       536.0218 482.7763 589.2673
## Aug 1960       532.2838 476.4915 588.0762
## Sep 1960       465.3293 407.1014 523.5573
## Oct 1960       404.3061 343.7404 464.8717
## Nov 1960       350.9981 288.1817 413.8145
## Dec 1960       394.3213 329.3320 459.3105

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       406.7418 388.4182 425.0655
## Nov 1959       355.1344 330.3663 379.9026
## Dec 1959       401.2348 371.3824 431.0871
## Jan 1960       408.4664 374.2777 442.6551
## Feb 1960       400.5554 362.5217 438.5892
## Mar 1960       462.1866 420.6622 503.7109
## Apr 1960       446.3599 401.6165 491.1034
## May 1960       448.6438 400.8978 496.3898
## Jun 1960       513.0152 462.4447 563.5858
## Jul 1960       567.1324 513.8869 620.3779
## Aug 1960       566.2358 510.4435 622.0282
## Sep 1960       497.6841 439.4562 555.9121
## Oct 1960       434.7407 374.1751 495.3063
## Nov 1960       379.4364 316.6201 442.2528
## Dec 1960       428.5350 363.5458 493.5242

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       406.7324 388.4087 425.0560
## Nov 1959       355.1187 330.3506 379.8868
## Dec 1959       401.2087 371.3564 431.0611
## Jan 1960       408.4315 374.2428 442.6202
## Feb 1960       400.5131 362.4793 438.5469
## Mar 1960       462.1285 420.6041 503.6528
## Apr 1960       446.2950 401.5515 491.0384
## May 1960       448.5697 400.8238 496.3157
## Jun 1960       512.9206 462.3501 563.4912
## Jul 1960       567.0169 513.7714 620.2624
## Aug 1960       566.1098 510.3174 621.9021
## Sep 1960       497.5640 439.3361 555.7920
## Oct 1960       434.6277 374.0621 495.1933
## Nov 1960       379.3309 316.5145 442.1473
## Dec 1960       428.4080 363.4188 493.3972

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       406.6833 388.3596 425.0069
## Nov 1959       355.0371 330.2690 379.8052
## Dec 1959       401.0733 371.2210 430.9257
## Jan 1960       408.2502 374.0615 442.4389
## Feb 1960       400.2932 362.2594 438.3270
## Mar 1960       461.8266 420.3023 503.3510
## Apr 1960       445.9576 401.2141 490.7010
## May 1960       448.1850 400.4390 495.9310
## Jun 1960       512.4290 461.8585 562.9996
## Jul 1960       566.4170 513.1715 619.6625
## Aug 1960       565.4551 509.6628 621.2475
## Sep 1960       496.9402 438.7123 555.1681
## Oct 1960       434.0409 373.4753 494.6065
## Nov 1960       378.7825 315.9662 441.5989
## Dec 1960       427.7483 362.7591 492.7375

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1894 385.8658 422.5131
## Nov 1959       350.8928 326.1247 375.6610
## Dec 1959       394.1985 364.3461 424.0508
## Jan 1960       399.0451 364.8564 433.2337
## Feb 1960       389.1273 351.0935 427.1611
## Mar 1960       446.5020 404.9777 488.0264
## Apr 1960       428.8267 384.0833 473.5702
## May 1960       428.6494 380.9034 476.3953
## Jun 1960       487.4699 436.8993 538.0405
## Jul 1960       535.9596 482.7141 589.2051
## Aug 1960       532.2159 476.4236 588.0083
## Sep 1960       465.2646 407.0367 523.4926
## Oct 1960       404.2452 343.6796 464.8108
## Nov 1960       350.9412 288.1249 413.7576
## Dec 1960       394.2528 329.2636 459.2421

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4667 387.1431 423.7904
## Nov 1959       353.0102 328.2421 377.7783
## Dec 1959       397.7100 367.8577 427.5624
## Jan 1960       403.7465 369.5579 437.9352
## Feb 1960       394.8302 356.7964 432.8640
## Mar 1960       454.3289 412.8045 495.8532
## Apr 1960       437.5761 392.8326 482.3195
## May 1960       438.6268 390.8809 486.3728
## Jun 1960       500.2172 449.6467 550.7878
## Jul 1960       551.5150 498.2694 604.7605
## Aug 1960       549.1919 493.3996 604.9843
## Sep 1960       481.4419 423.2140 539.6698
## Oct 1960       419.4623 358.8967 480.0279
## Nov 1960       365.1601 302.3438 427.9765
## Dec 1960       411.3593 346.3701 476.3485

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4620 387.1383 423.7857
## Nov 1959       353.0023 328.2342 377.7704
## Dec 1959       397.6970 367.8446 427.5493
## Jan 1960       403.7291 369.5404 437.9178
## Feb 1960       394.8090 356.7752 432.8428
## Mar 1960       454.2998 412.7755 495.8242
## Apr 1960       437.5436 392.8001 482.2870
## May 1960       438.5898 390.8438 486.3358
## Jun 1960       500.1699 449.5994 550.7405
## Jul 1960       551.4572 498.2117 604.7027
## Aug 1960       549.1289 493.3366 604.9213
## Sep 1960       481.3819 423.1540 539.6098
## Oct 1960       419.4058 358.8402 479.9714
## Nov 1960       365.1074 302.2910 427.9237
## Dec 1960       411.2958 346.3066 476.2850

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4373 387.1136 423.7609
## Nov 1959       352.9613 328.1932 377.7294
## Dec 1959       397.6289 367.7766 427.4813
## Jan 1960       403.6380 369.4493 437.8267
## Feb 1960       394.6985 356.6647 432.7323
## Mar 1960       454.1482 412.6238 495.6725
## Apr 1960       437.3740 392.6306 482.1175
## May 1960       438.3964 390.6505 486.1424
## Jun 1960       499.9229 449.3523 550.4934
## Jul 1960       551.1558 497.9103 604.4013
## Aug 1960       548.7999 493.0076 604.5923
## Sep 1960       481.0684 422.8405 539.2963
## Oct 1960       419.1109 358.5453 479.6766
## Nov 1960       364.8318 302.0155 427.6482
## Dec 1960       410.9643 345.9751 475.9535

## 
## [1] "attention_type's value:"
## [1] "exponential"
## 
##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1978 385.8741 422.5214
## Nov 1959       350.9075 326.1394 375.6756
## Dec 1959       394.2225 364.3702 424.0749
## Jan 1960       399.0769 364.8883 433.2656
## Feb 1960       389.1656 351.1319 427.1994
## Mar 1960       446.5543 405.0299 488.0786
## Apr 1960       428.8847 384.1413 473.6281
## May 1960       428.7151 380.9691 476.4610
## Jun 1960       487.5533 436.9828 538.1239
## Jul 1960       536.0608 482.8153 589.3063
## Aug 1960       532.3258 476.5334 588.1182
## Sep 1960       465.3688 407.1409 523.5967
## Oct 1960       404.3427 343.7771 464.9083
## Nov 1960       351.0319 288.2155 413.8483
## Dec 1960       394.3614 329.3722 459.3506

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.5570 389.2334 425.8807
## Nov 1959       356.6906 331.9225 381.4587
## Dec 1959       403.7665 373.9142 433.6189
## Jan 1960       411.8071 377.6185 445.9958
## Feb 1960       404.5639 366.5301 442.5977
## Mar 1960       467.6440 426.1197 509.1684
## Apr 1960       452.4264 407.6829 497.1698
## May 1960       455.5364 407.7904 503.2823
## Jun 1960       521.8029 471.2323 572.3734
## Jul 1960       577.8473 524.6017 631.0928
## Aug 1960       577.9322 522.1398 633.7245
## Sep 1960       508.8424 450.6145 567.0703
## Oct 1960       445.2554 384.6898 505.8210
## Nov 1960       389.2842 326.4678 452.1006
## Dec 1960       440.4153 375.4261 505.4046

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.5446 389.2209 425.8682
## Nov 1959       356.6691 331.9010 381.4372
## Dec 1959       403.7310 373.8786 433.5833
## Jan 1960       411.7597 377.5710 445.9484
## Feb 1960       404.5063 366.4725 442.5401
## Mar 1960       467.5650 426.0406 509.0893
## Apr 1960       452.3379 407.5944 497.0813
## May 1960       455.4353 407.6893 503.1812
## Jun 1960       521.6733 471.1028 572.2439
## Jul 1960       577.6887 524.4432 630.9342
## Aug 1960       577.7585 521.9662 633.5509
## Sep 1960       508.6764 450.4484 566.9043
## Oct 1960       445.0986 384.5329 505.6642
## Nov 1960       389.1371 326.3207 451.9535
## Dec 1960       440.2376 375.2484 505.2268

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.4770 389.1533 425.8007
## Nov 1959       356.5527 331.7846 381.3208
## Dec 1959       403.5386 373.6863 433.3909
## Jan 1960       411.5025 377.3139 445.6912
## Feb 1960       404.1946 366.1608 442.2284
## Mar 1960       467.1369 425.6125 508.6612
## Apr 1960       451.8586 407.1152 496.6021
## May 1960       454.8876 407.1416 502.6336
## Jun 1960       520.9718 470.4013 571.5424
## Jul 1960       576.8300 523.5845 630.0755
## Aug 1960       576.8183 521.0260 632.6107
## Sep 1960       507.7771 449.5492 566.0051
## Oct 1960       444.2495 383.6839 504.8151
## Nov 1960       388.3406 325.5243 451.1570
## Dec 1960       439.2756 374.2863 504.2648

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1894 385.8658 422.5131
## Nov 1959       350.8928 326.1247 375.6610
## Dec 1959       394.1985 364.3461 424.0508
## Jan 1960       399.0451 364.8564 433.2337
## Feb 1960       389.1273 351.0935 427.1611
## Mar 1960       446.5020 404.9777 488.0264
## Apr 1960       428.8267 384.0833 473.5702
## May 1960       428.6494 380.9034 476.3953
## Jun 1960       487.4699 436.8993 538.0405
## Jul 1960       535.9596 482.7141 589.2051
## Aug 1960       532.2159 476.4236 588.0083
## Sep 1960       465.2646 407.0367 523.4926
## Oct 1960       404.2452 343.6796 464.8108
## Nov 1960       350.9412 288.1249 413.7576
## Dec 1960       394.2528 329.2636 459.2421

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4667 387.1431 423.7904
## Nov 1959       353.0102 328.2421 377.7783
## Dec 1959       397.7100 367.8577 427.5624
## Jan 1960       403.7465 369.5579 437.9352
## Feb 1960       394.8302 356.7964 432.8640
## Mar 1960       454.3289 412.8045 495.8532
## Apr 1960       437.5761 392.8326 482.3195
## May 1960       438.6268 390.8809 486.3728
## Jun 1960       500.2172 449.6467 550.7878
## Jul 1960       551.5150 498.2694 604.7605
## Aug 1960       549.1919 493.3996 604.9843
## Sep 1960       481.4419 423.2140 539.6698
## Oct 1960       419.4623 358.8967 480.0279
## Nov 1960       365.1601 302.3438 427.9765
## Dec 1960       411.3593 346.3701 476.3485

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4620 387.1383 423.7857
## Nov 1959       353.0023 328.2342 377.7704
## Dec 1959       397.6970 367.8446 427.5493
## Jan 1960       403.7291 369.5404 437.9178
## Feb 1960       394.8090 356.7752 432.8428
## Mar 1960       454.2998 412.7755 495.8242
## Apr 1960       437.5436 392.8001 482.2870
## May 1960       438.5898 390.8438 486.3358
## Jun 1960       500.1699 449.5994 550.7405
## Jul 1960       551.4572 498.2117 604.7027
## Aug 1960       549.1289 493.3366 604.9213
## Sep 1960       481.3819 423.1540 539.6098
## Oct 1960       419.4058 358.8402 479.9714
## Nov 1960       365.1074 302.2910 427.9237
## Dec 1960       411.2958 346.3066 476.2850

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4375 387.1138 423.7612
## Nov 1959       352.9617 328.1936 377.7298
## Dec 1959       397.6296 367.7773 427.4820
## Jan 1960       403.6389 369.4502 437.8276
## Feb 1960       394.6996 356.6658 432.7334
## Mar 1960       454.1497 412.6253 495.6740
## Apr 1960       437.3757 392.6323 482.1192
## May 1960       438.3984 390.6524 486.1444
## Jun 1960       499.9254 449.3548 550.4959
## Jul 1960       551.1588 497.9133 604.4043
## Aug 1960       548.8033 493.0109 604.5956
## Sep 1960       481.0715 422.8436 539.2995
## Oct 1960       419.1139 358.5483 479.6795
## Nov 1960       364.8346 302.0182 427.6510
## Dec 1960       410.9677 345.9784 475.9569

## 
## [1] "attention_type's value:"
## [1] "gaussian"
## 
##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1982 385.8745 422.5219
## Nov 1959       350.9077 326.1396 375.6758
## Dec 1959       394.2221 364.3698 424.0745
## Jan 1960       399.0764 364.8877 433.2650
## Feb 1960       389.1651 351.1313 427.1988
## Mar 1960       446.5536 405.0292 488.0779
## Apr 1960       428.8841 384.1407 473.6275
## May 1960       428.7145 380.9685 476.4605
## Jun 1960       487.5527 436.9822 538.1233
## Jul 1960       536.0602 482.8147 589.3057
## Aug 1960       532.3253 476.5329 588.1176
## Sep 1960       465.3684 407.1405 523.5963
## Oct 1960       404.3424 343.7768 464.9080
## Nov 1960       351.0317 288.2153 413.8480
## Dec 1960       394.3612 329.3720 459.3504

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.6691 389.3454 425.9927
## Nov 1959       356.7511 331.9830 381.5192
## Dec 1959       403.7132 373.8609 433.5656
## Jan 1960       411.7569 377.5682 445.9455
## Feb 1960       404.5635 366.5297 442.5973
## Mar 1960       467.7162 426.1918 509.2405
## Apr 1960       452.5740 407.8305 497.3174
## May 1960       455.7673 408.0213 503.5132
## Jun 1960       522.1634 471.5928 572.7339
## Jul 1960       578.3527 525.1072 631.5982
## Aug 1960       578.5424 522.7501 634.3348
## Sep 1960       509.4699 451.2420 567.6978
## Oct 1960       445.8812 385.3156 506.4468
## Nov 1960       389.8964 327.0800 452.7128
## Dec 1960       441.1790 376.1898 506.1683

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.6562 389.3325 425.9799
## Nov 1959       356.7294 331.9613 381.4975
## Dec 1959       403.6777 373.8254 433.5301
## Jan 1960       411.7092 377.5205 445.8979
## Feb 1960       404.5054 366.4716 442.5392
## Mar 1960       467.6360 426.1116 509.1603
## Apr 1960       452.4838 407.7404 497.2272
## May 1960       455.6639 407.9179 503.4099
## Jun 1960       522.0305 471.4600 572.6011
## Jul 1960       578.1897 524.9442 631.4352
## Aug 1960       578.3636 522.5713 634.1560
## Sep 1960       509.2987 451.0707 567.5266
## Oct 1960       445.7193 385.1537 506.2849
## Nov 1960       389.7443 326.9279 452.5607
## Dec 1960       440.9952 376.0059 505.9844

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.5891 389.2655 425.9128
## Nov 1959       356.6162 331.8480 381.3843
## Dec 1959       403.4930 373.6407 433.3454
## Jan 1960       411.4613 377.2727 445.6500
## Feb 1960       404.2031 366.1693 442.2369
## Mar 1960       467.2188 425.6944 508.7431
## Apr 1960       452.0148 407.2714 496.7582
## May 1960       455.1261 407.3801 502.8721
## Jun 1960       521.3398 470.7692 571.9103
## Jul 1960       577.3422 524.0967 630.5878
## Aug 1960       577.4339 521.6416 633.2263
## Sep 1960       508.4081 450.1802 566.6361
## Oct 1960       444.8774 384.3118 505.4430
## Nov 1960       388.9537 326.1373 451.7701
## Dec 1960       440.0394 375.0501 505.0286

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1894 385.8658 422.5131
## Nov 1959       350.8928 326.1247 375.6610
## Dec 1959       394.1985 364.3461 424.0508
## Jan 1960       399.0451 364.8564 433.2337
## Feb 1960       389.1273 351.0935 427.1611
## Mar 1960       446.5020 404.9777 488.0264
## Apr 1960       428.8267 384.0833 473.5702
## May 1960       428.6494 380.9034 476.3953
## Jun 1960       487.4699 436.8993 538.0405
## Jul 1960       535.9596 482.7141 589.2051
## Aug 1960       532.2159 476.4236 588.0083
## Sep 1960       465.2646 407.0367 523.4926
## Oct 1960       404.2452 343.6796 464.8108
## Nov 1960       350.9412 288.1249 413.7576
## Dec 1960       394.2528 329.2636 459.2421

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4667 387.1431 423.7904
## Nov 1959       353.0102 328.2421 377.7783
## Dec 1959       397.7100 367.8577 427.5624
## Jan 1960       403.7465 369.5579 437.9352
## Feb 1960       394.8302 356.7964 432.8640
## Mar 1960       454.3289 412.8045 495.8532
## Apr 1960       437.5761 392.8326 482.3195
## May 1960       438.6268 390.8809 486.3728
## Jun 1960       500.2172 449.6467 550.7878
## Jul 1960       551.5150 498.2694 604.7605
## Aug 1960       549.1919 493.3996 604.9843
## Sep 1960       481.4419 423.2140 539.6698
## Oct 1960       419.4623 358.8967 480.0279
## Nov 1960       365.1601 302.3438 427.9765
## Dec 1960       411.3593 346.3701 476.3485

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4620 387.1383 423.7857
## Nov 1959       353.0023 328.2342 377.7704
## Dec 1959       397.6970 367.8446 427.5493
## Jan 1960       403.7291 369.5404 437.9178
## Feb 1960       394.8090 356.7752 432.8428
## Mar 1960       454.2998 412.7755 495.8242
## Apr 1960       437.5436 392.8001 482.2870
## May 1960       438.5898 390.8438 486.3358
## Jun 1960       500.1699 449.5994 550.7405
## Jul 1960       551.4572 498.2117 604.7027
## Aug 1960       549.1289 493.3366 604.9213
## Sep 1960       481.3819 423.1540 539.6098
## Oct 1960       419.4058 358.8402 479.9714
## Nov 1960       365.1074 302.2910 427.9237
## Dec 1960       411.2958 346.3066 476.2850

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4374 387.1137 423.7610
## Nov 1959       352.9615 328.1934 377.7296
## Dec 1959       397.6293 367.7769 427.4816
## Jan 1960       403.6384 369.4498 437.8271
## Feb 1960       394.6991 356.6653 432.7328
## Mar 1960       454.1489 412.6246 495.6733
## Apr 1960       437.3749 392.6314 482.1183
## May 1960       438.3974 390.6514 486.1434
## Jun 1960       499.9241 449.3536 550.4947
## Jul 1960       551.1573 497.9118 604.4028
## Aug 1960       548.8016 493.0092 604.5940
## Sep 1960       481.0700 422.8420 539.2979
## Oct 1960       419.1124 358.5468 479.6780
## Nov 1960       364.8332 302.0168 427.6496
## Dec 1960       410.9660 345.9768 475.9552

## 
## [1] "attention_type's value:"
## [1] "linear"
## 
##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1956 385.8719 422.5192
## Nov 1959       350.9031 326.1350 375.6712
## Dec 1959       394.2155 364.3632 424.0679
## Jan 1960       399.0679 364.8792 433.2566
## Feb 1960       389.1550 351.1213 427.1888
## Mar 1960       446.5401 405.0158 488.0645
## Apr 1960       428.8694 384.1259 473.6128
## May 1960       428.6980 380.9520 476.4440
## Jun 1960       487.5320 436.9615 538.1026
## Jul 1960       536.0354 482.7899 589.2809
## Aug 1960       532.2987 476.5064 588.0911
## Sep 1960       465.3436 407.1156 523.5715
## Oct 1960       404.3194 343.7538 464.8850
## Nov 1960       351.0106 288.1943 413.8270
## Dec 1960       394.3363 329.3471 459.3255

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.0086 388.6849 425.3323
## Nov 1959       355.5930 330.8249 380.3611
## Dec 1959       401.9966 372.1442 431.8489
## Jan 1960       409.4898 375.3011 443.6784
## Feb 1960       401.8015 363.7677 439.8353
## Mar 1960       463.9031 422.3788 505.4275
## Apr 1960       448.2858 403.5424 493.0293
## May 1960       450.8480 403.1020 498.5939
## Jun 1960       515.8412 465.2707 566.4118
## Jul 1960       570.5928 517.3473 623.8383
## Aug 1960       570.0251 514.2328 625.8175
## Sep 1960       501.3072 443.0793 559.5352
## Oct 1960       438.1599 377.5943 498.7255
## Nov 1960       382.6417 319.8253 445.4580
## Dec 1960       432.4034 367.4141 497.3926

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       406.9982 388.6745 425.3218
## Nov 1959       355.5756 330.8075 380.3437
## Dec 1959       401.9677 372.1153 431.8200
## Jan 1960       409.4511 375.2624 443.6397
## Feb 1960       401.7546 363.7208 439.7883
## Mar 1960       463.8386 422.3143 505.3630
## Apr 1960       448.2137 403.4703 492.9571
## May 1960       450.7657 403.0197 498.5117
## Jun 1960       515.7360 465.1655 566.3066
## Jul 1960       570.4644 517.2189 623.7099
## Aug 1960       569.8849 514.0926 625.6773
## Sep 1960       501.1735 442.9456 559.4015
## Oct 1960       438.0341 377.4685 498.5997
## Nov 1960       382.5240 319.7077 445.3404
## Dec 1960       432.2617 367.2725 497.2510

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       406.9438 388.6202 425.2675
## Nov 1959       355.4850 330.7168 380.2531
## Dec 1959       401.8173 371.9650 431.6697
## Jan 1960       409.2497 375.0610 443.4384
## Feb 1960       401.5102 363.4764 439.5439
## Mar 1960       463.5030 421.9787 505.0274
## Apr 1960       447.8384 403.0949 492.5818
## May 1960       450.3374 402.5915 498.0834
## Jun 1960       515.1886 464.6181 565.7592
## Jul 1960       569.7960 516.5505 623.0415
## Aug 1960       569.1551 513.3627 624.9475
## Sep 1960       500.4777 442.2497 558.7056
## Oct 1960       437.3791 376.8135 497.9447
## Nov 1960       381.9117 319.0953 444.7280
## Dec 1960       431.5246 366.5354 496.5138

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1894 385.8658 422.5131
## Nov 1959       350.8928 326.1247 375.6610
## Dec 1959       394.1985 364.3461 424.0508
## Jan 1960       399.0451 364.8564 433.2337
## Feb 1960       389.1273 351.0935 427.1611
## Mar 1960       446.5020 404.9777 488.0264
## Apr 1960       428.8267 384.0833 473.5702
## May 1960       428.6494 380.9034 476.3953
## Jun 1960       487.4699 436.8993 538.0405
## Jul 1960       535.9596 482.7141 589.2051
## Aug 1960       532.2159 476.4236 588.0083
## Sep 1960       465.2646 407.0367 523.4926
## Oct 1960       404.2452 343.6796 464.8108
## Nov 1960       350.9412 288.1249 413.7576
## Dec 1960       394.2528 329.2636 459.2421

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4667 387.1431 423.7904
## Nov 1959       353.0102 328.2421 377.7783
## Dec 1959       397.7100 367.8577 427.5624
## Jan 1960       403.7465 369.5579 437.9352
## Feb 1960       394.8302 356.7964 432.8640
## Mar 1960       454.3289 412.8045 495.8532
## Apr 1960       437.5761 392.8326 482.3195
## May 1960       438.6268 390.8809 486.3728
## Jun 1960       500.2172 449.6467 550.7878
## Jul 1960       551.5150 498.2694 604.7605
## Aug 1960       549.1919 493.3996 604.9843
## Sep 1960       481.4419 423.2140 539.6698
## Oct 1960       419.4623 358.8967 480.0279
## Nov 1960       365.1601 302.3438 427.9765
## Dec 1960       411.3593 346.3701 476.3485

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4620 387.1383 423.7857
## Nov 1959       353.0023 328.2342 377.7704
## Dec 1959       397.6970 367.8446 427.5493
## Jan 1960       403.7291 369.5404 437.9178
## Feb 1960       394.8090 356.7752 432.8428
## Mar 1960       454.2998 412.7755 495.8242
## Apr 1960       437.5436 392.8001 482.2870
## May 1960       438.5898 390.8438 486.3358
## Jun 1960       500.1699 449.5994 550.7405
## Jul 1960       551.4572 498.2117 604.7027
## Aug 1960       549.1289 493.3366 604.9213
## Sep 1960       481.3819 423.1540 539.6098
## Oct 1960       419.4058 358.8402 479.9714
## Nov 1960       365.1074 302.2910 427.9237
## Dec 1960       411.2958 346.3066 476.2850

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4374 387.1137 423.7610
## Nov 1959       352.9615 328.1934 377.7296
## Dec 1959       397.6293 367.7769 427.4816
## Jan 1960       403.6384 369.4498 437.8271
## Feb 1960       394.6991 356.6653 432.7328
## Mar 1960       454.1489 412.6246 495.6733
## Apr 1960       437.3749 392.6314 482.1183
## May 1960       438.3974 390.6514 486.1434
## Jun 1960       499.9241 449.3536 550.4947
## Jul 1960       551.1573 497.9118 604.4028
## Aug 1960       548.8016 493.0092 604.5940
## Sep 1960       481.0700 422.8420 539.2979
## Oct 1960       419.1124 358.5468 479.6780
## Nov 1960       364.8332 302.0168 427.6496
## Dec 1960       410.9660 345.9768 475.9552

## 
## [1] "attention_type's value:"
## [1] "value_based"
## 
##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1964 385.8727 422.5200
## Nov 1959       350.9048 326.1367 375.6729
## Dec 1959       394.2183 364.3660 424.0707
## Jan 1960       399.0718 364.8831 433.2604
## Feb 1960       389.1598 351.1260 427.1936
## Mar 1960       446.5467 405.0223 488.0711
## Apr 1960       428.8767 384.1333 473.6201
## May 1960       428.7061 380.9601 476.4521
## Jun 1960       487.5421 436.9715 538.1126
## Jul 1960       536.0466 482.8011 589.2921
## Aug 1960       532.3104 476.5180 588.1027
## Sep 1960       465.3546 407.1267 523.5825
## Oct 1960       404.3293 343.7637 464.8949
## Nov 1960       351.0198 288.2034 413.8362
## Dec 1960       394.3473 329.3581 459.3365

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.2062 388.8825 425.5298
## Nov 1959       356.0329 331.2648 380.8010
## Dec 1959       402.7476 372.8953 432.6000
## Jan 1960       410.5553 376.3666 444.7440
## Feb 1960       403.1642 365.1305 441.1980
## Mar 1960       465.8355 424.3111 507.3598
## Apr 1960       450.5103 405.7669 495.2537
## May 1960       453.3762 405.6302 501.1222
## Jun 1960       519.0526 468.4820 569.6231
## Jul 1960       574.2749 521.0294 627.5204
## Aug 1960       573.9566 518.1643 629.7490
## Sep 1960       505.1091 446.8811 563.3370
## Oct 1960       441.6285 381.0629 502.1941
## Nov 1960       385.9238 323.1075 448.7402
## Dec 1960       436.4026 371.4134 501.3918

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.1950 388.8713 425.5187
## Nov 1959       356.0138 331.2457 380.7819
## Dec 1959       402.7158 372.8634 432.5681
## Jan 1960       410.5123 376.3236 444.7009
## Feb 1960       403.1116 365.0778 441.1454
## Mar 1960       465.7627 424.2383 507.2870
## Apr 1960       450.4284 405.6850 495.1718
## May 1960       453.2826 405.5366 501.0285
## Jun 1960       518.9329 468.3623 569.5034
## Jul 1960       574.1298 520.8842 627.3753
## Aug 1960       573.7985 518.0061 629.5908
## Sep 1960       504.9581 446.7302 563.1860
## Oct 1960       441.4866 380.9210 502.0522
## Nov 1960       385.7907 322.9743 448.6070
## Dec 1960       436.2417 371.2525 501.2309

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.1362 388.8125 425.4599
## Nov 1959       355.9133 331.1452 380.6814
## Dec 1959       402.5482 372.6958 432.4005
## Jan 1960       410.2859 376.0972 444.4746
## Feb 1960       402.8346 364.8008 440.8684
## Mar 1960       465.3800 423.8556 506.9043
## Apr 1960       449.9978 405.2543 494.7412
## May 1960       452.7900 405.0441 500.5360
## Jun 1960       518.3034 467.7329 568.8740
## Jul 1960       573.3664 520.1208 626.6119
## Aug 1960       572.9670 517.1746 628.7593
## Sep 1960       504.1644 445.9365 562.3923
## Oct 1960       440.7403 380.1747 501.3059
## Nov 1960       385.0905 322.2742 447.9069
## Dec 1960       435.3959 370.4067 500.3851

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1894 385.8658 422.5131
## Nov 1959       350.8928 326.1247 375.6610
## Dec 1959       394.1985 364.3461 424.0508
## Jan 1960       399.0451 364.8564 433.2337
## Feb 1960       389.1273 351.0935 427.1611
## Mar 1960       446.5020 404.9777 488.0264
## Apr 1960       428.8267 384.0833 473.5702
## May 1960       428.6494 380.9034 476.3953
## Jun 1960       487.4699 436.8993 538.0405
## Jul 1960       535.9596 482.7141 589.2051
## Aug 1960       532.2159 476.4236 588.0083
## Sep 1960       465.2646 407.0367 523.4926
## Oct 1960       404.2452 343.6796 464.8108
## Nov 1960       350.9412 288.1249 413.7576
## Dec 1960       394.2528 329.2636 459.2421

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4667 387.1431 423.7904
## Nov 1959       353.0102 328.2421 377.7783
## Dec 1959       397.7100 367.8577 427.5624
## Jan 1960       403.7465 369.5579 437.9352
## Feb 1960       394.8302 356.7964 432.8640
## Mar 1960       454.3289 412.8045 495.8532
## Apr 1960       437.5761 392.8326 482.3195
## May 1960       438.6268 390.8809 486.3728
## Jun 1960       500.2172 449.6467 550.7878
## Jul 1960       551.5150 498.2694 604.7605
## Aug 1960       549.1919 493.3996 604.9843
## Sep 1960       481.4419 423.2140 539.6698
## Oct 1960       419.4623 358.8967 480.0279
## Nov 1960       365.1601 302.3438 427.9765
## Dec 1960       411.3593 346.3701 476.3485

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4620 387.1383 423.7857
## Nov 1959       353.0023 328.2342 377.7704
## Dec 1959       397.6970 367.8446 427.5493
## Jan 1960       403.7291 369.5404 437.9178
## Feb 1960       394.8090 356.7752 432.8428
## Mar 1960       454.2998 412.7755 495.8242
## Apr 1960       437.5436 392.8001 482.2870
## May 1960       438.5898 390.8438 486.3358
## Jun 1960       500.1699 449.5994 550.7405
## Jul 1960       551.4572 498.2117 604.7027
## Aug 1960       549.1289 493.3366 604.9213
## Sep 1960       481.3819 423.1540 539.6098
## Oct 1960       419.4058 358.8402 479.9714
## Nov 1960       365.1074 302.2910 427.9237
## Dec 1960       411.2958 346.3066 476.2850

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4374 387.1137 423.7610
## Nov 1959       352.9615 328.1934 377.7296
## Dec 1959       397.6293 367.7769 427.4816
## Jan 1960       403.6384 369.4498 437.8271
## Feb 1960       394.6991 356.6653 432.7328
## Mar 1960       454.1489 412.6246 495.6733
## Apr 1960       437.3749 392.6314 482.1183
## May 1960       438.3974 390.6514 486.1434
## Jun 1960       499.9241 449.3536 550.4947
## Jul 1960       551.1573 497.9118 604.4028
## Aug 1960       548.8016 493.0092 604.5940
## Sep 1960       481.0700 422.8420 539.2979
## Oct 1960       419.1124 358.5468 479.6780
## Nov 1960       364.8332 302.0168 427.6496
## Dec 1960       410.9660 345.9768 475.9552

## 
## [1] "attention_type's value:"
## [1] "hybrid"
## 
##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1979 385.8742 422.5215
## Nov 1959       350.9072 326.1391 375.6754
## Dec 1959       394.2221 364.3698 424.0745
## Jan 1960       399.0765 364.8878 433.2652
## Feb 1960       389.1652 351.1314 427.1990
## Mar 1960       446.5538 405.0294 488.0781
## Apr 1960       428.8843 384.1408 473.6277
## May 1960       428.7146 380.9687 476.4606
## Jun 1960       487.5529 436.9823 538.1234
## Jul 1960       536.0604 482.8149 589.3059
## Aug 1960       532.3254 476.5331 588.1178
## Sep 1960       465.3685 407.1406 523.5964
## Oct 1960       404.3424 343.7768 464.9081
## Nov 1960       351.0317 288.2154 413.8481
## Dec 1960       394.3612 329.3720 459.3505

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.5791 389.2554 425.9028
## Nov 1959       356.6440 331.8759 381.4121
## Dec 1959       403.7180 373.8656 433.5703
## Jan 1960       411.7711 377.5824 445.9598
## Feb 1960       404.5472 366.5134 442.5810
## Mar 1960       467.6492 426.1248 509.1736
## Apr 1960       452.4553 407.7119 497.1987
## May 1960       455.5879 407.8419 503.3339
## Jun 1960       521.8843 471.3137 572.4548
## Jul 1960       577.9575 524.7120 631.2030
## Aug 1960       578.0618 522.2695 633.8542
## Sep 1960       508.9739 450.7460 567.2019
## Oct 1960       445.3823 384.8167 505.9479
## Nov 1960       389.4070 326.5906 452.2234
## Dec 1960       440.5671 375.5779 505.5564

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.5666 389.2429 425.8902
## Nov 1959       356.6226 331.8545 381.3907
## Dec 1959       403.6825 373.8302 433.5349
## Jan 1960       411.7235 377.5348 445.9122
## Feb 1960       404.4894 366.4556 442.5231
## Mar 1960       467.5697 426.0453 509.0940
## Apr 1960       452.3662 407.6227 497.1096
## May 1960       455.4860 407.7400 503.2319
## Jun 1960       521.7537 471.1831 572.3242
## Jul 1960       577.7976 524.5521 631.0431
## Aug 1960       577.8867 522.0944 633.6791
## Sep 1960       508.8064 450.5785 567.0343
## Oct 1960       445.2241 384.6585 505.7897
## Nov 1960       389.2585 326.4422 452.0749
## Dec 1960       440.3878 375.3985 505.3770

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.5014 389.1777 425.8250
## Nov 1959       356.5116 331.7435 381.2797
## Dec 1959       403.4982 373.6459 433.3506
## Jan 1960       411.4764 377.2877 445.6651
## Feb 1960       404.1891 366.1553 442.2229
## Mar 1960       467.1567 425.6323 508.6810
## Apr 1960       451.9034 407.1599 496.6468
## May 1960       454.9568 407.2108 502.7028
## Jun 1960       521.0757 470.5051 571.6462
## Jul 1960       576.9676 523.7221 630.2131
## Aug 1960       576.9779 521.1856 632.7703
## Sep 1960       507.9370 449.7090 566.1649
## Oct 1960       444.4030 383.8374 504.9687
## Nov 1960       388.4882 325.6718 451.3046
## Dec 1960       439.4571 374.4679 504.4463

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1894 385.8658 422.5131
## Nov 1959       350.8928 326.1247 375.6610
## Dec 1959       394.1985 364.3461 424.0508
## Jan 1960       399.0451 364.8564 433.2337
## Feb 1960       389.1273 351.0935 427.1611
## Mar 1960       446.5020 404.9777 488.0264
## Apr 1960       428.8267 384.0833 473.5702
## May 1960       428.6494 380.9034 476.3953
## Jun 1960       487.4699 436.8993 538.0405
## Jul 1960       535.9596 482.7141 589.2051
## Aug 1960       532.2159 476.4236 588.0083
## Sep 1960       465.2646 407.0367 523.4926
## Oct 1960       404.2452 343.6796 464.8108
## Nov 1960       350.9412 288.1249 413.7576
## Dec 1960       394.2528 329.2636 459.2421

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4667 387.1431 423.7904
## Nov 1959       353.0102 328.2421 377.7783
## Dec 1959       397.7100 367.8577 427.5624
## Jan 1960       403.7465 369.5579 437.9352
## Feb 1960       394.8302 356.7964 432.8640
## Mar 1960       454.3289 412.8045 495.8532
## Apr 1960       437.5761 392.8326 482.3195
## May 1960       438.6268 390.8809 486.3728
## Jun 1960       500.2172 449.6467 550.7878
## Jul 1960       551.5150 498.2694 604.7605
## Aug 1960       549.1919 493.3996 604.9843
## Sep 1960       481.4419 423.2140 539.6698
## Oct 1960       419.4623 358.8967 480.0279
## Nov 1960       365.1601 302.3438 427.9765
## Dec 1960       411.3593 346.3701 476.3485

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4620 387.1383 423.7857
## Nov 1959       353.0023 328.2342 377.7704
## Dec 1959       397.6970 367.8446 427.5493
## Jan 1960       403.7291 369.5404 437.9178
## Feb 1960       394.8090 356.7752 432.8428
## Mar 1960       454.2998 412.7755 495.8242
## Apr 1960       437.5436 392.8001 482.2870
## May 1960       438.5898 390.8438 486.3358
## Jun 1960       500.1699 449.5994 550.7405
## Jul 1960       551.4572 498.2117 604.7027
## Aug 1960       549.1289 493.3366 604.9213
## Sep 1960       481.3819 423.1540 539.6098
## Oct 1960       419.4058 358.8402 479.9714
## Nov 1960       365.1074 302.2910 427.9237
## Dec 1960       411.2958 346.3066 476.2850

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4373 387.1136 423.7609
## Nov 1959       352.9613 328.1932 377.7294
## Dec 1959       397.6289 367.7766 427.4813
## Jan 1960       403.6380 369.4493 437.8267
## Feb 1960       394.6985 356.6647 432.7323
## Mar 1960       454.1482 412.6238 495.6725
## Apr 1960       437.3740 392.6306 482.1175
## May 1960       438.3964 390.6505 486.1424
## Jun 1960       499.9229 449.3523 550.4934
## Jul 1960       551.1558 497.9103 604.4013
## Aug 1960       548.7999 493.0076 604.5923
## Sep 1960       481.0684 422.8405 539.2963
## Oct 1960       419.1109 358.5453 479.6766
## Nov 1960       364.8318 302.0155 427.6482
## Dec 1960       410.9643 345.9751 475.9535

## 
## [1] "attention_type's value:"
## [1] "parametric"
## 
##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1981 385.8744 422.5217
## Nov 1959       350.9077 326.1396 375.6759
## Dec 1959       394.2226 364.3702 424.0749
## Jan 1960       399.0768 364.8881 433.2655
## Feb 1960       389.1654 351.1316 427.1992
## Mar 1960       446.5539 405.0295 488.0782
## Apr 1960       428.8843 384.1409 473.6277
## May 1960       428.7146 380.9687 476.4606
## Jun 1960       487.5528 436.9823 538.1234
## Jul 1960       536.0603 482.8148 589.3058
## Aug 1960       532.3253 476.5330 588.1177
## Sep 1960       465.3684 407.1405 523.5963
## Oct 1960       404.3424 343.7768 464.9080
## Nov 1960       351.0317 288.2153 413.8480
## Dec 1960       394.3612 329.3720 459.3504

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.6382 389.3145 425.9619
## Nov 1959       356.7698 332.0017 381.5379
## Dec 1959       403.8247 373.9724 433.6771
## Jan 1960       411.8495 377.6609 446.0382
## Feb 1960       404.6081 366.5743 442.6419
## Mar 1960       467.7180 426.1936 509.2423
## Apr 1960       452.5344 407.7910 497.2778
## May 1960       455.6927 407.9467 503.4386
## Jun 1960       522.0441 471.4736 572.6147
## Jul 1960       578.1885 524.9430 631.4340
## Aug 1960       578.3503 522.5579 634.1426
## Sep 1960       509.2792 451.0513 567.5071
## Oct 1960       445.6969 385.1313 506.2625
## Nov 1960       389.7215 326.9051 452.5378
## Dec 1960       440.9665 375.9773 505.9557

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.6254 389.3018 425.9491
## Nov 1959       356.7480 331.9798 381.5161
## Dec 1959       403.7889 373.9365 433.6412
## Jan 1960       411.8017 377.6130 445.9903
## Feb 1960       404.5500 366.5162 442.5838
## Mar 1960       467.6380 426.1136 509.1624
## Apr 1960       452.4447 407.7013 497.1881
## May 1960       455.5899 407.8440 503.3359
## Jun 1960       521.9123 471.3417 572.4829
## Jul 1960       578.0268 524.7813 631.2723
## Aug 1960       578.1730 522.3806 633.9653
## Sep 1960       509.1094 450.8815 567.3373
## Oct 1960       445.5364 384.9708 506.1020
## Nov 1960       389.5707 326.7543 452.3871
## Dec 1960       440.7843 375.7950 505.7735

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       407.5587 389.2350 425.8823
## Nov 1959       356.6338 331.8657 381.4020
## Dec 1959       403.6013 373.7489 433.4536
## Jan 1960       411.5513 377.3626 445.7399
## Feb 1960       404.2462 366.2124 442.2800
## Mar 1960       467.2201 425.6957 508.7444
## Apr 1960       451.9759 407.2325 496.7193
## May 1960       455.0531 407.3071 502.7991
## Jun 1960       521.2233 470.6528 571.7939
## Jul 1960       577.1821 523.9366 630.4276
## Aug 1960       577.2466 521.4542 633.0389
## Sep 1960       508.2222 449.9943 566.4501
## Oct 1960       444.6978 384.1321 505.2634
## Nov 1960       388.7833 325.9669 451.5997
## Dec 1960       439.8323 374.8431 504.8216

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       404.1894 385.8658 422.5131
## Nov 1959       350.8928 326.1247 375.6610
## Dec 1959       394.1985 364.3461 424.0508
## Jan 1960       399.0451 364.8564 433.2337
## Feb 1960       389.1273 351.0935 427.1611
## Mar 1960       446.5020 404.9777 488.0264
## Apr 1960       428.8267 384.0833 473.5702
## May 1960       428.6494 380.9034 476.3953
## Jun 1960       487.4699 436.8993 538.0405
## Jul 1960       535.9596 482.7141 589.2051
## Aug 1960       532.2159 476.4236 588.0083
## Sep 1960       465.2646 407.0367 523.4926
## Oct 1960       404.2452 343.6796 464.8108
## Nov 1960       350.9412 288.1249 413.7576
## Dec 1960       394.2528 329.2636 459.2421

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4667 387.1431 423.7904
## Nov 1959       353.0102 328.2421 377.7783
## Dec 1959       397.7100 367.8577 427.5624
## Jan 1960       403.7465 369.5579 437.9352
## Feb 1960       394.8302 356.7964 432.8640
## Mar 1960       454.3289 412.8045 495.8532
## Apr 1960       437.5761 392.8326 482.3195
## May 1960       438.6268 390.8809 486.3728
## Jun 1960       500.2172 449.6467 550.7878
## Jul 1960       551.5150 498.2694 604.7605
## Aug 1960       549.1919 493.3996 604.9843
## Sep 1960       481.4419 423.2140 539.6698
## Oct 1960       419.4623 358.8967 480.0279
## Nov 1960       365.1601 302.3438 427.9765
## Dec 1960       411.3593 346.3701 476.3485

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4620 387.1383 423.7857
## Nov 1959       353.0023 328.2342 377.7704
## Dec 1959       397.6970 367.8446 427.5493
## Jan 1960       403.7291 369.5404 437.9178
## Feb 1960       394.8090 356.7752 432.8428
## Mar 1960       454.2998 412.7755 495.8242
## Apr 1960       437.5436 392.8001 482.2870
## May 1960       438.5898 390.8438 486.3358
## Jun 1960       500.1699 449.5994 550.7405
## Jul 1960       551.4572 498.2117 604.7027
## Aug 1960       549.1289 493.3366 604.9213
## Sep 1960       481.3819 423.1540 539.6098
## Oct 1960       419.4058 358.8402 479.9714
## Nov 1960       365.1074 302.2910 427.9237
## Dec 1960       411.2958 346.3066 476.2850

##          Point Forecast    Lo 95    Hi 95
## Oct 1959       405.4367 387.1131 423.7604
## Nov 1959       352.9604 328.1923 377.7285
## Dec 1959       397.6274 367.7751 427.4798
## Jan 1960       403.6360 369.4473 437.8247
## Feb 1960       394.6961 356.6623 432.7299
## Mar 1960       454.1448 412.6205 495.6692
## Apr 1960       437.3703 392.6269 482.1137
## May 1960       438.3922 390.6462 486.1382
## Jun 1960       499.9175 449.3469 550.4880
## Jul 1960       551.1492 497.9037 604.3947
## Aug 1960       548.7927 493.0004 604.5851
## Sep 1960       481.0615 422.8336 539.2894
## Oct 1960       419.1045 358.5389 479.6701
## Nov 1960       364.8258 302.0094 427.6422
## Dec 1960       410.9571 345.9678 475.9463

print(results)
##   dot_product scaled_dot_product   cosine exponential gaussian   linear
## 1    42.63391           42.63391 42.65812    42.63265 42.63297 42.64907
## 2    20.43297           20.43297 24.28301    20.30292 20.14559 22.76432
## 3    20.47640           20.47640 24.33653    20.34498 20.18693 22.81711
## 4    20.71219           20.72690 24.61747    20.58303 20.41222 23.09631
## 5    42.69941           42.69941 42.69941    42.69941 42.69941 42.69941
## 6    32.77817           32.77817 32.77817    32.77817 32.77817 32.77817
## 7    32.81306           32.81306 32.81306    32.81306 32.81306 32.81306
## 8    32.99694           32.99497 32.99553    32.99369 32.99461 32.99461
##   value_based   hybrid parametric
## 1    42.64183 42.63289   42.63291
## 2    21.38388 20.26749   20.19900
## 3    21.43379 20.30953   20.24052
## 4    21.70311 20.53747   20.46764
## 5    42.69941 42.69941   42.69941
## 6    32.77817 32.77817   32.77817
## 7    32.81306 32.81306   32.81306
## 8    32.99461 32.99553   32.99953
results1 <- results
library(forecast)
library(ahead)

attention_types <- c("dot_product", "scaled_dot_product", 
  "cosine", "exponential", 
  "gaussian", "linear",
  "value_based", "hybrid", 
  "parametric")

results <- data.frame(matrix(0, ncol=length(attention_types), nrow=8))

colnames(results) <- attention_types

rmse <- function(obj, y_test)
{
  sqrt(mean((obj$mean - y_test)**2))
}

y <- AirPassengers

y_split <- misc::splitts(y, split_prob = 0.9)

y_train <- y_split$training

y_test <- y_split$testing

h <- length(y_test)

for (attention_type in attention_types)
{
   misc::debug_print(attention_type)
  
   (obj <- suppressWarnings(ahead::glmthetaf(y_train, h=h, fit_func=MASS::glm.nb, attention = TRUE, attention_type = attention_type, attention_method = "historical")))
  print(obj)
  results[1, attention_type] <- rmse(obj, y_test)
  plot(obj)
  
  (obj <- suppressWarnings(ahead::glmthetaf(y_train, h=h, fit_func=stats::glm, attention = TRUE, attention_type = attention_type, attention_method = "historical")))
  results[2, attention_type] <- rmse(obj, y_test)
  print(obj)
  plot(obj)
  
  (obj <- suppressWarnings(ahead::glmthetaf(y_train, h=h, fit_func=MASS::rlm, attention = TRUE, attention_type = attention_type, attention_method = "historical")))
  results[3, attention_type] <- rmse(obj, y_test)
  print(obj)
  plot(obj)
  
  (obj <- suppressWarnings(ahead::glmthetaf(y_train, h=h, fit_func=MASS::lqs, attention = TRUE, attention_type = attention_type, attention_method = "historical")))
  results[4, attention_type] <- rmse(obj, y_test)
  print(obj)
  plot(obj) 
  
  
  (obj <- suppressWarnings(ahead::glmthetaf(y_train, h=h, fit_func=MASS::glm.nb, attention = FALSE, attention_type = attention_type, attention_method = "historical")))
  print(obj)
  results[5, attention_type] <- rmse(obj, y_test)
  plot(obj)
  
  (obj <- suppressWarnings(ahead::glmthetaf(y_train, h=h, fit_func=stats::glm, attention = FALSE, attention_type = attention_type, attention_method = "historical")))
  results[6, attention_type] <- rmse(obj, y_test)
  print(obj)
  plot(obj)
  
  (obj <- suppressWarnings(ahead::glmthetaf(y_train, h=h, fit_func=MASS::rlm, attention = FALSE, attention_type = attention_type, attention_method = "historical")))
  results[7, attention_type] <- rmse(obj, y_test)
  print(obj)
  plot(obj)
  
  (obj <- suppressWarnings(ahead::glmthetaf(y_train, h=h, fit_func=MASS::lqs, attention = FALSE, attention_type = attention_type, attention_method = "historical")))
  results[8, attention_type] <- rmse(obj, y_test)
  print(obj)
  plot(obj) 

}

print(results1)
print(results)