Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 29 Dec 2010 19:50:34 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/29/t1293652108sxyst439mhuqkg2.htm/, Retrieved Fri, 03 May 2024 12:31:52 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=117071, Retrieved Fri, 03 May 2024 12:31:52 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact114
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Paper] [2010-12-29 19:50:34] [d5e0edb7e0239841e94676417b2a1e2e] [Current]
Feedback Forum

Post a new message
Dataseries X:
235243
230354
227184
221678
217142
219452
256446
265845
248624
241114
229245
231805
219277
219313
212610
214771
211142
211457
240048
240636
230580
208795
197922
194596
194581
185686
178106
172608
167302
168053
202300
202388
182516
173476
166444
171297
169701
164182
161914
159612
151001
158114
186530
187069
174330
169362
166827
178037
186413
189226
191563
188906
186005
195309
223532
226899
214126
206903
204442
220375
214320
212588
205816
202196
195722
198563
229139
229527
211868
203555
195770




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Herman Ole Andreas Wold' @ www.yougetit.org

\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 & 1 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ www.yougetit.org \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117071&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]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ www.yougetit.org[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117071&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117071&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 time1 seconds
R Server'Herman Ole Andreas Wold' @ www.yougetit.org







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[59])
47166827-------
48178037-------
49186413-------
50189226-------
51191563-------
52188906-------
53186005-------
54195309-------
55223532-------
56226899-------
57214126-------
58206903-------
59204442-------
60220375211582.0919201700.7415221463.44230.04060.921710.9217
61214320215037.1765200472.4584229601.89460.46160.23630.99990.923
62212588213820.1627193330.3168234310.00860.45310.48090.99070.8152
63205816213007.7007187599.1494238416.25190.28950.51290.9510.7456
64202196210498.1642180224.1116240772.21670.29550.61910.91890.6525
65195722205877.7455171251.634240503.85690.28270.58250.86970.5324
66198563212274.2173536.9044251011.49560.24390.79880.80470.6541
67229139242095.8849199571.862284619.90790.27520.97760.80390.9587
68229527244466.1452198381.048290551.24250.26260.74280.77250.9556
69211868230678.5868181258.6676280098.5060.22780.51820.74420.851
70203555222483.7044169910.6255275056.78320.24020.65390.71930.7494
71195770218034.5679162475.0637273594.07220.21610.69530.68420.6842

