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 computationSat, 15 Dec 2012 07:14:28 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2012/Dec/15/t1355574066bafejpucpjk345p.htm/, Retrieved Tue, 30 Apr 2024 17:46:48 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=199867, Retrieved Tue, 30 Apr 2024 17:46:48 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact115
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [Paper Arima Forec...] [2012-12-15 11:29:10] [86dcce9422b96d4554cb918e531c1d5d]
- R P   [ARIMA Forecasting] [Paper Arima Forec...] [2012-12-15 11:36:22] [86dcce9422b96d4554cb918e531c1d5d]
-    D      [ARIMA Forecasting] [Paper Arima Forec...] [2012-12-15 12:14:28] [c63d55528b56cf8bb48e0b5d1a959d8e] [Current]
Feedback Forum

Post a new message
Dataseries X:
68.897
38.683
44.720
39.525
45.315
50.380
40.600
36.279
42.438
38.064
31.879
11.379
70.249
39.253
47.060
41.697
38.708
49.267
39.018
32.228
40.870
39.383
34.571
12.066
70.938
34.077
45.409
40.809
37.013
44.953
37.848
32.745
43.412
34.931
33.008
8.620
68.906
39.556
50.669
36.432
40.891
48.428
36.222
33.425
39.401
37.967
34.801
12.657
69.116
41.519
51.321
38.529
41.547
52.073
38.401
40.898
40.439
41.888
37.898
8.771
68.184
50.530
47.221
41.756
45.633
48.138
39.486
39.341
41.117
41.629
29.722
7.054
56.676
34.870
35.117
30.169
30.936
35.699
33.228
27.733
33.666
35.429
27.438
8.170
63.410
38.040
45.389
37.353
37.024
50.957
37.994
36.454
46.080
43.373
37.395
10.963
76.058
50.179
57.452
47.568
50.050
50.856
41.992
39.284
44.521
43.832
41.153
17.100




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

\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' @ jenkins.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=199867&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' @ jenkins.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=199867&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=199867&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' @ jenkins.wessa.net







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[96])
848.17-------
8563.41-------
8638.04-------
8745.389-------
8837.353-------
8937.024-------
9050.957-------
9137.994-------
9236.454-------
9346.08-------
9443.373-------
9537.395-------
9610.963-------
9776.05869.051262.568975.53350.017110.9561
9850.17943.734537.009350.45970.030200.95151
9957.45247.636140.146755.12550.00510.25290.72181
10047.56841.07732.27649.8780.07421e-040.79651
10150.0541.782632.474851.09050.04090.11160.84181
10250.85650.359440.254260.46470.46160.52390.45391
10341.99241.149430.26952.02990.43970.04020.71511
10439.28438.602427.143150.06180.45360.2810.64341
10544.52144.891232.76257.02040.47610.81760.42381
10643.83243.967831.228956.70660.49170.46610.53651
10741.15337.196523.901150.49190.27990.1640.48830.9999
10817.113.3983-0.46727.26370.300400.63470.6347

