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, 06 Dec 2013 14:34:05 -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/06/t1386358566basbiiyy9d4orjh.htm/, Retrieved Tue, 23 Apr 2024 19:40:36 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=231349, Retrieved Tue, 23 Apr 2024 19:40:36 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact79
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2013-12-06 19:34:05] [be82f1b59bd963d0cf04f5c957f6be33] [Current]
Feedback Forum

Post a new message
Dataseries X:
41
39
50
40
43
38
44
35
39
35
29
49
50
59
63
32
39
47
53
60
57
52
70
90
74
62
55
84
94
70
108
139
120
97
126
149
158
124
140
109
114
77
120
133
110
92
97
78
99
107
112
90
98
125
155
190
236
189
174
178
136
161
171
149
184
155
276
224
213
279
268
287
238
213
257
293
212
246
353
339
308
247
257
322
298
273
312
249
286
279
309
401
309
328
353
354
327
324
285
243
241
287
355
460
364
487
452
391
500
451
375
372
302
316
398
394
431
431




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'George Udny Yule' @ yule.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 & 5 seconds \tabularnewline
R Server & 'George Udny Yule' @ yule.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=231349&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]5 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'George Udny Yule' @ yule.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=231349&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=231349&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 time5 seconds
R Server'George Udny Yule' @ yule.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[106])
94328-------
95353-------
96354-------
97327-------
98324-------
99285-------
100243-------
101241-------
102287-------
103355-------
104460-------
105364-------
106487-------
107452444.2913320.5758609.43140.46360.30610.86070.3061
108391480.2799329.3177690.89830.2030.60380.880.4751
109500460.1301300.4401692.52250.36830.72010.86920.4104
110451450.9753281.892706.41940.49990.35340.8350.3911
111375470.8022283.5495762.81490.26010.55290.89380.4567
112372429.179247.8992722.09960.3510.64150.89360.3494
113302444.0408248.2163769.35760.19610.66790.88940.3979
114316437.7077236.5446781.54920.24390.78040.80490.3894
115398529.083280.5812960.62540.27580.83340.78540.5758
116394560.1154289.53481040.18110.24880.7460.65860.6173
117431529.4844265.02961011.46550.34440.70920.74950.5686
118431517.6604251.69761014.23760.36620.63380.54820.5482

