Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 13 Dec 2007 03:30:50 -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/13/t1197540946vogysu542kqhjfa.htm/, Retrieved Sun, 05 May 2024 14:46:04 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3402, Retrieved Sun, 05 May 2024 14:46:04 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsPaper G 29
Estimated Impact186
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Forecast Graan (m...] [2007-12-13 10:30:50] [7a600ca82a81f1b71fd92dcbb183f5b4] [Current]
Feedback Forum

Post a new message
Dataseries X:
174,1
180,4
182,6
207,1
213,7
186,5
179,1
168,3
156,5
144,3
138,9
137,8
136,3
140,3
149,1
149,2
140,4
129
124,7
130,8
130,1
133,2
130,1
126,6
124,8
125,3
126,9
120,1
118,7
117,7
113,4
107,5
107,6
114,3
114,9
111,2
109,9
108,6
109,2
106,4
103,7
103
96,9
104,7
102,2
99
95,8
94,5
102,7
103,2
105,6
103,9
107,2
100,7
92,1
90,3
93,4
98,5
100,8
102,3
104,7
101,1
101,4
99,5
98,4
96,3
100,7
101,2
100,3
97,8
97,4
98,6
99,7
99
98,1
97
98,5
103,8
114,4
124,5
134,2
131,8
125,6
119,9
114,9
115,5
112,5
111,4
115,3
110,8
103,7
111,1
113
111,2
117,6
121,7
127,3
129,8
137,1
141,4
137,4
130,7
117,2
110,8
111,4
108,2
108,8
110,2
109,5
109,5
116
111,2
112,1
114
119,1
114,1
115,1
115,4
110,8
116
119,2
126,5
127,8
131,3
140,3
137,3
143
134,5
139,9
159,3
170,4
175
175,8
180,9
180,3
169,6
172,3
184,8
177,7
184,6
211,4




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3402&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 time3 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[129])
117115.1-------
118115.4-------
119110.8-------
120116-------
121119.2-------
122126.5-------
123127.8-------
124131.3-------
125140.3-------
126137.3-------
127143-------
128134.5-------
129139.9-------
130159.3140.7192129.3007153.14610.00170.551410.5514
131170.4139.5757121.6337160.16440.00170.03020.99690.4877
132175140.5375117.4952168.09870.00710.01680.95950.5181
133175.8142.9933115.5076177.01940.02940.03260.91470.5707
134180.9145.2793113.9188185.27310.04040.06740.82130.604
135180.3146.8472112.1367192.30190.07460.0710.79430.6177
136169.6148.074110.3776198.64460.20210.10580.74220.6243
137172.3150.0609109.3922205.8490.21730.24620.63420.6394
138184.8145.3259103.757203.54870.09190.18190.60650.5725
139177.7141.93799.3696202.73930.12450.08350.48630.5262
140184.6141.78897.4372206.3260.09680.13770.58760.5229
141211.4144.241997.3837213.6470.02890.12720.54880.5488

