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, 20 Dec 2013 11:14:36 -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/2013/Dec/20/t1387556093js3topadsmy6g6c.htm/, Retrieved Thu, 18 Apr 2024 13:39:35 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=232468, Retrieved Thu, 18 Apr 2024 13:39:35 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact145
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2013-12-20 16:14:36] [9e6a405f514733ea23d87e4507d39d29] [Current]
Feedback Forum

Post a new message
Dataseries X:
56
55
54
52
72
71
56
46
47
47
48
50
44
38
33
33
52
54
39
22
31
31
38
42
41
31
36
34
51
47
31
19
30
33
36
40
32
25
28
29
55
55
40
38
44
41
49
59
61
47
43
39
66
68
63
68
67
59
68
78
82
70
62
68
94
102
100
104
103
93
110
114
120
102
95
103
122
139
135
135
137
130
148
148
145
128
131
133
146
163
151
157
152
149
172
167
160
150
160
165
171
179
171
176
170
169
194
196
188
174
186
191
197
206
197
204
201
190
213
213




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ wold.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 & 3 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ wold.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=232468&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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ wold.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=232468&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=232468&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 time3 seconds
R Server'Herman Ole Andreas Wold' @ wold.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[108])
96167-------
97160-------
98150-------
99160-------
100165-------
101171-------
102179-------
103171-------
104176-------
105170-------
106169-------
107194-------
108196-------
109188190.01180.1974199.82270.3440.115810.1158
110174181.4529167.5757195.33010.14630.177610.02
111186190.01173.014207.0060.32190.96760.99970.2449
112191194.2886174.6633213.91390.37130.79610.99830.4321
113197199.4228177.4811221.36460.41430.77410.99440.6201
114206206.2685182.2325230.30460.49130.77510.98690.7988
115197199.4228173.461225.38470.42740.30980.98410.602
116204203.7014175.947231.45580.49160.6820.97480.7067
117201198.5671169.1292228.00510.43570.35880.97140.5679
118190197.7114166.6811228.74180.31310.41770.96510.543
119213219.1042186.5593251.64910.35660.96020.93470.918
120213220.8157186.8236254.80770.32610.67390.92380.9238

