Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 09 Dec 2008 10:49:57 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2008/Dec/09/t1228845354v0xkgtxak1ejdt3.htm/, Retrieved Fri, 17 May 2024 05:03:20 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=31635, Retrieved Fri, 17 May 2024 05:03:20 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact212
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [(Partial) Autocorrelation Function] [(P)ACF Transportm...] [2008-12-04 18:19:15] [65eec331235880e0070acfba94c20cfa]
- RMPD    [ARIMA Forecasting] [ARIMA Forecasting...] [2008-12-09 17:49:57] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
100,8
105,3
116,1
112,8
114,5
117,2
77,1
80,1
120,3
133,4
109,4
93,2
91,2
99,2
108,2
101,5
106,9
104,4
77,9
60
99,5
95
105,6
102,5
93,3
97,3
127
111,7
96,4
133
72,2
95,8
124,1
127,6
110,7
104,6
112,7
115,3
139,4
119
97,4
154
81,5
88,8
127,7
105,1
114,9
106,4
104,5
121,6
141,4
99
126,7
134,1
81,3
88,6
132,7
132,9
134,4
103,7
119,7
115
132,9
108,5
113,9
142
97,7
92,2
128,8
134,9
128,2
114,8
117,9




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24

\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 & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=31635&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]'Sir Ronald Aylmer Fisher' @ 193.190.124.24[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=31635&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=31635&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'Sir Ronald Aylmer Fisher' @ 193.190.124.24







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[61])
49104.5-------
50121.6-------
51141.4-------
5299-------
53126.7-------
54134.1-------
5581.3-------
5688.6-------
57132.7-------
58132.9-------
59134.4-------
60103.7-------
61119.7-------
62115128.062899.3472156.77840.18630.71590.67040.7159
63132.9147.047117.6904176.40350.17240.98380.64690.9661
64108.5103.934274.0976133.77080.38210.02850.62710.1502
65113.9131.0113100.8133161.20930.13340.9280.61020.7686
66142137.8671107.3961168.33810.39520.93840.59570.8787
6797.784.591653.9138115.26930.20121e-040.58330.0124
6892.291.476160.6413122.31080.48160.34620.57250.0364
69128.8135.213104.259166.1670.34230.99680.56320.837
70134.9135.0958104.051166.14060.49510.65450.55510.8345
71128.2136.3186105.2047167.43250.30450.53560.54810.8524
72114.8105.376474.2098136.5430.27670.07560.5420.1839
73117.9121.164889.9581152.37150.41880.65530.53670.5367

