## 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.3075 388.9838 425.6311
## Nov 1959 356.5995 331.8314 381.3677
## Dec 1959 403.6224 373.7701 433.4747
## Jan 1960 411.6054 377.4167 445.7941
## Feb 1960 404.2962 366.2624 442.3300
## Mar 1960 467.2326 425.7082 508.7569
## Apr 1960 451.9067 407.1633 496.6501
## May 1960 454.8671 407.1211 502.6131
## Jun 1960 520.8423 470.2717 571.4128
## Jul 1960 576.5404 523.2949 629.7859
## Aug 1960 576.3555 520.5631 632.1479
## Sep 1960 507.1952 448.9673 565.4231
## Oct 1960 443.5702 383.0046 504.1358
## Nov 1960 387.5842 324.7678 450.4006
## Dec 1960 438.2220 373.2328 503.2112

## 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] "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.3090 388.9853 425.6326
## Nov 1959 356.6023 331.8342 381.3704
## Dec 1959 403.6269 373.7746 433.4793
## Jan 1960 411.6114 377.4227 445.8001
## Feb 1960 404.3035 366.2697 442.3373
## Mar 1960 467.2426 425.7183 508.7670
## Apr 1960 451.9179 407.1744 496.6613
## May 1960 454.8798 407.1338 502.6258
## Jun 1960 520.8585 470.2880 571.4291
## Jul 1960 576.5602 523.3147 629.8057
## Aug 1960 576.3770 520.5847 632.1694
## Sep 1960 507.2157 448.9878 565.4436
## Oct 1960 443.5894 383.0238 504.1551
## Nov 1960 387.6022 324.7858 450.4185
## Dec 1960 438.2436 373.2544 503.2328

## 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] "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.6835 388.3599 425.0072
## Nov 1959 355.0375 330.2694 379.8056
## Dec 1959 401.0740 371.2217 430.9263
## Jan 1960 408.2511 374.0624 442.4398
## Feb 1960 400.2943 362.2605 438.3281
## Mar 1960 461.8282 420.3038 503.3525
## Apr 1960 445.9593 401.2159 490.7027
## May 1960 448.1869 400.4410 495.9329
## Jun 1960 512.4315 461.8610 563.0021
## Jul 1960 566.4201 513.1746 619.6656
## Aug 1960 565.4585 509.6661 621.2508
## Sep 1960 496.9433 438.7154 555.1713
## Oct 1960 434.0439 373.4783 494.6095
## Nov 1960 378.7853 315.9690 441.6017
## Dec 1960 427.7517 362.7624 492.7409

## 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.4797 389.1560 425.8033
## Nov 1959 356.5573 331.7892 381.3254
## Dec 1959 403.5462 373.6938 433.3985
## Jan 1960 411.5127 377.3240 445.7013
## Feb 1960 404.2068 366.1731 442.2406
## Mar 1960 467.1537 425.6294 508.6781
## Apr 1960 451.8775 407.1341 496.6209
## May 1960 454.9092 407.1632 502.6551
## Jun 1960 520.9994 470.4289 571.5700
## Jul 1960 576.8638 523.6183 630.1093
## Aug 1960 576.8553 521.0630 632.6477
## Sep 1960 507.8125 449.5846 566.0404
## Oct 1960 444.2829 383.7173 504.8485
## Nov 1960 388.3720 325.5556 451.1883
## Dec 1960 439.3134 374.3242 504.3026

## 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

##
## [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.4364 387.1128 423.7601
## Nov 1959 352.9599 328.1918 377.7280
## Dec 1959 397.6267 367.7743 427.4790
## Jan 1960 403.6350 369.4463 437.8237
## Feb 1960 394.6948 356.6611 432.7286
## Mar 1960 454.1431 412.6188 495.6675
## Apr 1960 437.3684 392.6250 482.1119
## May 1960 438.3901 390.6441 486.1360
## Jun 1960 499.9147 449.3442 550.4853
## Jul 1960 551.1458 497.9003 604.3913
## Aug 1960 548.7891 492.9967 604.5814
## Sep 1960 481.0580 422.8301 539.2859
## Oct 1960 419.1012 358.5356 479.6668
## Nov 1960 364.8227 302.0063 427.6391
## Dec 1960 410.9534 345.9641 475.9426