\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[108]) \tabularnewline
96 & 167 & - & - & - & - & - & - & - \tabularnewline
97 & 160 & - & - & - & - & - & - & - \tabularnewline
98 & 150 & - & - & - & - & - & - & - \tabularnewline
99 & 160 & - & - & - & - & - & - & - \tabularnewline
100 & 165 & - & - & - & - & - & - & - \tabularnewline
101 & 171 & - & - & - & - & - & - & - \tabularnewline
102 & 179 & - & - & - & - & - & - & - \tabularnewline
103 & 171 & - & - & - & - & - & - & - \tabularnewline
104 & 176 & - & - & - & - & - & - & - \tabularnewline
105 & 170 & - & - & - & - & - & - & - \tabularnewline
106 & 169 & - & - & - & - & - & - & - \tabularnewline
107 & 194 & - & - & - & - & - & - & - \tabularnewline
108 & 196 & - & - & - & - & - & - & - \tabularnewline
109 & 188 & 190.01 & 180.1974 & 199.8227 & 0.344 & 0.1158 & 1 & 0.1158 \tabularnewline
110 & 174 & 181.4529 & 167.5757 & 195.3301 & 0.1463 & 0.1776 & 1 & 0.02 \tabularnewline
111 & 186 & 190.01 & 173.014 & 207.006 & 0.3219 & 0.9676 & 0.9997 & 0.2449 \tabularnewline
112 & 191 & 194.2886 & 174.6633 & 213.9139 & 0.3713 & 0.7961 & 0.9983 & 0.4321 \tabularnewline
113 & 197 & 199.4228 & 177.4811 & 221.3646 & 0.4143 & 0.7741 & 0.9944 & 0.6201 \tabularnewline
114 & 206 & 206.2685 & 182.2325 & 230.3046 & 0.4913 & 0.7751 & 0.9869 & 0.7988 \tabularnewline
115 & 197 & 199.4228 & 173.461 & 225.3847 & 0.4274 & 0.3098 & 0.9841 & 0.602 \tabularnewline
116 & 204 & 203.7014 & 175.947 & 231.4558 & 0.4916 & 0.682 & 0.9748 & 0.7067 \tabularnewline
117 & 201 & 198.5671 & 169.1292 & 228.0051 & 0.4357 & 0.3588 & 0.9714 & 0.5679 \tabularnewline
118 & 190 & 197.7114 & 166.6811 & 228.7418 & 0.3131 & 0.4177 & 0.9651 & 0.543 \tabularnewline
119 & 213 & 219.1042 & 186.5593 & 251.6491 & 0.3566 & 0.9602 & 0.9347 & 0.918 \tabularnewline
120 & 213 & 220.8157 & 186.8236 & 254.8077 & 0.3261 & 0.6739 & 0.9238 & 0.9238 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=232468&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[108])[/C][/ROW]
[ROW][C]96[/C][C]167[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]160[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]150[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]160[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]165[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]171[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]179[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]171[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]176[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]170[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]169[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]194[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]196[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]188[/C][C]190.01[/C][C]180.1974[/C][C]199.8227[/C][C]0.344[/C][C]0.1158[/C][C]1[/C][C]0.1158[/C][/ROW]
[ROW][C]110[/C][C]174[/C][C]181.4529[/C][C]167.5757[/C][C]195.3301[/C][C]0.1463[/C][C]0.1776[/C][C]1[/C][C]0.02[/C][/ROW]
[ROW][C]111[/C][C]186[/C][C]190.01[/C][C]173.014[/C][C]207.006[/C][C]0.3219[/C][C]0.9676[/C][C]0.9997[/C][C]0.2449[/C][/ROW]
[ROW][C]112[/C][C]191[/C][C]194.2886[/C][C]174.6633[/C][C]213.9139[/C][C]0.3713[/C][C]0.7961[/C][C]0.9983[/C][C]0.4321[/C][/ROW]
[ROW][C]113[/C][C]197[/C][C]199.4228[/C][C]177.4811[/C][C]221.3646[/C][C]0.4143[/C][C]0.7741[/C][C]0.9944[/C][C]0.6201[/C][/ROW]
[ROW][C]114[/C][C]206[/C][C]206.2685[/C][C]182.2325[/C][C]230.3046[/C][C]0.4913[/C][C]0.7751[/C][C]0.9869[/C][C]0.7988[/C][/ROW]
[ROW][C]115[/C][C]197[/C][C]199.4228[/C][C]173.461[/C][C]225.3847[/C][C]0.4274[/C][C]0.3098[/C][C]0.9841[/C][C]0.602[/C][/ROW]
[ROW][C]116[/C][C]204[/C][C]203.7014[/C][C]175.947[/C][C]231.4558[/C][C]0.4916[/C][C]0.682[/C][C]0.9748[/C][C]0.7067[/C][/ROW]
[ROW][C]117[/C][C]201[/C][C]198.5671[/C][C]169.1292[/C][C]228.0051[/C][C]0.4357[/C][C]0.3588[/C][C]0.9714[/C][C]0.5679[/C][/ROW]
[ROW][C]118[/C][C]190[/C][C]197.7114[/C][C]166.6811[/C][C]228.7418[/C][C]0.3131[/C][C]0.4177[/C][C]0.9651[/C][C]0.543[/C][/ROW]
[ROW][C]119[/C][C]213[/C][C]219.1042[/C][C]186.5593[/C][C]251.6491[/C][C]0.3566[/C][C]0.9602[/C][C]0.9347[/C][C]0.918[/C][/ROW]
[ROW][C]120[/C][C]213[/C][C]220.8157[/C][C]186.8236[/C][C]254.8077[/C][C]0.3261[/C][C]0.6739[/C][C]0.9238[/C][C]0.9238[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=232468&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=232468&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[108])
96167-------
97160-------
98150-------
99160-------
100165-------
101171-------
102179-------
103171-------
104176-------
105170-------
106169-------
107194-------
108196-------
109188190.01180.1974199.82270.3440.115810.1158
110174181.4529167.5757195.33010.14630.177610.02
111186190.01173.014207.0060.32190.96760.99970.2449
112191194.2886174.6633213.91390.37130.79610.99830.4321
113197199.4228177.4811221.36460.41430.77410.99440.6201
114206206.2685182.2325230.30460.49130.77510.98690.7988
115197199.4228173.461225.38470.42740.30980.98410.602
116204203.7014175.947231.45580.49160.6820.97480.7067
117201198.5671169.1292228.00510.43570.35880.97140.5679
118190197.7114166.6811228.74180.31310.41770.96510.543
119213219.1042186.5593251.64910.35660.96020.93470.918
120213220.8157186.8236254.80770.32610.67390.92380.9238







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1090.0263-0.01070.01070.01064.040200-0.22330.2233
1100.039-0.04280.02680.026355.545629.79295.4583-0.82810.5257
1110.0456-0.02160.0250.024616.080225.2225.0221-0.44560.499
1120.0515-0.01720.02310.022710.814721.62024.6497-0.36540.4656
1130.0561-0.01230.02090.02065.870218.47024.2977-0.26920.4263
1140.0595-0.00130.01770.01740.072115.40383.9248-0.02980.3602
1150.0664-0.01230.01690.01675.870214.04193.7472-0.26920.3472
1160.06950.00150.0150.01480.089212.29783.50680.03320.308
1170.07560.01210.01460.01455.918811.5893.40430.27030.3038
1180.0801-0.04060.01720.01759.466116.37674.0468-0.85680.3591
1190.0758-0.02870.01830.01837.261718.27544.275-0.67820.3881
1200.0785-0.03670.01980.019561.084521.84284.6736-0.86840.4281

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
109 & 0.0263 & -0.0107 & 0.0107 & 0.0106 & 4.0402 & 0 & 0 & -0.2233 & 0.2233 \tabularnewline
110 & 0.039 & -0.0428 & 0.0268 & 0.0263 & 55.5456 & 29.7929 & 5.4583 & -0.8281 & 0.5257 \tabularnewline
111 & 0.0456 & -0.0216 & 0.025 & 0.0246 & 16.0802 & 25.222 & 5.0221 & -0.4456 & 0.499 \tabularnewline
112 & 0.0515 & -0.0172 & 0.0231 & 0.0227 & 10.8147 & 21.6202 & 4.6497 & -0.3654 & 0.4656 \tabularnewline
113 & 0.0561 & -0.0123 & 0.0209 & 0.0206 & 5.8702 & 18.4702 & 4.2977 & -0.2692 & 0.4263 \tabularnewline
114 & 0.0595 & -0.0013 & 0.0177 & 0.0174 & 0.0721 & 15.4038 & 3.9248 & -0.0298 & 0.3602 \tabularnewline
115 & 0.0664 & -0.0123 & 0.0169 & 0.0167 & 5.8702 & 14.0419 & 3.7472 & -0.2692 & 0.3472 \tabularnewline
116 & 0.0695 & 0.0015 & 0.015 & 0.0148 & 0.0892 & 12.2978 & 3.5068 & 0.0332 & 0.308 \tabularnewline
117 & 0.0756 & 0.0121 & 0.0146 & 0.0145 & 5.9188 & 11.589 & 3.4043 & 0.2703 & 0.3038 \tabularnewline
118 & 0.0801 & -0.0406 & 0.0172 & 0.017 & 59.4661 & 16.3767 & 4.0468 & -0.8568 & 0.3591 \tabularnewline
119 & 0.0758 & -0.0287 & 0.0183 & 0.018 & 37.2617 & 18.2754 & 4.275 & -0.6782 & 0.3881 \tabularnewline
120 & 0.0785 & -0.0367 & 0.0198 & 0.0195 & 61.0845 & 21.8428 & 4.6736 & -0.8684 & 0.4281 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=232468&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]109[/C][C]0.0263[/C][C]-0.0107[/C][C]0.0107[/C][C]0.0106[/C][C]4.0402[/C][C]0[/C][C]0[/C][C]-0.2233[/C][C]0.2233[/C][/ROW]
[ROW][C]110[/C][C]0.039[/C][C]-0.0428[/C][C]0.0268[/C][C]0.0263[/C][C]55.5456[/C][C]29.7929[/C][C]5.4583[/C][C]-0.8281[/C][C]0.5257[/C][/ROW]
[ROW][C]111[/C][C]0.0456[/C][C]-0.0216[/C][C]0.025[/C][C]0.0246[/C][C]16.0802[/C][C]25.222[/C][C]5.0221[/C][C]-0.4456[/C][C]0.499[/C][/ROW]
[ROW][C]112[/C][C]0.0515[/C][C]-0.0172[/C][C]0.0231[/C][C]0.0227[/C][C]10.8147[/C][C]21.6202[/C][C]4.6497[/C][C]-0.3654[/C][C]0.4656[/C][/ROW]
[ROW][C]113[/C][C]0.0561[/C][C]-0.0123[/C][C]0.0209[/C][C]0.0206[/C][C]5.8702[/C][C]18.4702[/C][C]4.2977[/C][C]-0.2692[/C][C]0.4263[/C][/ROW]
[ROW][C]114[/C][C]0.0595[/C][C]-0.0013[/C][C]0.0177[/C][C]0.0174[/C][C]0.0721[/C][C]15.4038[/C][C]3.9248[/C][C]-0.0298[/C][C]0.3602[/C][/ROW]
[ROW][C]115[/C][C]0.0664[/C][C]-0.0123[/C][C]0.0169[/C][C]0.0167[/C][C]5.8702[/C][C]14.0419[/C][C]3.7472[/C][C]-0.2692[/C][C]0.3472[/C][/ROW]
[ROW][C]116[/C][C]0.0695[/C][C]0.0015[/C][C]0.015[/C][C]0.0148[/C][C]0.0892[/C][C]12.2978[/C][C]3.5068[/C][C]0.0332[/C][C]0.308[/C][/ROW]
[ROW][C]117[/C][C]0.0756[/C][C]0.0121[/C][C]0.0146[/C][C]0.0145[/C][C]5.9188[/C][C]11.589[/C][C]3.4043[/C][C]0.2703[/C][C]0.3038[/C][/ROW]
[ROW][C]118[/C][C]0.0801[/C][C]-0.0406[/C][C]0.0172[/C][C]0.017[/C][C]59.4661[/C][C]16.3767[/C][C]4.0468[/C][C]-0.8568[/C][C]0.3591[/C][/ROW]
[ROW][C]119[/C][C]0.0758[/C][C]-0.0287[/C][C]0.0183[/C][C]0.018[/C][C]37.2617[/C][C]18.2754[/C][C]4.275[/C][C]-0.6782[/C][C]0.3881[/C][/ROW]
[ROW][C]120[/C][C]0.0785[/C][C]-0.0367[/C][C]0.0198[/C][C]0.0195[/C][C]61.0845[/C][C]21.8428[/C][C]4.6736[/C][C]-0.8684[/C][C]0.4281[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=232468&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=232468&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1090.0263-0.01070.01070.01064.040200-0.22330.2233
1100.039-0.04280.02680.026355.545629.79295.4583-0.82810.5257
1110.0456-0.02160.0250.024616.080225.2225.0221-0.44560.499
1120.0515-0.01720.02310.022710.814721.62024.6497-0.36540.4656
1130.0561-0.01230.02090.02065.870218.47024.2977-0.26920.4263
1140.0595-0.00130.01770.01740.072115.40383.9248-0.02980.3602
1150.0664-0.01230.01690.01675.870214.04193.7472-0.26920.3472
1160.06950.00150.0150.01480.089212.29783.50680.03320.308
1170.07560.01210.01460.01455.918811.5893.40430.27030.3038
1180.0801-0.04060.01720.01759.466116.37674.0468-0.85680.3591
1190.0758-0.02870.01830.01837.261718.27544.275-0.67820.3881
1200.0785-0.03670.01980.019561.084521.84284.6736-0.86840.4281



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; par7 = 0 ; par8 = 1 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; par7 = 0 ; 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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')