Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 24 Dec 2010 13:06:43 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/24/t1293196074xhz1tiki96iu708.htm/, Retrieved Tue, 30 Apr 2024 04:59:54 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=114897, Retrieved Tue, 30 Apr 2024 04:59:54 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact148
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Explorative Data Analysis] [Monthly US soldie...] [2010-11-02 12:07:39] [b98453cac15ba1066b407e146608df68]
- RMP   [Variance Reduction Matrix] [Soldiers] [2010-11-29 09:51:25] [b98453cac15ba1066b407e146608df68]
- RM      [Standard Deviation-Mean Plot] [Soldiers] [2010-11-29 11:02:42] [b98453cac15ba1066b407e146608df68]
- RMP       [ARIMA Forecasting] [Soldiers] [2010-11-29 21:04:02] [b98453cac15ba1066b407e146608df68]
-   PD        [ARIMA Forecasting] [Ws 9.7] [2010-12-07 19:32:19] [b1e5ec7263cdefe98ec76e1a1363de05]
-   PD            [ARIMA Forecasting] [ARIMA forecasting] [2010-12-24 13:06:43] [cda497ce08bc921f0aec22acd67c882b] [Current]
Feedback Forum

Post a new message
Dataseries X:
12008
9169
8788
8417
8247
8197
8236
8253
7733
8366
8626
8863
10102
8463
9114
8563
8872
8301
8301
8278
7736
7973
8268
9476
11100
8962
9173
8738
8459
8078
8411
8291
7810
8616
8312
9692
9911
8915
9452
9112
8472
8230
8384
8625
8221
8649
8625
10443
10357
8586
8892
8329
8101
7922
8120
7838
7735
8406
8209
9451
10041
9411
10405
8467
8464
8102
7627
7513
7510
8291
8064
9383




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 2 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114897&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114897&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114897&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135







