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 computationMon, 15 Dec 2008 12:32:32 -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/15/t1229370824mwcedgrfmr8aq6f.htm/, Retrieved Wed, 15 May 2024 13:56:15 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=33794, Retrieved Wed, 15 May 2024 13:56:15 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact167
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F       [ARIMA Forecasting] [Opdracht ARIMA Fo...] [2008-12-15 19:32:32] [5e9e099b83e50415d7642e10d74756e4] [Current]
Feedback Forum
2008-12-18 15:30:07 [Peter Melgers] [reply
Gebruikte techniek: ARIMA forecast

Hierbij zijn alle juiste parameters ingevuld. (niet de maximale)
Seasonal period: 12
Testing period = 12 (alles wordt berekend zonder de laatste 12 perioden)


De computer gaat een voorspelling maken van de volgende 12 perioden en vergelijkt deze met de 12 perioden die zijn weggevallen.

Step 1

Bij observatie 52 t/m 63 staan de werkelijke en voorspelde waarden van de weggevallen 12 observaties.

Y(t) = werkelijke waarden
F(t) = forecast / voorspelde waarden

Ook het 95%-betrouwbaarheidsinterval is weergegeven in de tabel:

95% LB = ondergrens (lower bound)
95% UB = bovengrens (upper bound)

Met een waarschijnlijkheid van 95% zal de voorspelling tussen deze waarden liggen. Indien alle omstandigheden blijven zoals ze waren (Ceteris Paribus).

De p-value is ook weergegeven. Deze gaat uit van de nullhypothese dat de voorspelde waarden en de werkelijke waarden niet significant verschillend zijn (en het verschil dus aan toeval te wijten is).

Als de p-waarde kleiner is als 5% gaat het om een significant verschil tussen de werkelijke waarde en de voorspelde waarde. Deze waarde zal bijgevolg ook buiten het betrouwbaarheidsinterval liggen.

Een interpretatie maken lijkt mij niet veel zin te hebben aangezien niet de juiste parameters zijn ingegeven.



Post a new message
Dataseries X:
269645
267037
258113
262813
267413
267366
264777
258863
254844
254868
277267
285351
286602
283042
276687
277915
277128
277103
275037
270150
267140
264993
287259
291186
292300
288186
281477
282656
280190
280408
276836
275216
274352
271311
289802
290726
292300
278506
269826
265861
269034
264176
255198
253353
246057
235372
258556
260993
254663
250643
243422
247105
248541
245039
237080
237085
225554
226839
247934
248333
246969
245098
246263




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33794&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'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[51])
39269826-------
40265861-------
41269034-------
42264176-------
43255198-------
44253353-------
45246057-------
46235372-------
47258556-------
48260993-------
49254663-------
50250643-------
51243422-------
52247105239603.7598233097.762246109.75750.01190.12500.125
53248541243928.5659234971.6479252885.4840.15640.243500.5441
54245039242640.7653231233.4296254048.10090.34010.15531e-040.4466
55237080235143.4386220112.1773250174.69990.40030.09850.00450.1402
56237085231956.5561214061.2239249851.88830.28720.28730.00960.1046
57225554227327.401207163.8106247490.99140.43160.17140.03430.0589
58226839220598.3863197957.1476243239.62490.29450.3340.10050.0241
59247934243055.048218088.9926268021.10350.35080.89850.11180.4885
60248333247288.6095220359.0135274218.20550.46970.48130.15930.6108
61246969244560.8101215731.7134273389.90680.4350.39880.24610.5309
62245098240451.6045209796.3624271106.84660.38320.33840.25730.4247
63246263233260.9822200951.1249265570.83940.21510.23640.26880.2688

\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[51]) \tabularnewline
39 & 269826 & - & - & - & - & - & - & - \tabularnewline
40 & 265861 & - & - & - & - & - & - & - \tabularnewline
41 & 269034 & - & - & - & - & - & - & - \tabularnewline
42 & 264176 & - & - & - & - & - & - & - \tabularnewline
43 & 255198 & - & - & - & - & - & - & - \tabularnewline
44 & 253353 & - & - & - & - & - & - & - \tabularnewline
45 & 246057 & - & - & - & - & - & - & - \tabularnewline
46 & 235372 & - & - & - & - & - & - & - \tabularnewline
47 & 258556 & - & - & - & - & - & - & - \tabularnewline
48 & 260993 & - & - & - & - & - & - & - \tabularnewline
49 & 254663 & - & - & - & - & - & - & - \tabularnewline
50 & 250643 & - & - & - & - & - & - & - \tabularnewline
51 & 243422 & - & - & - & - & - & - & - \tabularnewline
52 & 247105 & 239603.7598 & 233097.762 & 246109.7575 & 0.0119 & 0.125 & 0 & 0.125 \tabularnewline
53 & 248541 & 243928.5659 & 234971.6479 & 252885.484 & 0.1564 & 0.2435 & 0 & 0.5441 \tabularnewline
54 & 245039 & 242640.7653 & 231233.4296 & 254048.1009 & 0.3401 & 0.1553 & 1e-04 & 0.4466 \tabularnewline
55 & 237080 & 235143.4386 & 220112.1773 & 250174.6999 & 0.4003 & 0.0985 & 0.0045 & 0.1402 \tabularnewline
56 & 237085 & 231956.5561 & 214061.2239 & 249851.8883 & 0.2872 & 0.2873 & 0.0096 & 0.1046 \tabularnewline
57 & 225554 & 227327.401 & 207163.8106 & 247490.9914 & 0.4316 & 0.1714 & 0.0343 & 0.0589 \tabularnewline
58 & 226839 & 220598.3863 & 197957.1476 & 243239.6249 & 0.2945 & 0.334 & 0.1005 & 0.0241 \tabularnewline
59 & 247934 & 243055.048 & 218088.9926 & 268021.1035 & 0.3508 & 0.8985 & 0.1118 & 0.4885 \tabularnewline
60 & 248333 & 247288.6095 & 220359.0135 & 274218.2055 & 0.4697 & 0.4813 & 0.1593 & 0.6108 \tabularnewline
61 & 246969 & 244560.8101 & 215731.7134 & 273389.9068 & 0.435 & 0.3988 & 0.2461 & 0.5309 \tabularnewline
62 & 245098 & 240451.6045 & 209796.3624 & 271106.8466 & 0.3832 & 0.3384 & 0.2573 & 0.4247 \tabularnewline
63 & 246263 & 233260.9822 & 200951.1249 & 265570.8394 & 0.2151 & 0.2364 & 0.2688 & 0.2688 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33794&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[51])[/C][/ROW]
[ROW][C]39[/C][C]269826[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]265861[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]269034[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]264176[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]255198[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]253353[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]246057[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]235372[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]258556[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]260993[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]254663[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]250643[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]243422[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]247105[/C][C]239603.7598[/C][C]233097.762[/C][C]246109.7575[/C][C]0.0119[/C][C]0.125[/C][C]0[/C][C]0.125[/C][/ROW]
[ROW][C]53[/C][C]248541[/C][C]243928.5659[/C][C]234971.6479[/C][C]252885.484[/C][C]0.1564[/C][C]0.2435[/C][C]0[/C][C]0.5441[/C][/ROW]
[ROW][C]54[/C][C]245039[/C][C]242640.7653[/C][C]231233.4296[/C][C]254048.1009[/C][C]0.3401[/C][C]0.1553[/C][C]1e-04[/C][C]0.4466[/C][/ROW]
[ROW][C]55[/C][C]237080[/C][C]235143.4386[/C][C]220112.1773[/C][C]250174.6999[/C][C]0.4003[/C][C]0.0985[/C][C]0.0045[/C][C]0.1402[/C][/ROW]
[ROW][C]56[/C][C]237085[/C][C]231956.5561[/C][C]214061.2239[/C][C]249851.8883[/C][C]0.2872[/C][C]0.2873[/C][C]0.0096[/C][C]0.1046[/C][/ROW]
[ROW][C]57[/C][C]225554[/C][C]227327.401[/C][C]207163.8106[/C][C]247490.9914[/C][C]0.4316[/C][C]0.1714[/C][C]0.0343[/C][C]0.0589[/C][/ROW]
[ROW][C]58[/C][C]226839[/C][C]220598.3863[/C][C]197957.1476[/C][C]243239.6249[/C][C]0.2945[/C][C]0.334[/C][C]0.1005[/C][C]0.0241[/C][/ROW]
[ROW][C]59[/C][C]247934[/C][C]243055.048[/C][C]218088.9926[/C][C]268021.1035[/C][C]0.3508[/C][C]0.8985[/C][C]0.1118[/C][C]0.4885[/C][/ROW]
[ROW][C]60[/C][C]248333[/C][C]247288.6095[/C][C]220359.0135[/C][C]274218.2055[/C][C]0.4697[/C][C]0.4813[/C][C]0.1593[/C][C]0.6108[/C][/ROW]
[ROW][C]61[/C][C]246969[/C][C]244560.8101[/C][C]215731.7134[/C][C]273389.9068[/C][C]0.435[/C][C]0.3988[/C][C]0.2461[/C][C]0.5309[/C][/ROW]
[ROW][C]62[/C][C]245098[/C][C]240451.6045[/C][C]209796.3624[/C][C]271106.8466[/C][C]0.3832[/C][C]0.3384[/C][C]0.2573[/C][C]0.4247[/C][/ROW]
[ROW][C]63[/C][C]246263[/C][C]233260.9822[/C][C]200951.1249[/C][C]265570.8394[/C][C]0.2151[/C][C]0.2364[/C][C]0.2688[/C][C]0.2688[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33794&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33794&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[51])
39269826-------
40265861-------
41269034-------
42264176-------
43255198-------
44253353-------
45246057-------
46235372-------
47258556-------
48260993-------
49254663-------
50250643-------
51243422-------
52247105239603.7598233097.762246109.75750.01190.12500.125
53248541243928.5659234971.6479252885.4840.15640.243500.5441
54245039242640.7653231233.4296254048.10090.34010.15531e-040.4466
55237080235143.4386220112.1773250174.69990.40030.09850.00450.1402
56237085231956.5561214061.2239249851.88830.28720.28730.00960.1046
57225554227327.401207163.8106247490.99140.43160.17140.03430.0589
58226839220598.3863197957.1476243239.62490.29450.3340.10050.0241
59247934243055.048218088.9926268021.10350.35080.89850.11180.4885
60248333247288.6095220359.0135274218.20550.46970.48130.15930.6108
61246969244560.8101215731.7134273389.90680.4350.39880.24610.5309
62245098240451.6045209796.3624271106.84660.38320.33840.25730.4247
63246263233260.9822200951.1249265570.83940.21510.23640.26880.2688







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
520.01390.03130.002656268605.11394689050.42622165.4215
530.01870.01890.001621274547.9521772878.9961331.495
540.0240.00998e-045751529.7539479294.1462692.3107
550.03260.00827e-043750270.0354312522.5029559.0371
560.03940.02210.001826300936.76372191744.73031480.4542
570.0453-0.00787e-043144951.0866262079.2572511.9368
580.05240.02830.002438945259.7053245438.30871801.51
590.05240.02010.001723804172.23431983681.01951408.4321
600.05560.00424e-041090751.503190895.9586301.4896
610.06010.00988e-045799378.6724483281.556695.1845
620.0650.01930.001621588991.16941799082.59751341.2988
630.07070.05570.0046169052467.758814087705.64663753.3592

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
52 & 0.0139 & 0.0313 & 0.0026 & 56268605.1139 & 4689050.4262 & 2165.4215 \tabularnewline
53 & 0.0187 & 0.0189 & 0.0016 & 21274547.952 & 1772878.996 & 1331.495 \tabularnewline
54 & 0.024 & 0.0099 & 8e-04 & 5751529.7539 & 479294.1462 & 692.3107 \tabularnewline
55 & 0.0326 & 0.0082 & 7e-04 & 3750270.0354 & 312522.5029 & 559.0371 \tabularnewline
56 & 0.0394 & 0.0221 & 0.0018 & 26300936.7637 & 2191744.7303 & 1480.4542 \tabularnewline
57 & 0.0453 & -0.0078 & 7e-04 & 3144951.0866 & 262079.2572 & 511.9368 \tabularnewline
58 & 0.0524 & 0.0283 & 0.0024 & 38945259.705 & 3245438.3087 & 1801.51 \tabularnewline
59 & 0.0524 & 0.0201 & 0.0017 & 23804172.2343 & 1983681.0195 & 1408.4321 \tabularnewline
60 & 0.0556 & 0.0042 & 4e-04 & 1090751.5031 & 90895.9586 & 301.4896 \tabularnewline
61 & 0.0601 & 0.0098 & 8e-04 & 5799378.6724 & 483281.556 & 695.1845 \tabularnewline
62 & 0.065 & 0.0193 & 0.0016 & 21588991.1694 & 1799082.5975 & 1341.2988 \tabularnewline
63 & 0.0707 & 0.0557 & 0.0046 & 169052467.7588 & 14087705.6466 & 3753.3592 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33794&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]52[/C][C]0.0139[/C][C]0.0313[/C][C]0.0026[/C][C]56268605.1139[/C][C]4689050.4262[/C][C]2165.4215[/C][/ROW]
[ROW][C]53[/C][C]0.0187[/C][C]0.0189[/C][C]0.0016[/C][C]21274547.952[/C][C]1772878.996[/C][C]1331.495[/C][/ROW]
[ROW][C]54[/C][C]0.024[/C][C]0.0099[/C][C]8e-04[/C][C]5751529.7539[/C][C]479294.1462[/C][C]692.3107[/C][/ROW]
[ROW][C]55[/C][C]0.0326[/C][C]0.0082[/C][C]7e-04[/C][C]3750270.0354[/C][C]312522.5029[/C][C]559.0371[/C][/ROW]
[ROW][C]56[/C][C]0.0394[/C][C]0.0221[/C][C]0.0018[/C][C]26300936.7637[/C][C]2191744.7303[/C][C]1480.4542[/C][/ROW]
[ROW][C]57[/C][C]0.0453[/C][C]-0.0078[/C][C]7e-04[/C][C]3144951.0866[/C][C]262079.2572[/C][C]511.9368[/C][/ROW]
[ROW][C]58[/C][C]0.0524[/C][C]0.0283[/C][C]0.0024[/C][C]38945259.705[/C][C]3245438.3087[/C][C]1801.51[/C][/ROW]
[ROW][C]59[/C][C]0.0524[/C][C]0.0201[/C][C]0.0017[/C][C]23804172.2343[/C][C]1983681.0195[/C][C]1408.4321[/C][/ROW]
[ROW][C]60[/C][C]0.0556[/C][C]0.0042[/C][C]4e-04[/C][C]1090751.5031[/C][C]90895.9586[/C][C]301.4896[/C][/ROW]
[ROW][C]61[/C][C]0.0601[/C][C]0.0098[/C][C]8e-04[/C][C]5799378.6724[/C][C]483281.556[/C][C]695.1845[/C][/ROW]
[ROW][C]62[/C][C]0.065[/C][C]0.0193[/C][C]0.0016[/C][C]21588991.1694[/C][C]1799082.5975[/C][C]1341.2988[/C][/ROW]
[ROW][C]63[/C][C]0.0707[/C][C]0.0557[/C][C]0.0046[/C][C]169052467.7588[/C][C]14087705.6466[/C][C]3753.3592[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33794&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33794&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
520.01390.03130.002656268605.11394689050.42622165.4215
530.01870.01890.001621274547.9521772878.9961331.495
540.0240.00998e-045751529.7539479294.1462692.3107
550.03260.00827e-043750270.0354312522.5029559.0371
560.03940.02210.001826300936.76372191744.73031480.4542
570.0453-0.00787e-043144951.0866262079.2572511.9368
580.05240.02830.002438945259.7053245438.30871801.51
590.05240.02010.001723804172.23431983681.01951408.4321
600.05560.00424e-041090751.503190895.9586301.4896
610.06010.00988e-045799378.6724483281.556695.1845
620.0650.01930.001621588991.16941799082.59751341.2988
630.07070.05570.0046169052467.758814087705.64663753.3592



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