\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[106]) \tabularnewline
94 & 328 & - & - & - & - & - & - & - \tabularnewline
95 & 353 & - & - & - & - & - & - & - \tabularnewline
96 & 354 & - & - & - & - & - & - & - \tabularnewline
97 & 327 & - & - & - & - & - & - & - \tabularnewline
98 & 324 & - & - & - & - & - & - & - \tabularnewline
99 & 285 & - & - & - & - & - & - & - \tabularnewline
100 & 243 & - & - & - & - & - & - & - \tabularnewline
101 & 241 & - & - & - & - & - & - & - \tabularnewline
102 & 287 & - & - & - & - & - & - & - \tabularnewline
103 & 355 & - & - & - & - & - & - & - \tabularnewline
104 & 460 & - & - & - & - & - & - & - \tabularnewline
105 & 364 & - & - & - & - & - & - & - \tabularnewline
106 & 487 & - & - & - & - & - & - & - \tabularnewline
107 & 452 & 444.2913 & 320.5758 & 609.4314 & 0.4636 & 0.3061 & 0.8607 & 0.3061 \tabularnewline
108 & 391 & 480.2799 & 329.3177 & 690.8983 & 0.203 & 0.6038 & 0.88 & 0.4751 \tabularnewline
109 & 500 & 460.1301 & 300.4401 & 692.5225 & 0.3683 & 0.7201 & 0.8692 & 0.4104 \tabularnewline
110 & 451 & 450.9753 & 281.892 & 706.4194 & 0.4999 & 0.3534 & 0.835 & 0.3911 \tabularnewline
111 & 375 & 470.8022 & 283.5495 & 762.8149 & 0.2601 & 0.5529 & 0.8938 & 0.4567 \tabularnewline
112 & 372 & 429.179 & 247.8992 & 722.0996 & 0.351 & 0.6415 & 0.8936 & 0.3494 \tabularnewline
113 & 302 & 444.0408 & 248.2163 & 769.3576 & 0.1961 & 0.6679 & 0.8894 & 0.3979 \tabularnewline
114 & 316 & 437.7077 & 236.5446 & 781.5492 & 0.2439 & 0.7804 & 0.8049 & 0.3894 \tabularnewline
115 & 398 & 529.083 & 280.5812 & 960.6254 & 0.2758 & 0.8334 & 0.7854 & 0.5758 \tabularnewline
116 & 394 & 560.1154 & 289.5348 & 1040.1811 & 0.2488 & 0.746 & 0.6586 & 0.6173 \tabularnewline
117 & 431 & 529.4844 & 265.0296 & 1011.4655 & 0.3444 & 0.7092 & 0.7495 & 0.5686 \tabularnewline
118 & 431 & 517.6604 & 251.6976 & 1014.2376 & 0.3662 & 0.6338 & 0.5482 & 0.5482 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=231349&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[106])[/C][/ROW]
[ROW][C]94[/C][C]328[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]353[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]354[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]327[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]324[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]285[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]243[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]241[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]287[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]355[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]460[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]364[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]487[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]452[/C][C]444.2913[/C][C]320.5758[/C][C]609.4314[/C][C]0.4636[/C][C]0.3061[/C][C]0.8607[/C][C]0.3061[/C][/ROW]
[ROW][C]108[/C][C]391[/C][C]480.2799[/C][C]329.3177[/C][C]690.8983[/C][C]0.203[/C][C]0.6038[/C][C]0.88[/C][C]0.4751[/C][/ROW]
[ROW][C]109[/C][C]500[/C][C]460.1301[/C][C]300.4401[/C][C]692.5225[/C][C]0.3683[/C][C]0.7201[/C][C]0.8692[/C][C]0.4104[/C][/ROW]
[ROW][C]110[/C][C]451[/C][C]450.9753[/C][C]281.892[/C][C]706.4194[/C][C]0.4999[/C][C]0.3534[/C][C]0.835[/C][C]0.3911[/C][/ROW]
[ROW][C]111[/C][C]375[/C][C]470.8022[/C][C]283.5495[/C][C]762.8149[/C][C]0.2601[/C][C]0.5529[/C][C]0.8938[/C][C]0.4567[/C][/ROW]
[ROW][C]112[/C][C]372[/C][C]429.179[/C][C]247.8992[/C][C]722.0996[/C][C]0.351[/C][C]0.6415[/C][C]0.8936[/C][C]0.3494[/C][/ROW]
[ROW][C]113[/C][C]302[/C][C]444.0408[/C][C]248.2163[/C][C]769.3576[/C][C]0.1961[/C][C]0.6679[/C][C]0.8894[/C][C]0.3979[/C][/ROW]
[ROW][C]114[/C][C]316[/C][C]437.7077[/C][C]236.5446[/C][C]781.5492[/C][C]0.2439[/C][C]0.7804[/C][C]0.8049[/C][C]0.3894[/C][/ROW]
[ROW][C]115[/C][C]398[/C][C]529.083[/C][C]280.5812[/C][C]960.6254[/C][C]0.2758[/C][C]0.8334[/C][C]0.7854[/C][C]0.5758[/C][/ROW]
[ROW][C]116[/C][C]394[/C][C]560.1154[/C][C]289.5348[/C][C]1040.1811[/C][C]0.2488[/C][C]0.746[/C][C]0.6586[/C][C]0.6173[/C][/ROW]
[ROW][C]117[/C][C]431[/C][C]529.4844[/C][C]265.0296[/C][C]1011.4655[/C][C]0.3444[/C][C]0.7092[/C][C]0.7495[/C][C]0.5686[/C][/ROW]
[ROW][C]118[/C][C]431[/C][C]517.6604[/C][C]251.6976[/C][C]1014.2376[/C][C]0.3662[/C][C]0.6338[/C][C]0.5482[/C][C]0.5482[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=231349&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=231349&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[106])
94328-------
95353-------
96354-------
97327-------
98324-------
99285-------
100243-------
101241-------
102287-------
103355-------
104460-------
105364-------
106487-------
107452444.2913320.5758609.43140.46360.30610.86070.3061
108391480.2799329.3177690.89830.2030.60380.880.4751
109500460.1301300.4401692.52250.36830.72010.86920.4104
110451450.9753281.892706.41940.49990.35340.8350.3911
111375470.8022283.5495762.81490.26010.55290.89380.4567
112372429.179247.8992722.09960.3510.64150.89360.3494
113302444.0408248.2163769.35760.19610.66790.88940.3979
114316437.7077236.5446781.54920.24390.78040.80490.3894
115398529.083280.5812960.62540.27580.83340.78540.5758
116394560.1154289.53481040.18110.24880.7460.65860.6173
117431529.4844265.02961011.46550.34440.70920.74950.5686
118431517.6604251.69761014.23760.36620.63380.54820.5482







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1070.18960.01710.01710.017259.4244000.16790.1679
1080.2237-0.22830.12270.11117970.90684015.165663.3653-1.94471.0563
1090.25770.07970.10840.10171589.61193206.647756.62730.86850.9937
1100.2891e-040.08130.07636e-042404.985949.04075e-040.7454
1110.3165-0.25550.11610.10649178.06813759.602461.3156-2.08681.0137
1120.3482-0.15370.12240.11243269.43683677.908160.6458-1.24551.0523
1130.3738-0.47030.17210.150820175.66034.721277.6835-3.0941.344
1140.4008-0.38520.19870.172314812.77537131.97884.451-2.65111.5074
1150.4161-0.32940.21320.184617182.74628248.7390.8225-2.85531.6571
1160.4373-0.42160.23410.200927594.332410183.2903100.9123-3.61841.8533
1170.4644-0.22850.23360.20139699.185710139.2808100.694-2.14521.8798
1180.4894-0.20110.23090.19987510.02969920.176599.6001-1.88771.8804

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
107 & 0.1896 & 0.0171 & 0.0171 & 0.0172 & 59.4244 & 0 & 0 & 0.1679 & 0.1679 \tabularnewline
108 & 0.2237 & -0.2283 & 0.1227 & 0.1111 & 7970.9068 & 4015.1656 & 63.3653 & -1.9447 & 1.0563 \tabularnewline
109 & 0.2577 & 0.0797 & 0.1084 & 0.1017 & 1589.6119 & 3206.6477 & 56.6273 & 0.8685 & 0.9937 \tabularnewline
110 & 0.289 & 1e-04 & 0.0813 & 0.0763 & 6e-04 & 2404.9859 & 49.0407 & 5e-04 & 0.7454 \tabularnewline
111 & 0.3165 & -0.2555 & 0.1161 & 0.1064 & 9178.0681 & 3759.6024 & 61.3156 & -2.0868 & 1.0137 \tabularnewline
112 & 0.3482 & -0.1537 & 0.1224 & 0.1124 & 3269.4368 & 3677.9081 & 60.6458 & -1.2455 & 1.0523 \tabularnewline
113 & 0.3738 & -0.4703 & 0.1721 & 0.1508 & 20175.6 & 6034.7212 & 77.6835 & -3.094 & 1.344 \tabularnewline
114 & 0.4008 & -0.3852 & 0.1987 & 0.1723 & 14812.7753 & 7131.978 & 84.451 & -2.6511 & 1.5074 \tabularnewline
115 & 0.4161 & -0.3294 & 0.2132 & 0.1846 & 17182.7462 & 8248.73 & 90.8225 & -2.8553 & 1.6571 \tabularnewline
116 & 0.4373 & -0.4216 & 0.2341 & 0.2009 & 27594.3324 & 10183.2903 & 100.9123 & -3.6184 & 1.8533 \tabularnewline
117 & 0.4644 & -0.2285 & 0.2336 & 0.2013 & 9699.1857 & 10139.2808 & 100.694 & -2.1452 & 1.8798 \tabularnewline
118 & 0.4894 & -0.2011 & 0.2309 & 0.1998 & 7510.0296 & 9920.1765 & 99.6001 & -1.8877 & 1.8804 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=231349&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]107[/C][C]0.1896[/C][C]0.0171[/C][C]0.0171[/C][C]0.0172[/C][C]59.4244[/C][C]0[/C][C]0[/C][C]0.1679[/C][C]0.1679[/C][/ROW]
[ROW][C]108[/C][C]0.2237[/C][C]-0.2283[/C][C]0.1227[/C][C]0.1111[/C][C]7970.9068[/C][C]4015.1656[/C][C]63.3653[/C][C]-1.9447[/C][C]1.0563[/C][/ROW]
[ROW][C]109[/C][C]0.2577[/C][C]0.0797[/C][C]0.1084[/C][C]0.1017[/C][C]1589.6119[/C][C]3206.6477[/C][C]56.6273[/C][C]0.8685[/C][C]0.9937[/C][/ROW]
[ROW][C]110[/C][C]0.289[/C][C]1e-04[/C][C]0.0813[/C][C]0.0763[/C][C]6e-04[/C][C]2404.9859[/C][C]49.0407[/C][C]5e-04[/C][C]0.7454[/C][/ROW]
[ROW][C]111[/C][C]0.3165[/C][C]-0.2555[/C][C]0.1161[/C][C]0.1064[/C][C]9178.0681[/C][C]3759.6024[/C][C]61.3156[/C][C]-2.0868[/C][C]1.0137[/C][/ROW]
[ROW][C]112[/C][C]0.3482[/C][C]-0.1537[/C][C]0.1224[/C][C]0.1124[/C][C]3269.4368[/C][C]3677.9081[/C][C]60.6458[/C][C]-1.2455[/C][C]1.0523[/C][/ROW]
[ROW][C]113[/C][C]0.3738[/C][C]-0.4703[/C][C]0.1721[/C][C]0.1508[/C][C]20175.6[/C][C]6034.7212[/C][C]77.6835[/C][C]-3.094[/C][C]1.344[/C][/ROW]
[ROW][C]114[/C][C]0.4008[/C][C]-0.3852[/C][C]0.1987[/C][C]0.1723[/C][C]14812.7753[/C][C]7131.978[/C][C]84.451[/C][C]-2.6511[/C][C]1.5074[/C][/ROW]
[ROW][C]115[/C][C]0.4161[/C][C]-0.3294[/C][C]0.2132[/C][C]0.1846[/C][C]17182.7462[/C][C]8248.73[/C][C]90.8225[/C][C]-2.8553[/C][C]1.6571[/C][/ROW]
[ROW][C]116[/C][C]0.4373[/C][C]-0.4216[/C][C]0.2341[/C][C]0.2009[/C][C]27594.3324[/C][C]10183.2903[/C][C]100.9123[/C][C]-3.6184[/C][C]1.8533[/C][/ROW]
[ROW][C]117[/C][C]0.4644[/C][C]-0.2285[/C][C]0.2336[/C][C]0.2013[/C][C]9699.1857[/C][C]10139.2808[/C][C]100.694[/C][C]-2.1452[/C][C]1.8798[/C][/ROW]
[ROW][C]118[/C][C]0.4894[/C][C]-0.2011[/C][C]0.2309[/C][C]0.1998[/C][C]7510.0296[/C][C]9920.1765[/C][C]99.6001[/C][C]-1.8877[/C][C]1.8804[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=231349&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=231349&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
1070.18960.01710.01710.017259.4244000.16790.1679
1080.2237-0.22830.12270.11117970.90684015.165663.3653-1.94471.0563
1090.25770.07970.10840.10171589.61193206.647756.62730.86850.9937
1100.2891e-040.08130.07636e-042404.985949.04075e-040.7454
1110.3165-0.25550.11610.10649178.06813759.602461.3156-2.08681.0137
1120.3482-0.15370.12240.11243269.43683677.908160.6458-1.24551.0523
1130.3738-0.47030.17210.150820175.66034.721277.6835-3.0941.344
1140.4008-0.38520.19870.172314812.77537131.97884.451-2.65111.5074
1150.4161-0.32940.21320.184617182.74628248.7390.8225-2.85531.6571
1160.4373-0.42160.23410.200927594.332410183.2903100.9123-3.61841.8533
1170.4644-0.22850.23360.20139699.185710139.2808100.694-2.14521.8798
1180.4894-0.20110.23090.19987510.02969920.176599.6001-1.88771.8804



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