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 computationTue, 16 Dec 2008 14:49:52 -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/16/t1229464279ohzpxljcqg6oc98.htm/, Retrieved Fri, 01 Nov 2024 00:34:40 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=34223, Retrieved Fri, 01 Nov 2024 00:34:40 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsARIMA forecasting
Estimated Impact186
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F     [ARIMA Forecasting] [ARIMA forecasting...] [2008-12-14 10:47:40] [47f64d63202c1921bd27f3073f07a153]
F    D    [ARIMA Forecasting] [ARIMA forecasting] [2008-12-16 21:49:52] [3bdbbe597ac6c61989658933956ee6ac] [Current]
Feedback Forum
2008-12-22 19:48:39 [Toon Wouters] [reply
Step 1 :Hier was het inderdaad de bedoeling te gaan zien naar de explosiviteit. Deze is wel beter te zien op de grafiek. Uw conclusie is echter juist omdat je op de grafiek goed kan zien dat er geen explosieve voorspelling wordt gemaakt (de voorspelde waarden liggen ruim binnen het betrouwbaarheidsinterval). Wanneer er geen explosieve voorspelling is, is het AR proces stabiel en zijn de MA processen omkeerbaar.
2008-12-22 20:41:56 [Toon Wouters] [reply
Step 2 : Om seizoenaliteit vast te stellen, moet de voorspelde waarde een zelfde patroon volgen als de data in het verleden. (vaak met pieken aangeduid die worden voortgezet bij de voorspelling). Ook is het mogelijk om een conjunctuurcyclus vast te stellen, een stijging daarna gelijklopend gevolgd door een daling. En deze kan zich ook voortzetten in de voorspelling. Maar hier is duidelijk te zien dat er geen van beide aanwezig is.

Step 3 : We moeten uit de tabel met standaard fouten concluderen dat de PE (werkelijke fout) van 50 tot en 54 groter is dan de SE (standard error). Dit kan het gevolg zijn van dat de werkelijke fouten overschat zijn (door outliers). Vanaf 55 is de werkelijke fout kleiner dan de standaard fout.

Step 5: Bij deze stap had men naar de grote tabel moeten zien. Daarin was de p-waarde cast te stellen. De p-waarde in die tabel wil zeggen dat wanneer deze groter is dan 5 %, het verschil tussen de voorspelde waarde en de werkelijke waarde niet significant is. En bij deze tijdreeks is dit zo het geval.


Post a new message
Dataseries X:
8.4
8.4
8.4
8.6
8.9
8.8
8.3
7.5
7.2
7.5
8.8
9.3
9.3
8.7
8.2
8.3
8.5
8.6
8.6
8.2
8.1
8
8.6
8.7
8.8
8.5
8.4
8.5
8.7
8.7
8.6
8.5
8.3
8.1
8.2
8.1
8.1
7.9
7.9
7.9
8
8
7.9
8
7.7
7.2
7.5
7.3
7
7
7
7.2
7.3
7.1
6.8
6.6
6.2
6.2
6.8
6.9
6.8




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'George Udny Yule' @ 72.249.76.132

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34223&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'George Udny Yule' @ 72.249.76.132







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[49])
378.1-------
387.9-------
397.9-------
407.9-------
418-------
428-------
437.9-------
448-------
457.7-------
467.2-------
477.5-------
487.3-------
497-------
5076.49285.95667.02910.03190.031900.0319
5176.18664.95887.41450.09710.09710.00310.0971
527.25.88033.80887.95180.10590.14470.0280.1447
537.35.6742.62838.71980.14770.16310.06720.1967
547.15.36771.23249.50310.20580.17990.10610.2196
556.84.9614-0.367910.29070.24950.21580.13990.2267
566.64.7551-1.864211.37440.29240.27240.16830.2531
576.24.1488-3.849912.14750.30760.2740.19210.2424
586.23.3425-6.119512.80450.2770.2770.21210.2243
596.83.3362-7.668614.3410.26860.3050.22920.257
606.92.8299-9.793115.45290.26370.26880.24380.2587
616.82.2236-12.089916.53710.26540.2610.25650.2565

\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[49]) \tabularnewline
37 & 8.1 & - & - & - & - & - & - & - \tabularnewline
38 & 7.9 & - & - & - & - & - & - & - \tabularnewline
39 & 7.9 & - & - & - & - & - & - & - \tabularnewline
40 & 7.9 & - & - & - & - & - & - & - \tabularnewline
41 & 8 & - & - & - & - & - & - & - \tabularnewline
42 & 8 & - & - & - & - & - & - & - \tabularnewline
43 & 7.9 & - & - & - & - & - & - & - \tabularnewline
44 & 8 & - & - & - & - & - & - & - \tabularnewline
45 & 7.7 & - & - & - & - & - & - & - \tabularnewline
46 & 7.2 & - & - & - & - & - & - & - \tabularnewline
47 & 7.5 & - & - & - & - & - & - & - \tabularnewline
48 & 7.3 & - & - & - & - & - & - & - \tabularnewline
49 & 7 & - & - & - & - & - & - & - \tabularnewline
50 & 7 & 6.4928 & 5.9566 & 7.0291 & 0.0319 & 0.0319 & 0 & 0.0319 \tabularnewline
51 & 7 & 6.1866 & 4.9588 & 7.4145 & 0.0971 & 0.0971 & 0.0031 & 0.0971 \tabularnewline
52 & 7.2 & 5.8803 & 3.8088 & 7.9518 & 0.1059 & 0.1447 & 0.028 & 0.1447 \tabularnewline
53 & 7.3 & 5.674 & 2.6283 & 8.7198 & 0.1477 & 0.1631 & 0.0672 & 0.1967 \tabularnewline
54 & 7.1 & 5.3677 & 1.2324 & 9.5031 & 0.2058 & 0.1799 & 0.1061 & 0.2196 \tabularnewline
55 & 6.8 & 4.9614 & -0.3679 & 10.2907 & 0.2495 & 0.2158 & 0.1399 & 0.2267 \tabularnewline
56 & 6.6 & 4.7551 & -1.8642 & 11.3744 & 0.2924 & 0.2724 & 0.1683 & 0.2531 \tabularnewline
57 & 6.2 & 4.1488 & -3.8499 & 12.1475 & 0.3076 & 0.274 & 0.1921 & 0.2424 \tabularnewline
58 & 6.2 & 3.3425 & -6.1195 & 12.8045 & 0.277 & 0.277 & 0.2121 & 0.2243 \tabularnewline
59 & 6.8 & 3.3362 & -7.6686 & 14.341 & 0.2686 & 0.305 & 0.2292 & 0.257 \tabularnewline
60 & 6.9 & 2.8299 & -9.7931 & 15.4529 & 0.2637 & 0.2688 & 0.2438 & 0.2587 \tabularnewline
61 & 6.8 & 2.2236 & -12.0899 & 16.5371 & 0.2654 & 0.261 & 0.2565 & 0.2565 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34223&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[49])[/C][/ROW]
[ROW][C]37[/C][C]8.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]7.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]7.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]7.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]7.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]7.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]7.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]7.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]7.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]7[/C][C]6.4928[/C][C]5.9566[/C][C]7.0291[/C][C]0.0319[/C][C]0.0319[/C][C]0[/C][C]0.0319[/C][/ROW]
[ROW][C]51[/C][C]7[/C][C]6.1866[/C][C]4.9588[/C][C]7.4145[/C][C]0.0971[/C][C]0.0971[/C][C]0.0031[/C][C]0.0971[/C][/ROW]
[ROW][C]52[/C][C]7.2[/C][C]5.8803[/C][C]3.8088[/C][C]7.9518[/C][C]0.1059[/C][C]0.1447[/C][C]0.028[/C][C]0.1447[/C][/ROW]
[ROW][C]53[/C][C]7.3[/C][C]5.674[/C][C]2.6283[/C][C]8.7198[/C][C]0.1477[/C][C]0.1631[/C][C]0.0672[/C][C]0.1967[/C][/ROW]
[ROW][C]54[/C][C]7.1[/C][C]5.3677[/C][C]1.2324[/C][C]9.5031[/C][C]0.2058[/C][C]0.1799[/C][C]0.1061[/C][C]0.2196[/C][/ROW]
[ROW][C]55[/C][C]6.8[/C][C]4.9614[/C][C]-0.3679[/C][C]10.2907[/C][C]0.2495[/C][C]0.2158[/C][C]0.1399[/C][C]0.2267[/C][/ROW]
[ROW][C]56[/C][C]6.6[/C][C]4.7551[/C][C]-1.8642[/C][C]11.3744[/C][C]0.2924[/C][C]0.2724[/C][C]0.1683[/C][C]0.2531[/C][/ROW]
[ROW][C]57[/C][C]6.2[/C][C]4.1488[/C][C]-3.8499[/C][C]12.1475[/C][C]0.3076[/C][C]0.274[/C][C]0.1921[/C][C]0.2424[/C][/ROW]
[ROW][C]58[/C][C]6.2[/C][C]3.3425[/C][C]-6.1195[/C][C]12.8045[/C][C]0.277[/C][C]0.277[/C][C]0.2121[/C][C]0.2243[/C][/ROW]
[ROW][C]59[/C][C]6.8[/C][C]3.3362[/C][C]-7.6686[/C][C]14.341[/C][C]0.2686[/C][C]0.305[/C][C]0.2292[/C][C]0.257[/C][/ROW]
[ROW][C]60[/C][C]6.9[/C][C]2.8299[/C][C]-9.7931[/C][C]15.4529[/C][C]0.2637[/C][C]0.2688[/C][C]0.2438[/C][C]0.2587[/C][/ROW]
[ROW][C]61[/C][C]6.8[/C][C]2.2236[/C][C]-12.0899[/C][C]16.5371[/C][C]0.2654[/C][C]0.261[/C][C]0.2565[/C][C]0.2565[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34223&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34223&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[49])
378.1-------
387.9-------
397.9-------
407.9-------
418-------
428-------
437.9-------
448-------
457.7-------
467.2-------
477.5-------
487.3-------
497-------
5076.49285.95667.02910.03190.031900.0319
5176.18664.95887.41450.09710.09710.00310.0971
527.25.88033.80887.95180.10590.14470.0280.1447
537.35.6742.62838.71980.14770.16310.06720.1967
547.15.36771.23249.50310.20580.17990.10610.2196
556.84.9614-0.367910.29070.24950.21580.13990.2267
566.64.7551-1.864211.37440.29240.27240.16830.2531
576.24.1488-3.849912.14750.30760.2740.19210.2424
586.23.3425-6.119512.80450.2770.2770.21210.2243
596.83.3362-7.668614.3410.26860.3050.22920.257
606.92.8299-9.793115.45290.26370.26880.24380.2587
616.82.2236-12.089916.53710.26540.2610.25650.2565







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.04210.07810.00650.25720.02140.1464
510.10130.13150.0110.66150.05510.2348
520.17970.22440.01871.74150.14510.381
530.27390.28660.02392.64380.22030.4694
540.39310.32270.02693.00080.25010.5001
550.5480.37060.03093.38040.28170.5308
560.71020.3880.03233.40360.28360.5326
570.98360.49440.04124.20740.35060.5921
581.44430.85490.07128.16530.68040.8249
591.6831.03820.086511.99790.99980.9999
602.27581.43830.119916.56571.38051.1749
613.28422.05810.171520.94351.74531.3211

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0421 & 0.0781 & 0.0065 & 0.2572 & 0.0214 & 0.1464 \tabularnewline
51 & 0.1013 & 0.1315 & 0.011 & 0.6615 & 0.0551 & 0.2348 \tabularnewline
52 & 0.1797 & 0.2244 & 0.0187 & 1.7415 & 0.1451 & 0.381 \tabularnewline
53 & 0.2739 & 0.2866 & 0.0239 & 2.6438 & 0.2203 & 0.4694 \tabularnewline
54 & 0.3931 & 0.3227 & 0.0269 & 3.0008 & 0.2501 & 0.5001 \tabularnewline
55 & 0.548 & 0.3706 & 0.0309 & 3.3804 & 0.2817 & 0.5308 \tabularnewline
56 & 0.7102 & 0.388 & 0.0323 & 3.4036 & 0.2836 & 0.5326 \tabularnewline
57 & 0.9836 & 0.4944 & 0.0412 & 4.2074 & 0.3506 & 0.5921 \tabularnewline
58 & 1.4443 & 0.8549 & 0.0712 & 8.1653 & 0.6804 & 0.8249 \tabularnewline
59 & 1.683 & 1.0382 & 0.0865 & 11.9979 & 0.9998 & 0.9999 \tabularnewline
60 & 2.2758 & 1.4383 & 0.1199 & 16.5657 & 1.3805 & 1.1749 \tabularnewline
61 & 3.2842 & 2.0581 & 0.1715 & 20.9435 & 1.7453 & 1.3211 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34223&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]50[/C][C]0.0421[/C][C]0.0781[/C][C]0.0065[/C][C]0.2572[/C][C]0.0214[/C][C]0.1464[/C][/ROW]
[ROW][C]51[/C][C]0.1013[/C][C]0.1315[/C][C]0.011[/C][C]0.6615[/C][C]0.0551[/C][C]0.2348[/C][/ROW]
[ROW][C]52[/C][C]0.1797[/C][C]0.2244[/C][C]0.0187[/C][C]1.7415[/C][C]0.1451[/C][C]0.381[/C][/ROW]
[ROW][C]53[/C][C]0.2739[/C][C]0.2866[/C][C]0.0239[/C][C]2.6438[/C][C]0.2203[/C][C]0.4694[/C][/ROW]
[ROW][C]54[/C][C]0.3931[/C][C]0.3227[/C][C]0.0269[/C][C]3.0008[/C][C]0.2501[/C][C]0.5001[/C][/ROW]
[ROW][C]55[/C][C]0.548[/C][C]0.3706[/C][C]0.0309[/C][C]3.3804[/C][C]0.2817[/C][C]0.5308[/C][/ROW]
[ROW][C]56[/C][C]0.7102[/C][C]0.388[/C][C]0.0323[/C][C]3.4036[/C][C]0.2836[/C][C]0.5326[/C][/ROW]
[ROW][C]57[/C][C]0.9836[/C][C]0.4944[/C][C]0.0412[/C][C]4.2074[/C][C]0.3506[/C][C]0.5921[/C][/ROW]
[ROW][C]58[/C][C]1.4443[/C][C]0.8549[/C][C]0.0712[/C][C]8.1653[/C][C]0.6804[/C][C]0.8249[/C][/ROW]
[ROW][C]59[/C][C]1.683[/C][C]1.0382[/C][C]0.0865[/C][C]11.9979[/C][C]0.9998[/C][C]0.9999[/C][/ROW]
[ROW][C]60[/C][C]2.2758[/C][C]1.4383[/C][C]0.1199[/C][C]16.5657[/C][C]1.3805[/C][C]1.1749[/C][/ROW]
[ROW][C]61[/C][C]3.2842[/C][C]2.0581[/C][C]0.1715[/C][C]20.9435[/C][C]1.7453[/C][C]1.3211[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34223&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34223&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
500.04210.07810.00650.25720.02140.1464
510.10130.13150.0110.66150.05510.2348
520.17970.22440.01871.74150.14510.381
530.27390.28660.02392.64380.22030.4694
540.39310.32270.02693.00080.25010.5001
550.5480.37060.03093.38040.28170.5308
560.71020.3880.03233.40360.28360.5326
570.98360.49440.04124.20740.35060.5921
581.44430.85490.07128.16530.68040.8249
591.6831.03820.086511.99790.99980.9999
602.27581.43830.119916.56571.38051.1749
613.28422.05810.171520.94351.74531.3211



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