Univariate ARIMA Extrapolation Forecast
timeY[t]F[t]95% LB95% UBp-value(H0: Y[t] = F[t])P(F[t]>Y[t-1])P(F[t]>Y[t-s])P(F[t]>Y[60])
4810443-------
4910357-------
508586-------
518892-------
528329-------
538101-------
547922-------
558120-------
567838-------
577735-------
588406-------
598209-------
609451-------
61100419727.28558955.566510499.00460.21280.75860.05490.7586
6294118486.75827623.64959349.86690.01792e-040.41080.0143
63104058956.08098059.67969852.48238e-040.15990.55570.1396
6484678535.78717619.92019451.65410.441500.67090.0251
6584648065.26717134.21198996.32220.20060.19890.470.0018
6681027849.97546905.29678794.6540.30050.10130.44064e-04
6776278022.19627064.56118979.83140.20930.43510.42070.0017
6875138052.77187082.52639023.01730.13780.80510.66780.0024
6975107770.05556787.42538752.68580.3020.69590.52794e-04
7082918295.93847301.10129290.77570.49610.93920.41420.0114
7180648202.2817195.39369209.16850.39390.43140.49480.0075
7293839788.32888769.536910807.12080.21780.99950.74180.7418

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast \tabularnewline
time & Y[t] & F[t] & 95% LB & 95% UB & p-value(H0: Y[t] = F[t]) & P(F[t]>Y[t-1]) & P(F[t]>Y[t-s]) & P(F[t]>Y[60]) \tabularnewline
48 & 10443 & - & - & - & - & - & - & - \tabularnewline
49 & 10357 & - & - & - & - & - & - & - \tabularnewline
50 & 8586 & - & - & - & - & - & - & - \tabularnewline
51 & 8892 & - & - & - & - & - & - & - \tabularnewline
52 & 8329 & - & - & - & - & - & - & - \tabularnewline
53 & 8101 & - & - & - & - & - & - & - \tabularnewline
54 & 7922 & - & - & - & - & - & - & - \tabularnewline
55 & 8120 & - & - & - & - & - & - & - \tabularnewline
56 & 7838 & - & - & - & - & - & - & - \tabularnewline
57 & 7735 & - & - & - & - & - & - & - \tabularnewline
58 & 8406 & - & - & - & - & - & - & - \tabularnewline
59 & 8209 & - & - & - & - & - & - & - \tabularnewline
60 & 9451 & - & - & - & - & - & - & - \tabularnewline
61 & 10041 & 9727.2855 & 8955.5665 & 10499.0046 & 0.2128 & 0.7586 & 0.0549 & 0.7586 \tabularnewline
62 & 9411 & 8486.7582 & 7623.6495 & 9349.8669 & 0.0179 & 2e-04 & 0.4108 & 0.0143 \tabularnewline
63 & 10405 & 8956.0809 & 8059.6796 & 9852.4823 & 8e-04 & 0.1599 & 0.5557 & 0.1396 \tabularnewline
64 & 8467 & 8535.7871 & 7619.9201 & 9451.6541 & 0.4415 & 0 & 0.6709 & 0.0251 \tabularnewline
65 & 8464 & 8065.2671 & 7134.2119 & 8996.3222 & 0.2006 & 0.1989 & 0.47 & 0.0018 \tabularnewline
66 & 8102 & 7849.9754 & 6905.2967 & 8794.654 & 0.3005 & 0.1013 & 0.4406 & 4e-04 \tabularnewline
67 & 7627 & 8022.1962 & 7064.5611 & 8979.8314 & 0.2093 & 0.4351 & 0.4207 & 0.0017 \tabularnewline
68 & 7513 & 8052.7718 & 7082.5263 & 9023.0173 & 0.1378 & 0.8051 & 0.6678 & 0.0024 \tabularnewline
69 & 7510 & 7770.0555 & 6787.4253 & 8752.6858 & 0.302 & 0.6959 & 0.5279 & 4e-04 \tabularnewline
70 & 8291 & 8295.9384 & 7301.1012 & 9290.7757 & 0.4961 & 0.9392 & 0.4142 & 0.0114 \tabularnewline
71 & 8064 & 8202.281 & 7195.3936 & 9209.1685 & 0.3939 & 0.4314 & 0.4948 & 0.0075 \tabularnewline
72 & 9383 & 9788.3288 & 8769.5369 & 10807.1208 & 0.2178 & 0.9995 & 0.7418 & 0.7418 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114897&T=1

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast[/C][/ROW]
[ROW][C]time[/C][C]Y[t][/C][C]F[t][/C][C]95% LB[/C][C]95% UB[/C][C]p-value(H0: Y[t] = F[t])[/C][C]P(F[t]>Y[t-1])[/C][C]P(F[t]>Y[t-s])[/C][C]P(F[t]>Y[60])[/C][/ROW]
[ROW][C]48[/C][C]10443[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]10357[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]8586[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]8892[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]8329[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]8101[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]7922[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]8120[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]7838[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]7735[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]8406[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]8209[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]9451[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]10041[/C][C]9727.2855[/C][C]8955.5665[/C][C]10499.0046[/C][C]0.2128[/C][C]0.7586[/C][C]0.0549[/C][C]0.7586[/C][/ROW]
[ROW][C]62[/C][C]9411[/C][C]8486.7582[/C][C]7623.6495[/C][C]9349.8669[/C][C]0.0179[/C][C]2e-04[/C][C]0.4108[/C][C]0.0143[/C][/ROW]
[ROW][C]63[/C][C]10405[/C][C]8956.0809[/C][C]8059.6796[/C][C]9852.4823[/C][C]8e-04[/C][C]0.1599[/C][C]0.5557[/C][C]0.1396[/C][/ROW]
[ROW][C]64[/C][C]8467[/C][C]8535.7871[/C][C]7619.9201[/C][C]9451.6541[/C][C]0.4415[/C][C]0[/C][C]0.6709[/C][C]0.0251[/C][/ROW]
[ROW][C]65[/C][C]8464[/C][C]8065.2671[/C][C]7134.2119[/C][C]8996.3222[/C][C]0.2006[/C][C]0.1989[/C][C]0.47[/C][C]0.0018[/C][/ROW]
[ROW][C]66[/C][C]8102[/C][C]7849.9754[/C][C]6905.2967[/C][C]8794.654[/C][C]0.3005[/C][C]0.1013[/C][C]0.4406[/C][C]4e-04[/C][/ROW]
[ROW][C]67[/C][C]7627[/C][C]8022.1962[/C][C]7064.5611[/C][C]8979.8314[/C][C]0.2093[/C][C]0.4351[/C][C]0.4207[/C][C]0.0017[/C][/ROW]
[ROW][C]68[/C][C]7513[/C][C]8052.7718[/C][C]7082.5263[/C][C]9023.0173[/C][C]0.1378[/C][C]0.8051[/C][C]0.6678[/C][C]0.0024[/C][/ROW]
[ROW][C]69[/C][C]7510[/C][C]7770.0555[/C][C]6787.4253[/C][C]8752.6858[/C][C]0.302[/C][C]0.6959[/C][C]0.5279[/C][C]4e-04[/C][/ROW]
[ROW][C]70[/C][C]8291[/C][C]8295.9384[/C][C]7301.1012[/C][C]9290.7757[/C][C]0.4961[/C][C]0.9392[/C][C]0.4142[/C][C]0.0114[/C][/ROW]
[ROW][C]71[/C][C]8064[/C][C]8202.281[/C][C]7195.3936[/C][C]9209.1685[/C][C]0.3939[/C][C]0.4314[/C][C]0.4948[/C][C]0.0075[/C][/ROW]
[ROW][C]72[/C][C]9383[/C][C]9788.3288[/C][C]8769.5369[/C][C]10807.1208[/C][C]0.2178[/C][C]0.9995[/C][C]0.7418[/C][C]0.7418[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114897&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114897&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Univariate ARIMA Extrapolation Forecast
timeY[t]F[t]95% LB95% UBp-value(H0: Y[t] = F[t])P(F[t]>Y[t-1])P(F[t]>Y[t-s])P(F[t]>Y[60])
4810443-------
4910357-------
508586-------
518892-------
528329-------
538101-------
547922-------
558120-------
567838-------
577735-------
588406-------
598209-------
609451-------
61100419727.28558955.566510499.00460.21280.75860.05490.7586
6294118486.75827623.64959349.86690.01792e-040.41080.0143
63104058956.08098059.67969852.48238e-040.15990.55570.1396
6484678535.78717619.92019451.65410.441500.67090.0251
6584648065.26717134.21198996.32220.20060.19890.470.0018
6681027849.97546905.29678794.6540.30050.10130.44064e-04
6776278022.19627064.56118979.83140.20930.43510.42070.0017
6875138052.77187082.52639023.01730.13780.80510.66780.0024
6975107770.05556787.42538752.68580.3020.69590.52794e-04
7082918295.93847301.10129290.77570.49610.93920.41420.0114
7180648202.2817195.39369209.16850.39390.43140.49480.0075
7293839788.32888769.536910807.12080.21780.99950.74180.7418







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
610.04050.0323098416.759800
620.05190.10890.0706854222.8906476319.8252690.1593
630.05110.16180.1012099366.4411017335.36381008.6304
640.0547-0.00810.07774731.667764184.4396874.1764
650.05890.04940.0721158987.948643145.1413801.9633
660.06140.03210.065463516.4054546540.3519739.2837
670.0609-0.04930.0631156180.0606490774.596700.5531
680.0615-0.0670.0636291353.5751465846.9684682.5298
690.0645-0.03350.060367628.8672421600.5127649.3077
700.0612-6e-040.054324.388379442.9003615.9894
710.0626-0.01690.050919121.6461346686.4226588.8008
720.0531-0.04140.0501164291.4662331486.8429575.7489

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & 0.0405 & 0.0323 & 0 & 98416.7598 & 0 & 0 \tabularnewline
62 & 0.0519 & 0.1089 & 0.0706 & 854222.8906 & 476319.8252 & 690.1593 \tabularnewline
63 & 0.0511 & 0.1618 & 0.101 & 2099366.441 & 1017335.3638 & 1008.6304 \tabularnewline
64 & 0.0547 & -0.0081 & 0.0777 & 4731.667 & 764184.4396 & 874.1764 \tabularnewline
65 & 0.0589 & 0.0494 & 0.0721 & 158987.948 & 643145.1413 & 801.9633 \tabularnewline
66 & 0.0614 & 0.0321 & 0.0654 & 63516.4054 & 546540.3519 & 739.2837 \tabularnewline
67 & 0.0609 & -0.0493 & 0.0631 & 156180.0606 & 490774.596 & 700.5531 \tabularnewline
68 & 0.0615 & -0.067 & 0.0636 & 291353.5751 & 465846.9684 & 682.5298 \tabularnewline
69 & 0.0645 & -0.0335 & 0.0603 & 67628.8672 & 421600.5127 & 649.3077 \tabularnewline
70 & 0.0612 & -6e-04 & 0.0543 & 24.388 & 379442.9003 & 615.9894 \tabularnewline
71 & 0.0626 & -0.0169 & 0.0509 & 19121.6461 & 346686.4226 & 588.8008 \tabularnewline
72 & 0.0531 & -0.0414 & 0.0501 & 164291.4662 & 331486.8429 & 575.7489 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114897&T=2

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast Performance[/C][/ROW]
[ROW][C]time[/C][C]% S.E.[/C][C]PE[/C][C]MAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][/ROW]
[ROW][C]61[/C][C]0.0405[/C][C]0.0323[/C][C]0[/C][C]98416.7598[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]62[/C][C]0.0519[/C][C]0.1089[/C][C]0.0706[/C][C]854222.8906[/C][C]476319.8252[/C][C]690.1593[/C][/ROW]
[ROW][C]63[/C][C]0.0511[/C][C]0.1618[/C][C]0.101[/C][C]2099366.441[/C][C]1017335.3638[/C][C]1008.6304[/C][/ROW]
[ROW][C]64[/C][C]0.0547[/C][C]-0.0081[/C][C]0.0777[/C][C]4731.667[/C][C]764184.4396[/C][C]874.1764[/C][/ROW]
[ROW][C]65[/C][C]0.0589[/C][C]0.0494[/C][C]0.0721[/C][C]158987.948[/C][C]643145.1413[/C][C]801.9633[/C][/ROW]
[ROW][C]66[/C][C]0.0614[/C][C]0.0321[/C][C]0.0654[/C][C]63516.4054[/C][C]546540.3519[/C][C]739.2837[/C][/ROW]
[ROW][C]67[/C][C]0.0609[/C][C]-0.0493[/C][C]0.0631[/C][C]156180.0606[/C][C]490774.596[/C][C]700.5531[/C][/ROW]
[ROW][C]68[/C][C]0.0615[/C][C]-0.067[/C][C]0.0636[/C][C]291353.5751[/C][C]465846.9684[/C][C]682.5298[/C][/ROW]
[ROW][C]69[/C][C]0.0645[/C][C]-0.0335[/C][C]0.0603[/C][C]67628.8672[/C][C]421600.5127[/C][C]649.3077[/C][/ROW]
[ROW][C]70[/C][C]0.0612[/C][C]-6e-04[/C][C]0.0543[/C][C]24.388[/C][C]379442.9003[/C][C]615.9894[/C][/ROW]
[ROW][C]71[/C][C]0.0626[/C][C]-0.0169[/C][C]0.0509[/C][C]19121.6461[/C][C]346686.4226[/C][C]588.8008[/C][/ROW]
[ROW][C]72[/C][C]0.0531[/C][C]-0.0414[/C][C]0.0501[/C][C]164291.4662[/C][C]331486.8429[/C][C]575.7489[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114897&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114897&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
610.04050.0323098416.759800
620.05190.10890.0706854222.8906476319.8252690.1593
630.05110.16180.1012099366.4411017335.36381008.6304
640.0547-0.00810.07774731.667764184.4396874.1764
650.05890.04940.0721158987.948643145.1413801.9633
660.06140.03210.065463516.4054546540.3519739.2837
670.0609-0.04930.0631156180.0606490774.596700.5531
680.0615-0.0670.0636291353.5751465846.9684682.5298
690.0645-0.03350.060367628.8672421600.5127649.3077
700.0612-6e-040.054324.388379442.9003615.9894
710.0626-0.01690.050919121.6461346686.4226588.8008
720.0531-0.04140.0501164291.4662331486.8429575.7489



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 1 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 1 ; par9 = 0 ; par10 = FALSE ;
R code (references can be found in the software module):
par1 <- as.numeric(par1) #cut off periods
par2 <- as.numeric(par2) #lambda
par3 <- as.numeric(par3) #degree of non-seasonal differencing
par4 <- as.numeric(par4) #degree of seasonal differencing
par5 <- as.numeric(par5) #seasonal period
par6 <- as.numeric(par6) #p
par7 <- as.numeric(par7) #q
par8 <- as.numeric(par8) #P
par9 <- as.numeric(par9) #Q
if (par10 == 'TRUE') par10 <- TRUE
if (par10 == 'FALSE') par10 <- FALSE
if (par2 == 0) x <- log(x)
if (par2 != 0) x <- x^par2
lx <- length(x)
first <- lx - 2*par1
nx <- lx - par1
nx1 <- nx + 1
fx <- lx - nx
if (fx < 1) {
fx <- par5
nx1 <- lx + fx - 1
first <- lx - 2*fx
}
first <- 1
if (fx < 3) fx <- round(lx/10,0)
(arima.out <- arima(x[1:nx], order=c(par6,par3,par7), seasonal=list(order=c(par8,par4,par9), period=par5), include.mean=par10, method='ML'))
(forecast <- predict(arima.out,par1))
(lb <- forecast$pred - 1.96 * forecast$se)
(ub <- forecast$pred + 1.96 * forecast$se)
if (par2 == 0) {
x <- exp(x)
forecast$pred <- exp(forecast$pred)
lb <- exp(lb)
ub <- exp(ub)
}
if (par2 != 0) {
x <- x^(1/par2)
forecast$pred <- forecast$pred^(1/par2)
lb <- lb^(1/par2)
ub <- ub^(1/par2)
}
if (par2 < 0) {
olb <- lb
lb <- ub
ub <- olb
}
(actandfor <- c(x[1:nx], forecast$pred))
(perc.se <- (ub-forecast$pred)/1.96/forecast$pred)
bitmap(file='test1.png')
opar <- par(mar=c(4,4,2,2),las=1)
ylim <- c( min(x[first:nx],lb), max(x[first:nx],ub))
plot(x,ylim=ylim,type='n',xlim=c(first,lx))
usr <- par('usr')
rect(usr[1],usr[3],nx+1,usr[4],border=NA,col='lemonchiffon')
rect(nx1,usr[3],usr[2],usr[4],border=NA,col='lavender')
abline(h= (-3:3)*2 , col ='gray', lty =3)
polygon( c(nx1:lx,lx:nx1), c(lb,rev(ub)), col = 'orange', lty=2,border=NA)
lines(nx1:lx, lb , lty=2)
lines(nx1:lx, ub , lty=2)
lines(x, lwd=2)
lines(nx1:lx, forecast$pred , lwd=2 , col ='white')
box()
par(opar)
dev.off()
prob.dec <- array(NA, dim=fx)
prob.sdec <- array(NA, dim=fx)
prob.ldec <- array(NA, dim=fx)
prob.pval <- array(NA, dim=fx)
perf.pe <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- array(0, dim=fx)
perf.mse1 <- array(0, dim=fx)
perf.rmse <- array(0, dim=fx)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / forecast$pred[i]
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
prob.dec[i] = pnorm((x[nx+i-1] - forecast$pred[i]) / locSD)
prob.sdec[i] = pnorm((x[nx+i-par5] - forecast$pred[i]) / locSD)
prob.ldec[i] = pnorm((x[nx] - forecast$pred[i]) / locSD)
prob.pval[i] = pnorm(abs(x[nx+i] - forecast$pred[i]) / locSD)
}
perf.mape[1] = abs(perf.pe[1])
perf.mse[1] = abs(perf.se[1])
for (i in 2:fx) {
perf.mape[i] = perf.mape[i-1] + abs(perf.pe[i])
perf.mape1[i] = perf.mape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
}
perf.rmse = sqrt(perf.mse1)
bitmap(file='test2.png')
plot(forecast$pred, pch=19, type='b',main='ARIMA Extrapolation Forecast', ylab='Forecast and 95% CI', xlab='time',ylim=c(min(lb),max(ub)))
dum <- forecast$pred
dum[1:par1] <- x[(nx+1):lx]
lines(dum, lty=1)
lines(ub,lty=3)
lines(lb,lty=3)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Univariate ARIMA Extrapolation Forecast',9,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'Y[t]',1,header=TRUE)
a<-table.element(a,'F[t]',1,header=TRUE)
a<-table.element(a,'95% LB',1,header=TRUE)
a<-table.element(a,'95% UB',1,header=TRUE)
a<-table.element(a,'p-value
(H0: Y[t] = F[t])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-1])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-s])',1,header=TRUE)
mylab <- paste('P(F[t]>Y[',nx,sep='')
mylab <- paste(mylab,'])',sep='')
a<-table.element(a,mylab,1,header=TRUE)
a<-table.row.end(a)
for (i in (nx-par5):nx) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,x[i])
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.row.end(a)
}
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(x[nx+i],4))
a<-table.element(a,round(forecast$pred[i],4))
a<-table.element(a,round(lb[i],4))
a<-table.element(a,round(ub[i],4))
a<-table.element(a,round((1-prob.pval[i]),4))
a<-table.element(a,round((1-prob.dec[i]),4))
a<-table.element(a,round((1-prob.sdec[i]),4))
a<-table.element(a,round((1-prob.ldec[i]),4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Univariate ARIMA Extrapolation Forecast Performance',7,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'% S.E.',1,header=TRUE)
a<-table.element(a,'PE',1,header=TRUE)
a<-table.element(a,'MAPE',1,header=TRUE)
a<-table.element(a,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',1,header=TRUE)
a<-table.row.end(a)
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(perc.se[i],4))
a<-table.element(a,round(perf.pe[i],4))
a<-table.element(a,round(perf.mape1[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse1[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')