\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[96]) \tabularnewline
84 & 8.17 & - & - & - & - & - & - & - \tabularnewline
85 & 63.41 & - & - & - & - & - & - & - \tabularnewline
86 & 38.04 & - & - & - & - & - & - & - \tabularnewline
87 & 45.389 & - & - & - & - & - & - & - \tabularnewline
88 & 37.353 & - & - & - & - & - & - & - \tabularnewline
89 & 37.024 & - & - & - & - & - & - & - \tabularnewline
90 & 50.957 & - & - & - & - & - & - & - \tabularnewline
91 & 37.994 & - & - & - & - & - & - & - \tabularnewline
92 & 36.454 & - & - & - & - & - & - & - \tabularnewline
93 & 46.08 & - & - & - & - & - & - & - \tabularnewline
94 & 43.373 & - & - & - & - & - & - & - \tabularnewline
95 & 37.395 & - & - & - & - & - & - & - \tabularnewline
96 & 10.963 & - & - & - & - & - & - & - \tabularnewline
97 & 76.058 & 69.0512 & 62.5689 & 75.5335 & 0.0171 & 1 & 0.956 & 1 \tabularnewline
98 & 50.179 & 43.7345 & 37.0093 & 50.4597 & 0.0302 & 0 & 0.9515 & 1 \tabularnewline
99 & 57.452 & 47.6361 & 40.1467 & 55.1255 & 0.0051 & 0.2529 & 0.7218 & 1 \tabularnewline
100 & 47.568 & 41.077 & 32.276 & 49.878 & 0.0742 & 1e-04 & 0.7965 & 1 \tabularnewline
101 & 50.05 & 41.7826 & 32.4748 & 51.0905 & 0.0409 & 0.1116 & 0.8418 & 1 \tabularnewline
102 & 50.856 & 50.3594 & 40.2542 & 60.4647 & 0.4616 & 0.5239 & 0.4539 & 1 \tabularnewline
103 & 41.992 & 41.1494 & 30.269 & 52.0299 & 0.4397 & 0.0402 & 0.7151 & 1 \tabularnewline
104 & 39.284 & 38.6024 & 27.1431 & 50.0618 & 0.4536 & 0.281 & 0.6434 & 1 \tabularnewline
105 & 44.521 & 44.8912 & 32.762 & 57.0204 & 0.4761 & 0.8176 & 0.4238 & 1 \tabularnewline
106 & 43.832 & 43.9678 & 31.2289 & 56.7066 & 0.4917 & 0.4661 & 0.5365 & 1 \tabularnewline
107 & 41.153 & 37.1965 & 23.9011 & 50.4919 & 0.2799 & 0.164 & 0.4883 & 0.9999 \tabularnewline
108 & 17.1 & 13.3983 & -0.467 & 27.2637 & 0.3004 & 0 & 0.6347 & 0.6347 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=199867&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[96])[/C][/ROW]
[ROW][C]84[/C][C]8.17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]63.41[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]38.04[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]45.389[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]37.353[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]37.024[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]50.957[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]37.994[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]36.454[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]46.08[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]43.373[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]37.395[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]10.963[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]76.058[/C][C]69.0512[/C][C]62.5689[/C][C]75.5335[/C][C]0.0171[/C][C]1[/C][C]0.956[/C][C]1[/C][/ROW]
[ROW][C]98[/C][C]50.179[/C][C]43.7345[/C][C]37.0093[/C][C]50.4597[/C][C]0.0302[/C][C]0[/C][C]0.9515[/C][C]1[/C][/ROW]
[ROW][C]99[/C][C]57.452[/C][C]47.6361[/C][C]40.1467[/C][C]55.1255[/C][C]0.0051[/C][C]0.2529[/C][C]0.7218[/C][C]1[/C][/ROW]
[ROW][C]100[/C][C]47.568[/C][C]41.077[/C][C]32.276[/C][C]49.878[/C][C]0.0742[/C][C]1e-04[/C][C]0.7965[/C][C]1[/C][/ROW]
[ROW][C]101[/C][C]50.05[/C][C]41.7826[/C][C]32.4748[/C][C]51.0905[/C][C]0.0409[/C][C]0.1116[/C][C]0.8418[/C][C]1[/C][/ROW]
[ROW][C]102[/C][C]50.856[/C][C]50.3594[/C][C]40.2542[/C][C]60.4647[/C][C]0.4616[/C][C]0.5239[/C][C]0.4539[/C][C]1[/C][/ROW]
[ROW][C]103[/C][C]41.992[/C][C]41.1494[/C][C]30.269[/C][C]52.0299[/C][C]0.4397[/C][C]0.0402[/C][C]0.7151[/C][C]1[/C][/ROW]
[ROW][C]104[/C][C]39.284[/C][C]38.6024[/C][C]27.1431[/C][C]50.0618[/C][C]0.4536[/C][C]0.281[/C][C]0.6434[/C][C]1[/C][/ROW]
[ROW][C]105[/C][C]44.521[/C][C]44.8912[/C][C]32.762[/C][C]57.0204[/C][C]0.4761[/C][C]0.8176[/C][C]0.4238[/C][C]1[/C][/ROW]
[ROW][C]106[/C][C]43.832[/C][C]43.9678[/C][C]31.2289[/C][C]56.7066[/C][C]0.4917[/C][C]0.4661[/C][C]0.5365[/C][C]1[/C][/ROW]
[ROW][C]107[/C][C]41.153[/C][C]37.1965[/C][C]23.9011[/C][C]50.4919[/C][C]0.2799[/C][C]0.164[/C][C]0.4883[/C][C]0.9999[/C][/ROW]
[ROW][C]108[/C][C]17.1[/C][C]13.3983[/C][C]-0.467[/C][C]27.2637[/C][C]0.3004[/C][C]0[/C][C]0.6347[/C][C]0.6347[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=199867&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=199867&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[96])
848.17-------
8563.41-------
8638.04-------
8745.389-------
8837.353-------
8937.024-------
9050.957-------
9137.994-------
9236.454-------
9346.08-------
9443.373-------
9537.395-------
9610.963-------
9776.05869.051262.568975.53350.017110.9561
9850.17943.734537.009350.45970.030200.95151
9957.45247.636140.146755.12550.00510.25290.72181
10047.56841.07732.27649.8780.07421e-040.79651
10150.0541.782632.474851.09050.04090.11160.84181
10250.85650.359440.254260.46470.46160.52390.45391
10341.99241.149430.26952.02990.43970.04020.71511
10439.28438.602427.143150.06180.45360.2810.64341
10544.52144.891232.76257.02040.47610.81760.42381
10643.83243.967831.228956.70660.49170.46610.53651
10741.15337.196523.901150.49190.27990.1640.48830.9999
10817.113.3983-0.46727.26370.300400.63470.6347







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
970.04790.1015049.09500
980.07850.14740.124441.531945.31346.7315
990.08020.20610.151696.352362.32647.8947
1000.10930.1580.153242.132957.2787.5682
1010.11370.19790.162268.349759.49247.7131
1020.10240.00990.13680.246649.61817.044
1030.13490.02050.12020.709942.63126.5293
1040.15150.01770.10730.464637.36046.1123
1050.1379-0.00820.09630.137133.22445.7641
1060.1478-0.00310.0870.018429.90385.4684
1070.18240.10640.088815.65428.60845.3487
1080.5280.27630.104413.702427.36625.2313

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
97 & 0.0479 & 0.1015 & 0 & 49.095 & 0 & 0 \tabularnewline
98 & 0.0785 & 0.1474 & 0.1244 & 41.5319 & 45.3134 & 6.7315 \tabularnewline
99 & 0.0802 & 0.2061 & 0.1516 & 96.3523 & 62.3264 & 7.8947 \tabularnewline
100 & 0.1093 & 0.158 & 0.1532 & 42.1329 & 57.278 & 7.5682 \tabularnewline
101 & 0.1137 & 0.1979 & 0.1622 & 68.3497 & 59.4924 & 7.7131 \tabularnewline
102 & 0.1024 & 0.0099 & 0.1368 & 0.2466 & 49.6181 & 7.044 \tabularnewline
103 & 0.1349 & 0.0205 & 0.1202 & 0.7099 & 42.6312 & 6.5293 \tabularnewline
104 & 0.1515 & 0.0177 & 0.1073 & 0.4646 & 37.3604 & 6.1123 \tabularnewline
105 & 0.1379 & -0.0082 & 0.0963 & 0.1371 & 33.2244 & 5.7641 \tabularnewline
106 & 0.1478 & -0.0031 & 0.087 & 0.0184 & 29.9038 & 5.4684 \tabularnewline
107 & 0.1824 & 0.1064 & 0.0888 & 15.654 & 28.6084 & 5.3487 \tabularnewline
108 & 0.528 & 0.2763 & 0.1044 & 13.7024 & 27.3662 & 5.2313 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=199867&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]97[/C][C]0.0479[/C][C]0.1015[/C][C]0[/C][C]49.095[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]98[/C][C]0.0785[/C][C]0.1474[/C][C]0.1244[/C][C]41.5319[/C][C]45.3134[/C][C]6.7315[/C][/ROW]
[ROW][C]99[/C][C]0.0802[/C][C]0.2061[/C][C]0.1516[/C][C]96.3523[/C][C]62.3264[/C][C]7.8947[/C][/ROW]
[ROW][C]100[/C][C]0.1093[/C][C]0.158[/C][C]0.1532[/C][C]42.1329[/C][C]57.278[/C][C]7.5682[/C][/ROW]
[ROW][C]101[/C][C]0.1137[/C][C]0.1979[/C][C]0.1622[/C][C]68.3497[/C][C]59.4924[/C][C]7.7131[/C][/ROW]
[ROW][C]102[/C][C]0.1024[/C][C]0.0099[/C][C]0.1368[/C][C]0.2466[/C][C]49.6181[/C][C]7.044[/C][/ROW]
[ROW][C]103[/C][C]0.1349[/C][C]0.0205[/C][C]0.1202[/C][C]0.7099[/C][C]42.6312[/C][C]6.5293[/C][/ROW]
[ROW][C]104[/C][C]0.1515[/C][C]0.0177[/C][C]0.1073[/C][C]0.4646[/C][C]37.3604[/C][C]6.1123[/C][/ROW]
[ROW][C]105[/C][C]0.1379[/C][C]-0.0082[/C][C]0.0963[/C][C]0.1371[/C][C]33.2244[/C][C]5.7641[/C][/ROW]
[ROW][C]106[/C][C]0.1478[/C][C]-0.0031[/C][C]0.087[/C][C]0.0184[/C][C]29.9038[/C][C]5.4684[/C][/ROW]
[ROW][C]107[/C][C]0.1824[/C][C]0.1064[/C][C]0.0888[/C][C]15.654[/C][C]28.6084[/C][C]5.3487[/C][/ROW]
[ROW][C]108[/C][C]0.528[/C][C]0.2763[/C][C]0.1044[/C][C]13.7024[/C][C]27.3662[/C][C]5.2313[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=199867&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=199867&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
970.04790.1015049.09500
980.07850.14740.124441.531945.31346.7315
990.08020.20610.151696.352362.32647.8947
1000.10930.1580.153242.132957.2787.5682
1010.11370.19790.162268.349759.49247.7131
1020.10240.00990.13680.246649.61817.044
1030.13490.02050.12020.709942.63126.5293
1040.15150.01770.10730.464637.36046.1123
1050.1379-0.00820.09630.137133.22445.7641
1060.1478-0.00310.0870.018429.90385.4684
1070.18240.10640.088815.65428.60845.3487
1080.5280.27630.104413.702427.36625.2313



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; 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')