Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 07 Dec 2007 07:33:21 -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/2007/Dec/07/t1197037257vmrufjqxbnfvhaq.htm/, Retrieved Sun, 28 Apr 2024 20:38:49 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2847, Retrieved Sun, 28 Apr 2024 20:38:49 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact196
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2007-12-07 14:33:21] [22d719c250b0837edaa2d173fd414084] [Current]
Feedback Forum

Post a new message
Dataseries X:
105,3
103
103,8
103,4
105,8
101,4
97
94,3
96,6
97,1
95,7
96,9
97,4
95,3
93,6
91,5
93,1
91,7
94,3
93,9
90,9
88,3
91,3
91,7
92,4
92
95,6
95,8
96,4
99
107
109,7
116,2
115,9
113,8
112,6
113,7
115,9
110,3
111,3
113,4
108,2
104,8
106
110,9
115
118,4
121,4
128,8
131,7
141,7
142,9
139,4
134,7
125
113,6
111,5
108,5
112,3
116,6
115,5
120,1
132,9
128,1
129,3
132,5
131
124,9
123,45
122
122,1
127,4
135,2
137,3
135
136
138,4
134,7
138,4
133,9
133,6
141,2
148,9
148,9
156,6
161,6
160,7
156
159,5
168,7
169,9
169,9
169,9




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\begin{tabular}{lllllllll}
\hline
Summary of compuational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2847&T=0

[TABLE]
[ROW][C]Summary of compuational 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]1 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=2847&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2847&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 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[81])
69123.45-------
70122-------
71122.1-------
72127.4-------
73135.2-------
74137.3-------
75135-------
76136-------
77138.4-------
78134.7-------
79138.4-------
80133.9-------
81133.6-------
82141.2134.5786127.2762141.8810.03780.60360.99960.6036
83148.9135.069123.2338146.90420.0110.1550.98410.5961
84148.9135.7317120.6711150.79220.04330.04330.86090.6093
85156.6137.8389120.1315155.54620.01890.11040.61490.6805
86161.6137.6153117.6176157.6130.00940.03140.51230.653
87160.7137.8722115.8208159.92360.02120.01750.60080.6479
88156138.9261114.9967162.85560.0810.03730.59470.6687
89159.5138.5374112.8668164.2080.05470.09120.50420.6469
90168.7137.5491110.2483164.84990.01270.05750.5810.6116
91169.9137.764108.9249166.60310.01450.01780.48280.6114
92169.9136.4434106.1441166.74270.01520.01520.56530.573
93169.9136.8173105.1249168.50970.02040.02040.57890.5789