\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[59]) \tabularnewline
47 & 166827 & - & - & - & - & - & - & - \tabularnewline
48 & 178037 & - & - & - & - & - & - & - \tabularnewline
49 & 186413 & - & - & - & - & - & - & - \tabularnewline
50 & 189226 & - & - & - & - & - & - & - \tabularnewline
51 & 191563 & - & - & - & - & - & - & - \tabularnewline
52 & 188906 & - & - & - & - & - & - & - \tabularnewline
53 & 186005 & - & - & - & - & - & - & - \tabularnewline
54 & 195309 & - & - & - & - & - & - & - \tabularnewline
55 & 223532 & - & - & - & - & - & - & - \tabularnewline
56 & 226899 & - & - & - & - & - & - & - \tabularnewline
57 & 214126 & - & - & - & - & - & - & - \tabularnewline
58 & 206903 & - & - & - & - & - & - & - \tabularnewline
59 & 204442 & - & - & - & - & - & - & - \tabularnewline
60 & 220375 & 211582.0919 & 201700.7415 & 221463.4423 & 0.0406 & 0.9217 & 1 & 0.9217 \tabularnewline
61 & 214320 & 215037.1765 & 200472.4584 & 229601.8946 & 0.4616 & 0.2363 & 0.9999 & 0.923 \tabularnewline
62 & 212588 & 213820.1627 & 193330.3168 & 234310.0086 & 0.4531 & 0.4809 & 0.9907 & 0.8152 \tabularnewline
63 & 205816 & 213007.7007 & 187599.1494 & 238416.2519 & 0.2895 & 0.5129 & 0.951 & 0.7456 \tabularnewline
64 & 202196 & 210498.1642 & 180224.1116 & 240772.2167 & 0.2955 & 0.6191 & 0.9189 & 0.6525 \tabularnewline
65 & 195722 & 205877.7455 & 171251.634 & 240503.8569 & 0.2827 & 0.5825 & 0.8697 & 0.5324 \tabularnewline
66 & 198563 & 212274.2 & 173536.9044 & 251011.4956 & 0.2439 & 0.7988 & 0.8047 & 0.6541 \tabularnewline
67 & 229139 & 242095.8849 & 199571.862 & 284619.9079 & 0.2752 & 0.9776 & 0.8039 & 0.9587 \tabularnewline
68 & 229527 & 244466.1452 & 198381.048 & 290551.2425 & 0.2626 & 0.7428 & 0.7725 & 0.9556 \tabularnewline
69 & 211868 & 230678.5868 & 181258.6676 & 280098.506 & 0.2278 & 0.5182 & 0.7442 & 0.851 \tabularnewline
70 & 203555 & 222483.7044 & 169910.6255 & 275056.7832 & 0.2402 & 0.6539 & 0.7193 & 0.7494 \tabularnewline
71 & 195770 & 218034.5679 & 162475.0637 & 273594.0722 & 0.2161 & 0.6953 & 0.6842 & 0.6842 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117071&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[59])[/C][/ROW]
[ROW][C]47[/C][C]166827[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]178037[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]186413[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]189226[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]191563[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]188906[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]186005[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]195309[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]223532[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]226899[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]214126[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]206903[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]204442[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]220375[/C][C]211582.0919[/C][C]201700.7415[/C][C]221463.4423[/C][C]0.0406[/C][C]0.9217[/C][C]1[/C][C]0.9217[/C][/ROW]
[ROW][C]61[/C][C]214320[/C][C]215037.1765[/C][C]200472.4584[/C][C]229601.8946[/C][C]0.4616[/C][C]0.2363[/C][C]0.9999[/C][C]0.923[/C][/ROW]
[ROW][C]62[/C][C]212588[/C][C]213820.1627[/C][C]193330.3168[/C][C]234310.0086[/C][C]0.4531[/C][C]0.4809[/C][C]0.9907[/C][C]0.8152[/C][/ROW]
[ROW][C]63[/C][C]205816[/C][C]213007.7007[/C][C]187599.1494[/C][C]238416.2519[/C][C]0.2895[/C][C]0.5129[/C][C]0.951[/C][C]0.7456[/C][/ROW]
[ROW][C]64[/C][C]202196[/C][C]210498.1642[/C][C]180224.1116[/C][C]240772.2167[/C][C]0.2955[/C][C]0.6191[/C][C]0.9189[/C][C]0.6525[/C][/ROW]
[ROW][C]65[/C][C]195722[/C][C]205877.7455[/C][C]171251.634[/C][C]240503.8569[/C][C]0.2827[/C][C]0.5825[/C][C]0.8697[/C][C]0.5324[/C][/ROW]
[ROW][C]66[/C][C]198563[/C][C]212274.2[/C][C]173536.9044[/C][C]251011.4956[/C][C]0.2439[/C][C]0.7988[/C][C]0.8047[/C][C]0.6541[/C][/ROW]
[ROW][C]67[/C][C]229139[/C][C]242095.8849[/C][C]199571.862[/C][C]284619.9079[/C][C]0.2752[/C][C]0.9776[/C][C]0.8039[/C][C]0.9587[/C][/ROW]
[ROW][C]68[/C][C]229527[/C][C]244466.1452[/C][C]198381.048[/C][C]290551.2425[/C][C]0.2626[/C][C]0.7428[/C][C]0.7725[/C][C]0.9556[/C][/ROW]
[ROW][C]69[/C][C]211868[/C][C]230678.5868[/C][C]181258.6676[/C][C]280098.506[/C][C]0.2278[/C][C]0.5182[/C][C]0.7442[/C][C]0.851[/C][/ROW]
[ROW][C]70[/C][C]203555[/C][C]222483.7044[/C][C]169910.6255[/C][C]275056.7832[/C][C]0.2402[/C][C]0.6539[/C][C]0.7193[/C][C]0.7494[/C][/ROW]
[ROW][C]71[/C][C]195770[/C][C]218034.5679[/C][C]162475.0637[/C][C]273594.0722[/C][C]0.2161[/C][C]0.6953[/C][C]0.6842[/C][C]0.6842[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117071&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117071&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[59])
47166827-------
48178037-------
49186413-------
50189226-------
51191563-------
52188906-------
53186005-------
54195309-------
55223532-------
56226899-------
57214126-------
58206903-------
59204442-------
60220375211582.0919201700.7415221463.44230.04060.921710.9217
61214320215037.1765200472.4584229601.89460.46160.23630.99990.923
62212588213820.1627193330.3168234310.00860.45310.48090.99070.8152
63205816213007.7007187599.1494238416.25190.28950.51290.9510.7456
64202196210498.1642180224.1116240772.21670.29550.61910.91890.6525
65195722205877.7455171251.634240503.85690.28270.58250.86970.5324
66198563212274.2173536.9044251011.49560.24390.79880.80470.6541
67229139242095.8849199571.862284619.90790.27520.97760.80390.9587
68229527244466.1452198381.048290551.24250.26260.74280.77250.9556
69211868230678.5868181258.6676280098.5060.22780.51820.74420.851
70203555222483.7044169910.6255275056.78320.24020.65390.71930.7494
71195770218034.5679162475.0637273594.07220.21610.69530.68420.6842







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
600.02380.0416077315232.921300
610.0346-0.00330.0224514342.097238914787.50936238.1718
620.0489-0.00580.01691518224.87126449266.62985142.885
630.0609-0.03380.021151720558.775332767089.66625724.2545
640.0734-0.03940.024868925929.613539998857.65576324.465
650.0858-0.04930.0289103139165.736650522242.33587107.9
660.0931-0.06460.034187997004.685270161494.18376.2458
670.0896-0.05350.0364167880866.924182376415.7039076.1454
680.0962-0.06110.0392223178059.755798021042.829900.5577
690.1093-0.08150.0434353838175.6565123602756.103611117.6776
700.1206-0.08510.0472358295849.9295144938491.90612039.0403
710.13-0.10210.0518495710985.7269174169533.057713197.3305

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
60 & 0.0238 & 0.0416 & 0 & 77315232.9213 & 0 & 0 \tabularnewline
61 & 0.0346 & -0.0033 & 0.0224 & 514342.0972 & 38914787.5093 & 6238.1718 \tabularnewline
62 & 0.0489 & -0.0058 & 0.0169 & 1518224.871 & 26449266.6298 & 5142.885 \tabularnewline
63 & 0.0609 & -0.0338 & 0.0211 & 51720558.7753 & 32767089.6662 & 5724.2545 \tabularnewline
64 & 0.0734 & -0.0394 & 0.0248 & 68925929.6135 & 39998857.6557 & 6324.465 \tabularnewline
65 & 0.0858 & -0.0493 & 0.0289 & 103139165.7366 & 50522242.3358 & 7107.9 \tabularnewline
66 & 0.0931 & -0.0646 & 0.034 & 187997004.6852 & 70161494.1 & 8376.2458 \tabularnewline
67 & 0.0896 & -0.0535 & 0.0364 & 167880866.9241 & 82376415.703 & 9076.1454 \tabularnewline
68 & 0.0962 & -0.0611 & 0.0392 & 223178059.7557 & 98021042.82 & 9900.5577 \tabularnewline
69 & 0.1093 & -0.0815 & 0.0434 & 353838175.6565 & 123602756.1036 & 11117.6776 \tabularnewline
70 & 0.1206 & -0.0851 & 0.0472 & 358295849.9295 & 144938491.906 & 12039.0403 \tabularnewline
71 & 0.13 & -0.1021 & 0.0518 & 495710985.7269 & 174169533.0577 & 13197.3305 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117071&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]60[/C][C]0.0238[/C][C]0.0416[/C][C]0[/C][C]77315232.9213[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]61[/C][C]0.0346[/C][C]-0.0033[/C][C]0.0224[/C][C]514342.0972[/C][C]38914787.5093[/C][C]6238.1718[/C][/ROW]
[ROW][C]62[/C][C]0.0489[/C][C]-0.0058[/C][C]0.0169[/C][C]1518224.871[/C][C]26449266.6298[/C][C]5142.885[/C][/ROW]
[ROW][C]63[/C][C]0.0609[/C][C]-0.0338[/C][C]0.0211[/C][C]51720558.7753[/C][C]32767089.6662[/C][C]5724.2545[/C][/ROW]
[ROW][C]64[/C][C]0.0734[/C][C]-0.0394[/C][C]0.0248[/C][C]68925929.6135[/C][C]39998857.6557[/C][C]6324.465[/C][/ROW]
[ROW][C]65[/C][C]0.0858[/C][C]-0.0493[/C][C]0.0289[/C][C]103139165.7366[/C][C]50522242.3358[/C][C]7107.9[/C][/ROW]
[ROW][C]66[/C][C]0.0931[/C][C]-0.0646[/C][C]0.034[/C][C]187997004.6852[/C][C]70161494.1[/C][C]8376.2458[/C][/ROW]
[ROW][C]67[/C][C]0.0896[/C][C]-0.0535[/C][C]0.0364[/C][C]167880866.9241[/C][C]82376415.703[/C][C]9076.1454[/C][/ROW]
[ROW][C]68[/C][C]0.0962[/C][C]-0.0611[/C][C]0.0392[/C][C]223178059.7557[/C][C]98021042.82[/C][C]9900.5577[/C][/ROW]
[ROW][C]69[/C][C]0.1093[/C][C]-0.0815[/C][C]0.0434[/C][C]353838175.6565[/C][C]123602756.1036[/C][C]11117.6776[/C][/ROW]
[ROW][C]70[/C][C]0.1206[/C][C]-0.0851[/C][C]0.0472[/C][C]358295849.9295[/C][C]144938491.906[/C][C]12039.0403[/C][/ROW]
[ROW][C]71[/C][C]0.13[/C][C]-0.1021[/C][C]0.0518[/C][C]495710985.7269[/C][C]174169533.0577[/C][C]13197.3305[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117071&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117071&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
600.02380.0416077315232.921300
610.0346-0.00330.0224514342.097238914787.50936238.1718
620.0489-0.00580.01691518224.87126449266.62985142.885
630.0609-0.03380.021151720558.775332767089.66625724.2545
640.0734-0.03940.024868925929.613539998857.65576324.465
650.0858-0.04930.0289103139165.736650522242.33587107.9
660.0931-0.06460.034187997004.685270161494.18376.2458
670.0896-0.05350.0364167880866.924182376415.7039076.1454
680.0962-0.06110.0392223178059.755798021042.829900.5577
690.1093-0.08150.0434353838175.6565123602756.103611117.6776
700.1206-0.08510.0472358295849.9295144938491.90612039.0403
710.13-0.10210.0518495710985.7269174169533.057713197.3305



Parameters (Session):
par1 = 1 ; par2 = 1 ; par3 = 0 ; par4 = 12 ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 2 ; par7 = 0 ; par8 = 0 ; 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,par1))
(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.mape1 <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- array(0, dim=fx)
perf.mse1 <- 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.se[i] = (x[nx+i] - forecast$pred[i])^2
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[1] = abs(perf.pe[1])
perf.mse[1] = abs(perf.se[1])
for (i in 2:fx) {
perf.mape[i] = perf.mape[i-1] + abs(perf.pe[i])
perf.mape1[i] = perf.mape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
}
perf.rmse = sqrt(perf.mse1)
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:par1] <- 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.mape1[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse1[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')