\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[61]) \tabularnewline
49 & 104.5 & - & - & - & - & - & - & - \tabularnewline
50 & 121.6 & - & - & - & - & - & - & - \tabularnewline
51 & 141.4 & - & - & - & - & - & - & - \tabularnewline
52 & 99 & - & - & - & - & - & - & - \tabularnewline
53 & 126.7 & - & - & - & - & - & - & - \tabularnewline
54 & 134.1 & - & - & - & - & - & - & - \tabularnewline
55 & 81.3 & - & - & - & - & - & - & - \tabularnewline
56 & 88.6 & - & - & - & - & - & - & - \tabularnewline
57 & 132.7 & - & - & - & - & - & - & - \tabularnewline
58 & 132.9 & - & - & - & - & - & - & - \tabularnewline
59 & 134.4 & - & - & - & - & - & - & - \tabularnewline
60 & 103.7 & - & - & - & - & - & - & - \tabularnewline
61 & 119.7 & - & - & - & - & - & - & - \tabularnewline
62 & 115 & 128.0628 & 99.3472 & 156.7784 & 0.1863 & 0.7159 & 0.6704 & 0.7159 \tabularnewline
63 & 132.9 & 147.047 & 117.6904 & 176.4035 & 0.1724 & 0.9838 & 0.6469 & 0.9661 \tabularnewline
64 & 108.5 & 103.9342 & 74.0976 & 133.7708 & 0.3821 & 0.0285 & 0.6271 & 0.1502 \tabularnewline
65 & 113.9 & 131.0113 & 100.8133 & 161.2093 & 0.1334 & 0.928 & 0.6102 & 0.7686 \tabularnewline
66 & 142 & 137.8671 & 107.3961 & 168.3381 & 0.3952 & 0.9384 & 0.5957 & 0.8787 \tabularnewline
67 & 97.7 & 84.5916 & 53.9138 & 115.2693 & 0.2012 & 1e-04 & 0.5833 & 0.0124 \tabularnewline
68 & 92.2 & 91.4761 & 60.6413 & 122.3108 & 0.4816 & 0.3462 & 0.5725 & 0.0364 \tabularnewline
69 & 128.8 & 135.213 & 104.259 & 166.167 & 0.3423 & 0.9968 & 0.5632 & 0.837 \tabularnewline
70 & 134.9 & 135.0958 & 104.051 & 166.1406 & 0.4951 & 0.6545 & 0.5551 & 0.8345 \tabularnewline
71 & 128.2 & 136.3186 & 105.2047 & 167.4325 & 0.3045 & 0.5356 & 0.5481 & 0.8524 \tabularnewline
72 & 114.8 & 105.3764 & 74.2098 & 136.543 & 0.2767 & 0.0756 & 0.542 & 0.1839 \tabularnewline
73 & 117.9 & 121.1648 & 89.9581 & 152.3715 & 0.4188 & 0.6553 & 0.5367 & 0.5367 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=31635&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[61])[/C][/ROW]
[ROW][C]49[/C][C]104.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]121.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]141.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]99[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]126.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]134.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]81.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]88.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]132.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]132.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]134.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]103.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]119.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]115[/C][C]128.0628[/C][C]99.3472[/C][C]156.7784[/C][C]0.1863[/C][C]0.7159[/C][C]0.6704[/C][C]0.7159[/C][/ROW]
[ROW][C]63[/C][C]132.9[/C][C]147.047[/C][C]117.6904[/C][C]176.4035[/C][C]0.1724[/C][C]0.9838[/C][C]0.6469[/C][C]0.9661[/C][/ROW]
[ROW][C]64[/C][C]108.5[/C][C]103.9342[/C][C]74.0976[/C][C]133.7708[/C][C]0.3821[/C][C]0.0285[/C][C]0.6271[/C][C]0.1502[/C][/ROW]
[ROW][C]65[/C][C]113.9[/C][C]131.0113[/C][C]100.8133[/C][C]161.2093[/C][C]0.1334[/C][C]0.928[/C][C]0.6102[/C][C]0.7686[/C][/ROW]
[ROW][C]66[/C][C]142[/C][C]137.8671[/C][C]107.3961[/C][C]168.3381[/C][C]0.3952[/C][C]0.9384[/C][C]0.5957[/C][C]0.8787[/C][/ROW]
[ROW][C]67[/C][C]97.7[/C][C]84.5916[/C][C]53.9138[/C][C]115.2693[/C][C]0.2012[/C][C]1e-04[/C][C]0.5833[/C][C]0.0124[/C][/ROW]
[ROW][C]68[/C][C]92.2[/C][C]91.4761[/C][C]60.6413[/C][C]122.3108[/C][C]0.4816[/C][C]0.3462[/C][C]0.5725[/C][C]0.0364[/C][/ROW]
[ROW][C]69[/C][C]128.8[/C][C]135.213[/C][C]104.259[/C][C]166.167[/C][C]0.3423[/C][C]0.9968[/C][C]0.5632[/C][C]0.837[/C][/ROW]
[ROW][C]70[/C][C]134.9[/C][C]135.0958[/C][C]104.051[/C][C]166.1406[/C][C]0.4951[/C][C]0.6545[/C][C]0.5551[/C][C]0.8345[/C][/ROW]
[ROW][C]71[/C][C]128.2[/C][C]136.3186[/C][C]105.2047[/C][C]167.4325[/C][C]0.3045[/C][C]0.5356[/C][C]0.5481[/C][C]0.8524[/C][/ROW]
[ROW][C]72[/C][C]114.8[/C][C]105.3764[/C][C]74.2098[/C][C]136.543[/C][C]0.2767[/C][C]0.0756[/C][C]0.542[/C][C]0.1839[/C][/ROW]
[ROW][C]73[/C][C]117.9[/C][C]121.1648[/C][C]89.9581[/C][C]152.3715[/C][C]0.4188[/C][C]0.6553[/C][C]0.5367[/C][C]0.5367[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=31635&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=31635&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[61])
49104.5-------
50121.6-------
51141.4-------
5299-------
53126.7-------
54134.1-------
5581.3-------
5688.6-------
57132.7-------
58132.9-------
59134.4-------
60103.7-------
61119.7-------
62115128.062899.3472156.77840.18630.71590.67040.7159
63132.9147.047117.6904176.40350.17240.98380.64690.9661
64108.5103.934274.0976133.77080.38210.02850.62710.1502
65113.9131.0113100.8133161.20930.13340.9280.61020.7686
66142137.8671107.3961168.33810.39520.93840.59570.8787
6797.784.591653.9138115.26930.20121e-040.58330.0124
6892.291.476160.6413122.31080.48160.34620.57250.0364
69128.8135.213104.259166.1670.34230.99680.56320.837
70134.9135.0958104.051166.14060.49510.65450.55510.8345
71128.2136.3186105.2047167.43250.30450.53560.54810.8524
72114.8105.376474.2098136.5430.27670.07560.5420.1839
73117.9121.164889.9581152.37150.41880.65530.53670.5367







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
620.1144-0.1020.0085170.636514.21973.7709
630.1019-0.09620.008200.137116.67814.0839
640.14650.04390.003720.8471.73721.318
650.1176-0.13060.0109292.796824.39974.9396
660.11280.030.002517.0811.42341.1931
670.1850.1550.0129171.831314.31933.7841
680.1720.00797e-040.52410.04370.209
690.1168-0.04740.00441.12673.42721.8513
700.1172-0.00141e-040.03830.00320.0565
710.1165-0.05960.00565.91185.49262.3436
720.15090.08940.007588.80397.40032.7204
730.1314-0.02690.002210.65890.88820.9425

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
62 & 0.1144 & -0.102 & 0.0085 & 170.6365 & 14.2197 & 3.7709 \tabularnewline
63 & 0.1019 & -0.0962 & 0.008 & 200.1371 & 16.6781 & 4.0839 \tabularnewline
64 & 0.1465 & 0.0439 & 0.0037 & 20.847 & 1.7372 & 1.318 \tabularnewline
65 & 0.1176 & -0.1306 & 0.0109 & 292.7968 & 24.3997 & 4.9396 \tabularnewline
66 & 0.1128 & 0.03 & 0.0025 & 17.081 & 1.4234 & 1.1931 \tabularnewline
67 & 0.185 & 0.155 & 0.0129 & 171.8313 & 14.3193 & 3.7841 \tabularnewline
68 & 0.172 & 0.0079 & 7e-04 & 0.5241 & 0.0437 & 0.209 \tabularnewline
69 & 0.1168 & -0.0474 & 0.004 & 41.1267 & 3.4272 & 1.8513 \tabularnewline
70 & 0.1172 & -0.0014 & 1e-04 & 0.0383 & 0.0032 & 0.0565 \tabularnewline
71 & 0.1165 & -0.0596 & 0.005 & 65.9118 & 5.4926 & 2.3436 \tabularnewline
72 & 0.1509 & 0.0894 & 0.0075 & 88.8039 & 7.4003 & 2.7204 \tabularnewline
73 & 0.1314 & -0.0269 & 0.0022 & 10.6589 & 0.8882 & 0.9425 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=31635&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]62[/C][C]0.1144[/C][C]-0.102[/C][C]0.0085[/C][C]170.6365[/C][C]14.2197[/C][C]3.7709[/C][/ROW]
[ROW][C]63[/C][C]0.1019[/C][C]-0.0962[/C][C]0.008[/C][C]200.1371[/C][C]16.6781[/C][C]4.0839[/C][/ROW]
[ROW][C]64[/C][C]0.1465[/C][C]0.0439[/C][C]0.0037[/C][C]20.847[/C][C]1.7372[/C][C]1.318[/C][/ROW]
[ROW][C]65[/C][C]0.1176[/C][C]-0.1306[/C][C]0.0109[/C][C]292.7968[/C][C]24.3997[/C][C]4.9396[/C][/ROW]
[ROW][C]66[/C][C]0.1128[/C][C]0.03[/C][C]0.0025[/C][C]17.081[/C][C]1.4234[/C][C]1.1931[/C][/ROW]
[ROW][C]67[/C][C]0.185[/C][C]0.155[/C][C]0.0129[/C][C]171.8313[/C][C]14.3193[/C][C]3.7841[/C][/ROW]
[ROW][C]68[/C][C]0.172[/C][C]0.0079[/C][C]7e-04[/C][C]0.5241[/C][C]0.0437[/C][C]0.209[/C][/ROW]
[ROW][C]69[/C][C]0.1168[/C][C]-0.0474[/C][C]0.004[/C][C]41.1267[/C][C]3.4272[/C][C]1.8513[/C][/ROW]
[ROW][C]70[/C][C]0.1172[/C][C]-0.0014[/C][C]1e-04[/C][C]0.0383[/C][C]0.0032[/C][C]0.0565[/C][/ROW]
[ROW][C]71[/C][C]0.1165[/C][C]-0.0596[/C][C]0.005[/C][C]65.9118[/C][C]5.4926[/C][C]2.3436[/C][/ROW]
[ROW][C]72[/C][C]0.1509[/C][C]0.0894[/C][C]0.0075[/C][C]88.8039[/C][C]7.4003[/C][C]2.7204[/C][/ROW]
[ROW][C]73[/C][C]0.1314[/C][C]-0.0269[/C][C]0.0022[/C][C]10.6589[/C][C]0.8882[/C][C]0.9425[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=31635&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=31635&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
620.1144-0.1020.0085170.636514.21973.7709
630.1019-0.09620.008200.137116.67814.0839
640.14650.04390.003720.8471.73721.318
650.1176-0.13060.0109292.796824.39974.9396
660.11280.030.002517.0811.42341.1931
670.1850.1550.0129171.831314.31933.7841
680.1720.00797e-040.52410.04370.209
690.1168-0.04740.00441.12673.42721.8513
700.1172-0.00141e-040.03830.00320.0565
710.1165-0.05960.00565.91185.49262.3436
720.15090.08940.007588.80397.40032.7204
730.1314-0.02690.002210.65890.88820.9425



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 0 ; 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,fx))
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')