\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[81]) \tabularnewline
69 & 123.45 & - & - & - & - & - & - & - \tabularnewline
70 & 122 & - & - & - & - & - & - & - \tabularnewline
71 & 122.1 & - & - & - & - & - & - & - \tabularnewline
72 & 127.4 & - & - & - & - & - & - & - \tabularnewline
73 & 135.2 & - & - & - & - & - & - & - \tabularnewline
74 & 137.3 & - & - & - & - & - & - & - \tabularnewline
75 & 135 & - & - & - & - & - & - & - \tabularnewline
76 & 136 & - & - & - & - & - & - & - \tabularnewline
77 & 138.4 & - & - & - & - & - & - & - \tabularnewline
78 & 134.7 & - & - & - & - & - & - & - \tabularnewline
79 & 138.4 & - & - & - & - & - & - & - \tabularnewline
80 & 133.9 & - & - & - & - & - & - & - \tabularnewline
81 & 133.6 & - & - & - & - & - & - & - \tabularnewline
82 & 141.2 & 134.5786 & 127.2762 & 141.881 & 0.0378 & 0.6036 & 0.9996 & 0.6036 \tabularnewline
83 & 148.9 & 135.069 & 123.2338 & 146.9042 & 0.011 & 0.155 & 0.9841 & 0.5961 \tabularnewline
84 & 148.9 & 135.7317 & 120.6711 & 150.7922 & 0.0433 & 0.0433 & 0.8609 & 0.6093 \tabularnewline
85 & 156.6 & 137.8389 & 120.1315 & 155.5462 & 0.0189 & 0.1104 & 0.6149 & 0.6805 \tabularnewline
86 & 161.6 & 137.6153 & 117.6176 & 157.613 & 0.0094 & 0.0314 & 0.5123 & 0.653 \tabularnewline
87 & 160.7 & 137.8722 & 115.8208 & 159.9236 & 0.0212 & 0.0175 & 0.6008 & 0.6479 \tabularnewline
88 & 156 & 138.9261 & 114.9967 & 162.8556 & 0.081 & 0.0373 & 0.5947 & 0.6687 \tabularnewline
89 & 159.5 & 138.5374 & 112.8668 & 164.208 & 0.0547 & 0.0912 & 0.5042 & 0.6469 \tabularnewline
90 & 168.7 & 137.5491 & 110.2483 & 164.8499 & 0.0127 & 0.0575 & 0.581 & 0.6116 \tabularnewline
91 & 169.9 & 137.764 & 108.9249 & 166.6031 & 0.0145 & 0.0178 & 0.4828 & 0.6114 \tabularnewline
92 & 169.9 & 136.4434 & 106.1441 & 166.7427 & 0.0152 & 0.0152 & 0.5653 & 0.573 \tabularnewline
93 & 169.9 & 136.8173 & 105.1249 & 168.5097 & 0.0204 & 0.0204 & 0.5789 & 0.5789 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2847&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[81])[/C][/ROW]
[ROW][C]69[/C][C]123.45[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]122[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]122.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]127.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]135.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]137.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]135[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]136[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]77[/C][C]138.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]134.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]138.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]133.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]133.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]141.2[/C][C]134.5786[/C][C]127.2762[/C][C]141.881[/C][C]0.0378[/C][C]0.6036[/C][C]0.9996[/C][C]0.6036[/C][/ROW]
[ROW][C]83[/C][C]148.9[/C][C]135.069[/C][C]123.2338[/C][C]146.9042[/C][C]0.011[/C][C]0.155[/C][C]0.9841[/C][C]0.5961[/C][/ROW]
[ROW][C]84[/C][C]148.9[/C][C]135.7317[/C][C]120.6711[/C][C]150.7922[/C][C]0.0433[/C][C]0.0433[/C][C]0.8609[/C][C]0.6093[/C][/ROW]
[ROW][C]85[/C][C]156.6[/C][C]137.8389[/C][C]120.1315[/C][C]155.5462[/C][C]0.0189[/C][C]0.1104[/C][C]0.6149[/C][C]0.6805[/C][/ROW]
[ROW][C]86[/C][C]161.6[/C][C]137.6153[/C][C]117.6176[/C][C]157.613[/C][C]0.0094[/C][C]0.0314[/C][C]0.5123[/C][C]0.653[/C][/ROW]
[ROW][C]87[/C][C]160.7[/C][C]137.8722[/C][C]115.8208[/C][C]159.9236[/C][C]0.0212[/C][C]0.0175[/C][C]0.6008[/C][C]0.6479[/C][/ROW]
[ROW][C]88[/C][C]156[/C][C]138.9261[/C][C]114.9967[/C][C]162.8556[/C][C]0.081[/C][C]0.0373[/C][C]0.5947[/C][C]0.6687[/C][/ROW]
[ROW][C]89[/C][C]159.5[/C][C]138.5374[/C][C]112.8668[/C][C]164.208[/C][C]0.0547[/C][C]0.0912[/C][C]0.5042[/C][C]0.6469[/C][/ROW]
[ROW][C]90[/C][C]168.7[/C][C]137.5491[/C][C]110.2483[/C][C]164.8499[/C][C]0.0127[/C][C]0.0575[/C][C]0.581[/C][C]0.6116[/C][/ROW]
[ROW][C]91[/C][C]169.9[/C][C]137.764[/C][C]108.9249[/C][C]166.6031[/C][C]0.0145[/C][C]0.0178[/C][C]0.4828[/C][C]0.6114[/C][/ROW]
[ROW][C]92[/C][C]169.9[/C][C]136.4434[/C][C]106.1441[/C][C]166.7427[/C][C]0.0152[/C][C]0.0152[/C][C]0.5653[/C][C]0.573[/C][/ROW]
[ROW][C]93[/C][C]169.9[/C][C]136.8173[/C][C]105.1249[/C][C]168.5097[/C][C]0.0204[/C][C]0.0204[/C][C]0.5789[/C][C]0.5789[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2847&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2847&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[81])
69123.45-------
70122-------
71122.1-------
72127.4-------
73135.2-------
74137.3-------
75135-------
76136-------
77138.4-------
78134.7-------
79138.4-------
80133.9-------
81133.6-------
82141.2134.5786127.2762141.8810.03780.60360.99960.6036
83148.9135.069123.2338146.90420.0110.1550.98410.5961
84148.9135.7317120.6711150.79220.04330.04330.86090.6093
85156.6137.8389120.1315155.54620.01890.11040.61490.6805
86161.6137.6153117.6176157.6130.00940.03140.51230.653
87160.7137.8722115.8208159.92360.02120.01750.60080.6479
88156138.9261114.9967162.85560.0810.03730.59470.6687
89159.5138.5374112.8668164.2080.05470.09120.50420.6469
90168.7137.5491110.2483164.84990.01270.05750.5810.6116
91169.9137.764108.9249166.60310.01450.01780.48280.6114
92169.9136.4434106.1441166.74270.01520.01520.56530.573
93169.9136.8173105.1249168.50970.02040.02040.57890.5789







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
820.02770.04920.004143.84273.65361.9114
830.04470.10240.0085191.295715.94133.9927
840.05660.0970.0081173.404814.45043.8014
850.06550.13610.0113351.980729.33175.4159
860.07410.17430.0145575.265947.93886.9238
870.08160.16560.0138521.108143.42576.5898
880.08790.12290.0102291.516524.2934.9288
890.09450.15130.0126439.430436.61926.0514
900.10130.22650.0189970.377880.86488.9925
910.10680.23330.01941032.724186.06039.2769
920.11330.24520.02041119.343393.27869.6581
930.11820.24180.02021094.46691.20559.5502

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
82 & 0.0277 & 0.0492 & 0.0041 & 43.8427 & 3.6536 & 1.9114 \tabularnewline
83 & 0.0447 & 0.1024 & 0.0085 & 191.2957 & 15.9413 & 3.9927 \tabularnewline
84 & 0.0566 & 0.097 & 0.0081 & 173.4048 & 14.4504 & 3.8014 \tabularnewline
85 & 0.0655 & 0.1361 & 0.0113 & 351.9807 & 29.3317 & 5.4159 \tabularnewline
86 & 0.0741 & 0.1743 & 0.0145 & 575.2659 & 47.9388 & 6.9238 \tabularnewline
87 & 0.0816 & 0.1656 & 0.0138 & 521.1081 & 43.4257 & 6.5898 \tabularnewline
88 & 0.0879 & 0.1229 & 0.0102 & 291.5165 & 24.293 & 4.9288 \tabularnewline
89 & 0.0945 & 0.1513 & 0.0126 & 439.4304 & 36.6192 & 6.0514 \tabularnewline
90 & 0.1013 & 0.2265 & 0.0189 & 970.3778 & 80.8648 & 8.9925 \tabularnewline
91 & 0.1068 & 0.2333 & 0.0194 & 1032.7241 & 86.0603 & 9.2769 \tabularnewline
92 & 0.1133 & 0.2452 & 0.0204 & 1119.3433 & 93.2786 & 9.6581 \tabularnewline
93 & 0.1182 & 0.2418 & 0.0202 & 1094.466 & 91.2055 & 9.5502 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2847&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]82[/C][C]0.0277[/C][C]0.0492[/C][C]0.0041[/C][C]43.8427[/C][C]3.6536[/C][C]1.9114[/C][/ROW]
[ROW][C]83[/C][C]0.0447[/C][C]0.1024[/C][C]0.0085[/C][C]191.2957[/C][C]15.9413[/C][C]3.9927[/C][/ROW]
[ROW][C]84[/C][C]0.0566[/C][C]0.097[/C][C]0.0081[/C][C]173.4048[/C][C]14.4504[/C][C]3.8014[/C][/ROW]
[ROW][C]85[/C][C]0.0655[/C][C]0.1361[/C][C]0.0113[/C][C]351.9807[/C][C]29.3317[/C][C]5.4159[/C][/ROW]
[ROW][C]86[/C][C]0.0741[/C][C]0.1743[/C][C]0.0145[/C][C]575.2659[/C][C]47.9388[/C][C]6.9238[/C][/ROW]
[ROW][C]87[/C][C]0.0816[/C][C]0.1656[/C][C]0.0138[/C][C]521.1081[/C][C]43.4257[/C][C]6.5898[/C][/ROW]
[ROW][C]88[/C][C]0.0879[/C][C]0.1229[/C][C]0.0102[/C][C]291.5165[/C][C]24.293[/C][C]4.9288[/C][/ROW]
[ROW][C]89[/C][C]0.0945[/C][C]0.1513[/C][C]0.0126[/C][C]439.4304[/C][C]36.6192[/C][C]6.0514[/C][/ROW]
[ROW][C]90[/C][C]0.1013[/C][C]0.2265[/C][C]0.0189[/C][C]970.3778[/C][C]80.8648[/C][C]8.9925[/C][/ROW]
[ROW][C]91[/C][C]0.1068[/C][C]0.2333[/C][C]0.0194[/C][C]1032.7241[/C][C]86.0603[/C][C]9.2769[/C][/ROW]
[ROW][C]92[/C][C]0.1133[/C][C]0.2452[/C][C]0.0204[/C][C]1119.3433[/C][C]93.2786[/C][C]9.6581[/C][/ROW]
[ROW][C]93[/C][C]0.1182[/C][C]0.2418[/C][C]0.0202[/C][C]1094.466[/C][C]91.2055[/C][C]9.5502[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2847&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2847&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
820.02770.04920.004143.84273.65361.9114
830.04470.10240.0085191.295715.94133.9927
840.05660.0970.0081173.404814.45043.8014
850.06550.13610.0113351.980729.33175.4159
860.07410.17430.0145575.265947.93886.9238
870.08160.16560.0138521.108143.42576.5898
880.08790.12290.0102291.516524.2934.9288
890.09450.15130.0126439.430436.61926.0514
900.10130.22650.0189970.377880.86488.9925
910.10680.23330.01941032.724186.06039.2769
920.11330.24520.02041119.343393.27869.6581
930.11820.24180.02021094.46691.20559.5502



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