Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 16 Dec 2008 11:58:25 -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/t12294541355pis3i614tr9tzj.htm/, Retrieved Wed, 15 May 2024 23:41:13 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=34118, Retrieved Wed, 15 May 2024 23:41:13 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact177
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [data set] [2008-12-01 19:54:57] [b98453cac15ba1066b407e146608df68]
F RMPD  [ARIMA Backward Selection] [Identification an...] [2008-12-09 22:48:11] [1a689e9ccc515e1757f0522229a687e9]
F RMP       [ARIMA Forecasting] [ARIMA Forecasting...] [2008-12-16 18:58:25] [74a138e5b32af267311b5ad4cd13bf7e] [Current]
Feedback Forum
2008-12-23 18:35:53 [Maarten Van Gucht] [reply
De student heeft een goede berekening van de tijdreeks gemaakt. hij legt iedere stap goed en volledig uit, enkel de assumptie heeft hij geen antwoord op kunnen geven. De analyse die we kunnen trekken uit deze tijdreeks is dat we een goede voorspelling kunnen maken van alle perioden. namelijk:
In de 1ste maand zitten we er 6,11% naast, de waarde van de standaarddeviatie gaat de volgende maanden nog toenemen tot 7,69%.

Kolom 1 : geeft de tijdsindex, je kan hier zien dat de eerste 73 waarnemingen bestaan en dat de laatste 12 waarnemingen weggelaten zijn door de testing period =12.



de grafieken heeft de student ook goed beschreven en stap voor stap geanalyseerd.
Kolom 2 : bevat de waarde uit de dataset (Y(t))

Kolom 3 : geeft de voorspelde waarde (F(t))
--------------------------------------------------------------------------
Univariate ARIMA Extrapolation Forecast Performance geeft de verschillende waarden in verband met de dataset.

De 2de kolom toont de procentuele standaardfout.

 Hoe verder we in de toekomst kijken, hoe groter deze fout wordt

De 3de kolom toont de procentuele werkelijke fout.

 deze is meestal kleiner dan de standaardfout

Kolom 4 en 5 : geven de 95% upper en lower bound, samen vormen deze het 95% betrouwbaarheidsinterval.

Kolom 6 : geeft de p-waarde, met als 0-hypothese dat de waarde uit de dataset en de voorspelde waarde niet significant van elkaar verschillen.

Kolom 7 : geeft de waarschijnlijkheid dat er een stijging is ten opzichte van de laatste waarde.

Kolom 8 : geeft de waarschijnlijkheid dat er een stijging is ten opzichte van vorig jaar.`

Kolom 9 : geeft de waarschijnlijkheid dat er een stijging is ten opzichte van de laatst gekende waarde.
2008-12-23 18:38:49 [Maarten Van Gucht] [reply
deze Univariate ARIMA Extrapolation Forecast Performance in het midden (met de uitleg over de 2 kolommen) hoort op het einde van de assesment.

Post a new message
Dataseries X:
93.7
105.7
109.5
105.3
102.8
100.6
97.6
110.3
107.2
107.2
108.1
97.1
92.2
112.2
111.6
115.7
111.3
104.2
103.2
112.7
106.4
102.6
110.6
95.2
89
112.5
116.8
107.2
113.6
101.8
102.6
122.7
110.3
110.5
121.6
100.3
100.7
123.4
127.1
124.1
131.2
111.6
114.2
130.1
125.9
119
133.8
107.5
113.5
134.4
126.8
135.6
139.9
129.8
131
153.1
134.1
144.1
155.9
123.3
128.1
144.3
153
149.9
150.9
141
138.9
157.4
142.9
151.7
161
138.5
135.9
151.5
164
159.1
157
142.1
144.8
152.1
154.6
148.7
157.7
146.4
136.5




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=34118&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=34118&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34118&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[73])
61128.1-------
62144.3-------
63153-------
64149.9-------
65150.9-------
66141-------
67138.9-------
68157.4-------
69142.9-------
70151.7-------
71161-------
72138.5-------
73135.9-------
74151.5153.7478136.9398172.16710.40550.97120.84260.9712
75164155.0443136.7382175.26070.19260.63440.57860.9683
76159.1149.9130.1088172.02950.20760.10590.50.8925
77157150.9131.0018173.14590.29550.2350.50.9068
78142.1141122.1675162.08650.45930.06850.50.6823
79144.8138.9120.2954159.73840.28950.38170.50.6111
80152.1157.4136.8093180.39850.32570.85850.50.9665
81154.6142.9123.8619164.21030.14090.19870.50.7402
82148.7151.7131.7162174.03890.39620.39960.50.9172
83157.7161140.0282184.41250.39120.84840.50.9822
84146.4138.5119.9389159.29110.22820.03510.50.5968
85136.5135.9117.6221156.38270.47710.15750.50.5

\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[73]) \tabularnewline
61 & 128.1 & - & - & - & - & - & - & - \tabularnewline
62 & 144.3 & - & - & - & - & - & - & - \tabularnewline
63 & 153 & - & - & - & - & - & - & - \tabularnewline
64 & 149.9 & - & - & - & - & - & - & - \tabularnewline
65 & 150.9 & - & - & - & - & - & - & - \tabularnewline
66 & 141 & - & - & - & - & - & - & - \tabularnewline
67 & 138.9 & - & - & - & - & - & - & - \tabularnewline
68 & 157.4 & - & - & - & - & - & - & - \tabularnewline
69 & 142.9 & - & - & - & - & - & - & - \tabularnewline
70 & 151.7 & - & - & - & - & - & - & - \tabularnewline
71 & 161 & - & - & - & - & - & - & - \tabularnewline
72 & 138.5 & - & - & - & - & - & - & - \tabularnewline
73 & 135.9 & - & - & - & - & - & - & - \tabularnewline
74 & 151.5 & 153.7478 & 136.9398 & 172.1671 & 0.4055 & 0.9712 & 0.8426 & 0.9712 \tabularnewline
75 & 164 & 155.0443 & 136.7382 & 175.2607 & 0.1926 & 0.6344 & 0.5786 & 0.9683 \tabularnewline
76 & 159.1 & 149.9 & 130.1088 & 172.0295 & 0.2076 & 0.1059 & 0.5 & 0.8925 \tabularnewline
77 & 157 & 150.9 & 131.0018 & 173.1459 & 0.2955 & 0.235 & 0.5 & 0.9068 \tabularnewline
78 & 142.1 & 141 & 122.1675 & 162.0865 & 0.4593 & 0.0685 & 0.5 & 0.6823 \tabularnewline
79 & 144.8 & 138.9 & 120.2954 & 159.7384 & 0.2895 & 0.3817 & 0.5 & 0.6111 \tabularnewline
80 & 152.1 & 157.4 & 136.8093 & 180.3985 & 0.3257 & 0.8585 & 0.5 & 0.9665 \tabularnewline
81 & 154.6 & 142.9 & 123.8619 & 164.2103 & 0.1409 & 0.1987 & 0.5 & 0.7402 \tabularnewline
82 & 148.7 & 151.7 & 131.7162 & 174.0389 & 0.3962 & 0.3996 & 0.5 & 0.9172 \tabularnewline
83 & 157.7 & 161 & 140.0282 & 184.4125 & 0.3912 & 0.8484 & 0.5 & 0.9822 \tabularnewline
84 & 146.4 & 138.5 & 119.9389 & 159.2911 & 0.2282 & 0.0351 & 0.5 & 0.5968 \tabularnewline
85 & 136.5 & 135.9 & 117.6221 & 156.3827 & 0.4771 & 0.1575 & 0.5 & 0.5 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34118&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[73])[/C][/ROW]
[ROW][C]61[/C][C]128.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]144.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]153[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]149.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]150.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]141[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]138.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]157.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]142.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]151.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]161[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]138.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]135.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]151.5[/C][C]153.7478[/C][C]136.9398[/C][C]172.1671[/C][C]0.4055[/C][C]0.9712[/C][C]0.8426[/C][C]0.9712[/C][/ROW]
[ROW][C]75[/C][C]164[/C][C]155.0443[/C][C]136.7382[/C][C]175.2607[/C][C]0.1926[/C][C]0.6344[/C][C]0.5786[/C][C]0.9683[/C][/ROW]
[ROW][C]76[/C][C]159.1[/C][C]149.9[/C][C]130.1088[/C][C]172.0295[/C][C]0.2076[/C][C]0.1059[/C][C]0.5[/C][C]0.8925[/C][/ROW]
[ROW][C]77[/C][C]157[/C][C]150.9[/C][C]131.0018[/C][C]173.1459[/C][C]0.2955[/C][C]0.235[/C][C]0.5[/C][C]0.9068[/C][/ROW]
[ROW][C]78[/C][C]142.1[/C][C]141[/C][C]122.1675[/C][C]162.0865[/C][C]0.4593[/C][C]0.0685[/C][C]0.5[/C][C]0.6823[/C][/ROW]
[ROW][C]79[/C][C]144.8[/C][C]138.9[/C][C]120.2954[/C][C]159.7384[/C][C]0.2895[/C][C]0.3817[/C][C]0.5[/C][C]0.6111[/C][/ROW]
[ROW][C]80[/C][C]152.1[/C][C]157.4[/C][C]136.8093[/C][C]180.3985[/C][C]0.3257[/C][C]0.8585[/C][C]0.5[/C][C]0.9665[/C][/ROW]
[ROW][C]81[/C][C]154.6[/C][C]142.9[/C][C]123.8619[/C][C]164.2103[/C][C]0.1409[/C][C]0.1987[/C][C]0.5[/C][C]0.7402[/C][/ROW]
[ROW][C]82[/C][C]148.7[/C][C]151.7[/C][C]131.7162[/C][C]174.0389[/C][C]0.3962[/C][C]0.3996[/C][C]0.5[/C][C]0.9172[/C][/ROW]
[ROW][C]83[/C][C]157.7[/C][C]161[/C][C]140.0282[/C][C]184.4125[/C][C]0.3912[/C][C]0.8484[/C][C]0.5[/C][C]0.9822[/C][/ROW]
[ROW][C]84[/C][C]146.4[/C][C]138.5[/C][C]119.9389[/C][C]159.2911[/C][C]0.2282[/C][C]0.0351[/C][C]0.5[/C][C]0.5968[/C][/ROW]
[ROW][C]85[/C][C]136.5[/C][C]135.9[/C][C]117.6221[/C][C]156.3827[/C][C]0.4771[/C][C]0.1575[/C][C]0.5[/C][C]0.5[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34118&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34118&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[73])
61128.1-------
62144.3-------
63153-------
64149.9-------
65150.9-------
66141-------
67138.9-------
68157.4-------
69142.9-------
70151.7-------
71161-------
72138.5-------
73135.9-------
74151.5153.7478136.9398172.16710.40550.97120.84260.9712
75164155.0443136.7382175.26070.19260.63440.57860.9683
76159.1149.9130.1088172.02950.20760.10590.50.8925
77157150.9131.0018173.14590.29550.2350.50.9068
78142.1141122.1675162.08650.45930.06850.50.6823
79144.8138.9120.2954159.73840.28950.38170.50.6111
80152.1157.4136.8093180.39850.32570.85850.50.9665
81154.6142.9123.8619164.21030.14090.19870.50.7402
82148.7151.7131.7162174.03890.39620.39960.50.9172
83157.7161140.0282184.41250.39120.84840.50.9822
84146.4138.5119.9389159.29110.22820.03510.50.5968
85136.5135.9117.6221156.38270.47710.15750.50.5







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
740.0611-0.01460.00125.05270.42110.6489
750.06650.05780.004880.2046.68372.5853
760.07530.06140.005184.647.05332.6558
770.07520.04040.003437.213.10081.7609
780.07630.00787e-041.210.10080.3175
790.07650.04250.003534.812.90081.7032
800.0745-0.03370.002828.092.34081.53
810.07610.08190.0068136.8911.40753.3775
820.0751-0.01980.001690.750.866
830.0742-0.02050.001710.890.90750.9526
840.07660.0570.004862.415.20082.2805
850.07690.00444e-040.360.030.1732

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
74 & 0.0611 & -0.0146 & 0.0012 & 5.0527 & 0.4211 & 0.6489 \tabularnewline
75 & 0.0665 & 0.0578 & 0.0048 & 80.204 & 6.6837 & 2.5853 \tabularnewline
76 & 0.0753 & 0.0614 & 0.0051 & 84.64 & 7.0533 & 2.6558 \tabularnewline
77 & 0.0752 & 0.0404 & 0.0034 & 37.21 & 3.1008 & 1.7609 \tabularnewline
78 & 0.0763 & 0.0078 & 7e-04 & 1.21 & 0.1008 & 0.3175 \tabularnewline
79 & 0.0765 & 0.0425 & 0.0035 & 34.81 & 2.9008 & 1.7032 \tabularnewline
80 & 0.0745 & -0.0337 & 0.0028 & 28.09 & 2.3408 & 1.53 \tabularnewline
81 & 0.0761 & 0.0819 & 0.0068 & 136.89 & 11.4075 & 3.3775 \tabularnewline
82 & 0.0751 & -0.0198 & 0.0016 & 9 & 0.75 & 0.866 \tabularnewline
83 & 0.0742 & -0.0205 & 0.0017 & 10.89 & 0.9075 & 0.9526 \tabularnewline
84 & 0.0766 & 0.057 & 0.0048 & 62.41 & 5.2008 & 2.2805 \tabularnewline
85 & 0.0769 & 0.0044 & 4e-04 & 0.36 & 0.03 & 0.1732 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34118&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]74[/C][C]0.0611[/C][C]-0.0146[/C][C]0.0012[/C][C]5.0527[/C][C]0.4211[/C][C]0.6489[/C][/ROW]
[ROW][C]75[/C][C]0.0665[/C][C]0.0578[/C][C]0.0048[/C][C]80.204[/C][C]6.6837[/C][C]2.5853[/C][/ROW]
[ROW][C]76[/C][C]0.0753[/C][C]0.0614[/C][C]0.0051[/C][C]84.64[/C][C]7.0533[/C][C]2.6558[/C][/ROW]
[ROW][C]77[/C][C]0.0752[/C][C]0.0404[/C][C]0.0034[/C][C]37.21[/C][C]3.1008[/C][C]1.7609[/C][/ROW]
[ROW][C]78[/C][C]0.0763[/C][C]0.0078[/C][C]7e-04[/C][C]1.21[/C][C]0.1008[/C][C]0.3175[/C][/ROW]
[ROW][C]79[/C][C]0.0765[/C][C]0.0425[/C][C]0.0035[/C][C]34.81[/C][C]2.9008[/C][C]1.7032[/C][/ROW]
[ROW][C]80[/C][C]0.0745[/C][C]-0.0337[/C][C]0.0028[/C][C]28.09[/C][C]2.3408[/C][C]1.53[/C][/ROW]
[ROW][C]81[/C][C]0.0761[/C][C]0.0819[/C][C]0.0068[/C][C]136.89[/C][C]11.4075[/C][C]3.3775[/C][/ROW]
[ROW][C]82[/C][C]0.0751[/C][C]-0.0198[/C][C]0.0016[/C][C]9[/C][C]0.75[/C][C]0.866[/C][/ROW]
[ROW][C]83[/C][C]0.0742[/C][C]-0.0205[/C][C]0.0017[/C][C]10.89[/C][C]0.9075[/C][C]0.9526[/C][/ROW]
[ROW][C]84[/C][C]0.0766[/C][C]0.057[/C][C]0.0048[/C][C]62.41[/C][C]5.2008[/C][C]2.2805[/C][/ROW]
[ROW][C]85[/C][C]0.0769[/C][C]0.0044[/C][C]4e-04[/C][C]0.36[/C][C]0.03[/C][C]0.1732[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34118&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34118&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
740.0611-0.01460.00125.05270.42110.6489
750.06650.05780.004880.2046.68372.5853
760.07530.06140.005184.647.05332.6558
770.07520.04040.003437.213.10081.7609
780.07630.00787e-041.210.10080.3175
790.07650.04250.003534.812.90081.7032
800.0745-0.03370.002828.092.34081.53
810.07610.08190.0068136.8911.40753.3775
820.0751-0.01980.001690.750.866
830.0742-0.02050.001710.890.90750.9526
840.07660.0570.004862.415.20082.2805
850.07690.00444e-040.360.030.1732



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