\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[129]) \tabularnewline
117 & 115.1 & - & - & - & - & - & - & - \tabularnewline
118 & 115.4 & - & - & - & - & - & - & - \tabularnewline
119 & 110.8 & - & - & - & - & - & - & - \tabularnewline
120 & 116 & - & - & - & - & - & - & - \tabularnewline
121 & 119.2 & - & - & - & - & - & - & - \tabularnewline
122 & 126.5 & - & - & - & - & - & - & - \tabularnewline
123 & 127.8 & - & - & - & - & - & - & - \tabularnewline
124 & 131.3 & - & - & - & - & - & - & - \tabularnewline
125 & 140.3 & - & - & - & - & - & - & - \tabularnewline
126 & 137.3 & - & - & - & - & - & - & - \tabularnewline
127 & 143 & - & - & - & - & - & - & - \tabularnewline
128 & 134.5 & - & - & - & - & - & - & - \tabularnewline
129 & 139.9 & - & - & - & - & - & - & - \tabularnewline
130 & 159.3 & 140.7192 & 129.3007 & 153.1461 & 0.0017 & 0.5514 & 1 & 0.5514 \tabularnewline
131 & 170.4 & 139.5757 & 121.6337 & 160.1644 & 0.0017 & 0.0302 & 0.9969 & 0.4877 \tabularnewline
132 & 175 & 140.5375 & 117.4952 & 168.0987 & 0.0071 & 0.0168 & 0.9595 & 0.5181 \tabularnewline
133 & 175.8 & 142.9933 & 115.5076 & 177.0194 & 0.0294 & 0.0326 & 0.9147 & 0.5707 \tabularnewline
134 & 180.9 & 145.2793 & 113.9188 & 185.2731 & 0.0404 & 0.0674 & 0.8213 & 0.604 \tabularnewline
135 & 180.3 & 146.8472 & 112.1367 & 192.3019 & 0.0746 & 0.071 & 0.7943 & 0.6177 \tabularnewline
136 & 169.6 & 148.074 & 110.3776 & 198.6446 & 0.2021 & 0.1058 & 0.7422 & 0.6243 \tabularnewline
137 & 172.3 & 150.0609 & 109.3922 & 205.849 & 0.2173 & 0.2462 & 0.6342 & 0.6394 \tabularnewline
138 & 184.8 & 145.3259 & 103.757 & 203.5487 & 0.0919 & 0.1819 & 0.6065 & 0.5725 \tabularnewline
139 & 177.7 & 141.937 & 99.3696 & 202.7393 & 0.1245 & 0.0835 & 0.4863 & 0.5262 \tabularnewline
140 & 184.6 & 141.788 & 97.4372 & 206.326 & 0.0968 & 0.1377 & 0.5876 & 0.5229 \tabularnewline
141 & 211.4 & 144.2419 & 97.3837 & 213.647 & 0.0289 & 0.1272 & 0.5488 & 0.5488 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3402&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[129])[/C][/ROW]
[ROW][C]117[/C][C]115.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]115.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]110.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]116[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]119.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]122[/C][C]126.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]123[/C][C]127.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]124[/C][C]131.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]125[/C][C]140.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]126[/C][C]137.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]127[/C][C]143[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]128[/C][C]134.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]129[/C][C]139.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]130[/C][C]159.3[/C][C]140.7192[/C][C]129.3007[/C][C]153.1461[/C][C]0.0017[/C][C]0.5514[/C][C]1[/C][C]0.5514[/C][/ROW]
[ROW][C]131[/C][C]170.4[/C][C]139.5757[/C][C]121.6337[/C][C]160.1644[/C][C]0.0017[/C][C]0.0302[/C][C]0.9969[/C][C]0.4877[/C][/ROW]
[ROW][C]132[/C][C]175[/C][C]140.5375[/C][C]117.4952[/C][C]168.0987[/C][C]0.0071[/C][C]0.0168[/C][C]0.9595[/C][C]0.5181[/C][/ROW]
[ROW][C]133[/C][C]175.8[/C][C]142.9933[/C][C]115.5076[/C][C]177.0194[/C][C]0.0294[/C][C]0.0326[/C][C]0.9147[/C][C]0.5707[/C][/ROW]
[ROW][C]134[/C][C]180.9[/C][C]145.2793[/C][C]113.9188[/C][C]185.2731[/C][C]0.0404[/C][C]0.0674[/C][C]0.8213[/C][C]0.604[/C][/ROW]
[ROW][C]135[/C][C]180.3[/C][C]146.8472[/C][C]112.1367[/C][C]192.3019[/C][C]0.0746[/C][C]0.071[/C][C]0.7943[/C][C]0.6177[/C][/ROW]
[ROW][C]136[/C][C]169.6[/C][C]148.074[/C][C]110.3776[/C][C]198.6446[/C][C]0.2021[/C][C]0.1058[/C][C]0.7422[/C][C]0.6243[/C][/ROW]
[ROW][C]137[/C][C]172.3[/C][C]150.0609[/C][C]109.3922[/C][C]205.849[/C][C]0.2173[/C][C]0.2462[/C][C]0.6342[/C][C]0.6394[/C][/ROW]
[ROW][C]138[/C][C]184.8[/C][C]145.3259[/C][C]103.757[/C][C]203.5487[/C][C]0.0919[/C][C]0.1819[/C][C]0.6065[/C][C]0.5725[/C][/ROW]
[ROW][C]139[/C][C]177.7[/C][C]141.937[/C][C]99.3696[/C][C]202.7393[/C][C]0.1245[/C][C]0.0835[/C][C]0.4863[/C][C]0.5262[/C][/ROW]
[ROW][C]140[/C][C]184.6[/C][C]141.788[/C][C]97.4372[/C][C]206.326[/C][C]0.0968[/C][C]0.1377[/C][C]0.5876[/C][C]0.5229[/C][/ROW]
[ROW][C]141[/C][C]211.4[/C][C]144.2419[/C][C]97.3837[/C][C]213.647[/C][C]0.0289[/C][C]0.1272[/C][C]0.5488[/C][C]0.5488[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3402&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3402&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[129])
117115.1-------
118115.4-------
119110.8-------
120116-------
121119.2-------
122126.5-------
123127.8-------
124131.3-------
125140.3-------
126137.3-------
127143-------
128134.5-------
129139.9-------
130159.3140.7192129.3007153.14610.00170.551410.5514
131170.4139.5757121.6337160.16440.00170.03020.99690.4877
132175140.5375117.4952168.09870.00710.01680.95950.5181
133175.8142.9933115.5076177.01940.02940.03260.91470.5707
134180.9145.2793113.9188185.27310.04040.06740.82130.604
135180.3146.8472112.1367192.30190.07460.0710.79430.6177
136169.6148.074110.3776198.64460.20210.10580.74220.6243
137172.3150.0609109.3922205.8490.21730.24620.63420.6394
138184.8145.3259103.757203.54870.09190.18190.60650.5725
139177.7141.93799.3696202.73930.12450.08350.48630.5262
140184.6141.78897.4372206.3260.09680.13770.58760.5229
141211.4144.241997.3837213.6470.02890.12720.54880.5488







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1300.04510.1320.011345.24628.77055.3638
1310.07530.22080.0184950.135379.17798.8982
1320.10010.24520.02041187.662498.97199.9485
1330.12140.22940.01911076.279189.68999.4705
1340.14050.24520.02041268.8331105.736110.2828
1350.15790.22780.0191119.090793.25769.657
1360.17420.14540.0121463.368438.6146.214
1370.18970.14820.0124494.577641.21486.4199
1380.20440.27160.02261558.2064129.850511.3952
1390.21860.2520.0211278.992106.582710.3239
1400.23220.30190.02521832.8684152.73912.3588
1410.24550.46560.03884510.2084375.850719.3869

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
130 & 0.0451 & 0.132 & 0.011 & 345.246 & 28.7705 & 5.3638 \tabularnewline
131 & 0.0753 & 0.2208 & 0.0184 & 950.1353 & 79.1779 & 8.8982 \tabularnewline
132 & 0.1001 & 0.2452 & 0.0204 & 1187.6624 & 98.9719 & 9.9485 \tabularnewline
133 & 0.1214 & 0.2294 & 0.0191 & 1076.2791 & 89.6899 & 9.4705 \tabularnewline
134 & 0.1405 & 0.2452 & 0.0204 & 1268.8331 & 105.7361 & 10.2828 \tabularnewline
135 & 0.1579 & 0.2278 & 0.019 & 1119.0907 & 93.2576 & 9.657 \tabularnewline
136 & 0.1742 & 0.1454 & 0.0121 & 463.3684 & 38.614 & 6.214 \tabularnewline
137 & 0.1897 & 0.1482 & 0.0124 & 494.5776 & 41.2148 & 6.4199 \tabularnewline
138 & 0.2044 & 0.2716 & 0.0226 & 1558.2064 & 129.8505 & 11.3952 \tabularnewline
139 & 0.2186 & 0.252 & 0.021 & 1278.992 & 106.5827 & 10.3239 \tabularnewline
140 & 0.2322 & 0.3019 & 0.0252 & 1832.8684 & 152.739 & 12.3588 \tabularnewline
141 & 0.2455 & 0.4656 & 0.0388 & 4510.2084 & 375.8507 & 19.3869 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3402&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]130[/C][C]0.0451[/C][C]0.132[/C][C]0.011[/C][C]345.246[/C][C]28.7705[/C][C]5.3638[/C][/ROW]
[ROW][C]131[/C][C]0.0753[/C][C]0.2208[/C][C]0.0184[/C][C]950.1353[/C][C]79.1779[/C][C]8.8982[/C][/ROW]
[ROW][C]132[/C][C]0.1001[/C][C]0.2452[/C][C]0.0204[/C][C]1187.6624[/C][C]98.9719[/C][C]9.9485[/C][/ROW]
[ROW][C]133[/C][C]0.1214[/C][C]0.2294[/C][C]0.0191[/C][C]1076.2791[/C][C]89.6899[/C][C]9.4705[/C][/ROW]
[ROW][C]134[/C][C]0.1405[/C][C]0.2452[/C][C]0.0204[/C][C]1268.8331[/C][C]105.7361[/C][C]10.2828[/C][/ROW]
[ROW][C]135[/C][C]0.1579[/C][C]0.2278[/C][C]0.019[/C][C]1119.0907[/C][C]93.2576[/C][C]9.657[/C][/ROW]
[ROW][C]136[/C][C]0.1742[/C][C]0.1454[/C][C]0.0121[/C][C]463.3684[/C][C]38.614[/C][C]6.214[/C][/ROW]
[ROW][C]137[/C][C]0.1897[/C][C]0.1482[/C][C]0.0124[/C][C]494.5776[/C][C]41.2148[/C][C]6.4199[/C][/ROW]
[ROW][C]138[/C][C]0.2044[/C][C]0.2716[/C][C]0.0226[/C][C]1558.2064[/C][C]129.8505[/C][C]11.3952[/C][/ROW]
[ROW][C]139[/C][C]0.2186[/C][C]0.252[/C][C]0.021[/C][C]1278.992[/C][C]106.5827[/C][C]10.3239[/C][/ROW]
[ROW][C]140[/C][C]0.2322[/C][C]0.3019[/C][C]0.0252[/C][C]1832.8684[/C][C]152.739[/C][C]12.3588[/C][/ROW]
[ROW][C]141[/C][C]0.2455[/C][C]0.4656[/C][C]0.0388[/C][C]4510.2084[/C][C]375.8507[/C][C]19.3869[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3402&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3402&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
1300.04510.1320.011345.24628.77055.3638
1310.07530.22080.0184950.135379.17798.8982
1320.10010.24520.02041187.662498.97199.9485
1330.12140.22940.01911076.279189.68999.4705
1340.14050.24520.02041268.8331105.736110.2828
1350.15790.22780.0191119.090793.25769.657
1360.17420.14540.0121463.368438.6146.214
1370.18970.14820.0124494.577641.21486.4199
1380.20440.27160.02261558.2064129.850511.3952
1390.21860.2520.0211278.992106.582710.3239
1400.23220.30190.02521832.8684152.73912.3588
1410.24550.46560.03884510.2084375.850719.3869



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