##
## [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.9439 388.6203 425.2676
## Nov 1959 355.4851 330.7170 380.2533
## Dec 1959 401.8176 371.9653 431.6700
## Jan 1960 409.2501 375.0614 443.4388
## Feb 1960 401.5106 363.4769 439.5444
## Mar 1960 463.5037 421.9794 505.0281
## Apr 1960 447.8391 403.0957 492.5826
## May 1960 450.3383 402.5923 498.0843
## Jun 1960 515.1897 464.6192 565.7603
## Jul 1960 569.7974 516.5519 623.0429
## Aug 1960 569.1566 513.3642 624.9489
## Sep 1960 500.4791 442.2511 558.7070
## Oct 1960 437.3805 376.8148 497.9461
## Nov 1960 381.9129 319.0965 444.7293
## Dec 1960 431.5261 366.5369 496.5153

## 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] "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.1367 388.8130 425.4603
## Nov 1959 355.9141 331.1460 380.6822
## Dec 1959 402.5495 372.6971 432.4018
## Jan 1960 410.2877 376.0990 444.4763
## Feb 1960 402.8368 364.8030 440.8705
## Mar 1960 465.3829 423.8586 506.9073
## Apr 1960 450.0011 405.2577 494.7445
## May 1960 452.7939 405.0479 500.5398
## Jun 1960 518.3083 467.7378 568.8789
## Jul 1960 573.3723 520.1268 626.6178
## Aug 1960 572.9734 517.1810 628.7658
## Sep 1960 504.1706 445.9426 562.3985
## Oct 1960 440.7461 380.1805 501.3117
## Nov 1960 385.0960 322.2796 447.9123
## Dec 1960 435.4024 370.4132 500.3917

## 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] "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.5012 389.1776 425.8249
## Nov 1959 356.5114 331.7433 381.2795
## Dec 1959 403.4978 373.6455 433.3502
## Jan 1960 411.4759 377.2872 445.6646
## Feb 1960 404.1885 366.1547 442.2223
## Mar 1960 467.1559 425.6315 508.6802
## Apr 1960 451.9024 407.1590 496.6459
## May 1960 454.9557 407.2098 502.7017
## Jun 1960 521.0743 470.5038 571.6449
## Jul 1960 576.9660 523.7205 630.2115
## Aug 1960 576.9761 521.1837 632.7684
## Sep 1960 507.9352 449.7073 566.1631
## Oct 1960 444.4014 383.8358 504.9670
## Nov 1960 388.4867 325.6703 451.3030
## Dec 1960 439.4552 374.4660 504.4444

## 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] "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.5588 389.2351 425.8824
## Nov 1959 356.6340 331.8659 381.4021
## Dec 1959 403.6016 373.7492 433.4539
## Jan 1960 411.5517 377.3630 445.7404
## Feb 1960 404.2467 366.2129 442.2805
## Mar 1960 467.2208 425.6964 508.7451
## Apr 1960 451.9767 407.2332 496.7201
## May 1960 455.0540 407.3080 502.8000
## Jun 1960 521.2245 470.6539 571.7950
## Jul 1960 577.1835 523.9380 630.4290
## Aug 1960 577.2481 521.4557 633.0405
## Sep 1960 508.2237 449.9958 566.4516
## Oct 1960 444.6991 384.1335 505.2648
## Nov 1960 388.7846 325.9682 451.6010
## Dec 1960 439.8339 374.8447 504.8231

## 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.4376 387.1140 423.7613
## Nov 1959 352.9619 328.1938 377.7300
## Dec 1959 397.6299 367.7776 427.4823
## Jan 1960 403.6393 369.4507 437.8280
## Feb 1960 394.7001 356.6663 432.7339
## Mar 1960 454.1504 412.6260 495.6748
## Apr 1960 437.3765 392.6331 482.1200
## May 1960 438.3993 390.6533 486.1453
## Jun 1960 499.9265 449.3560 550.4971
## Jul 1960 551.1602 497.9147 604.4057
## Aug 1960 548.8048 493.0124 604.5972
## Sep 1960 481.0730 422.8451 539.3009
## Oct 1960 419.1153 358.5497 479.6809
## Nov 1960 364.8359 302.0195 427.6523
## Dec 1960 410.9692 345.9800 475.9584

## 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.71145 20.70560 24.61603 20.57334 20.41222 23.09574
## 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.99553 32.99694 32.99553 32.99953 33.00157 32.99553
## 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.70098 20.53795 20.46725
## 5 42.69941 42.69941 42.69941
## 6 32.77817 32.77817 32.77817
## 7 32.81306 32.81306 32.81306
## 8 32.99497 32.99497 32.99283
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)