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 computationFri, 24 Dec 2010 10:07:26 +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/24/t12931851906nm8xwt14k9d7dq.htm/, Retrieved Tue, 30 Apr 2024 03:01:25 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=114688, Retrieved Tue, 30 Apr 2024 03:01:25 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact133
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [arima forecasting...] [2010-12-24 10:07:26] [27f38de572a508a633f0ad2411de6a3e] [Current]
Feedback Forum

Post a new message
Dataseries X:
217,5
205
194
199,3
219,3
211,1
215,2
240,2
242,2
240,7
255,4
253
218,2
203,7
205,6
215,6
188,5
202,9
214
230,3
230
241
259,6
247,8
270,3
289,7
322,7
315
320,2
329,5
360,6
382,2
435,4
464
468,8
403
351,6
252
188
146,5
152,9
148,1
165,1
177
206,1
244,9
228,6
253,4
241,1
261,4
273,7
263,7
272,5
263,2
279,8
298,1
267,6
264,3
264,3
268,7
269,1




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24

\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 & 3 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114688&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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Sir Ronald Aylmer Fisher' @ 193.190.124.24[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114688&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114688&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 time3 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24







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])
37351.6-------
38252-------
39188-------
40146.5-------
41152.9-------
42148.1-------
43165.1-------
44177-------
45206.1-------
46244.9-------
47228.6-------
48253.4-------
49241.1-------
50261.4249.6232206.172293.07430.29760.64970.45730.6497
51273.7239.6506159.8823319.41890.20140.29650.89780.4858
52263.7244.6518123.9964365.30720.37850.31850.94460.523
53272.5239.025885.6247392.42680.33440.37630.86440.4894
54263.2242.667159.3401425.99410.41310.37490.8440.5067
55279.8239.593331.9221447.26440.35220.41180.7590.4943
56298.1242.032112.156471.90820.31630.37370.71040.5032
57267.6240.2134-8.9492489.3760.41470.32440.60580.4972
58264.3241.7219-25.5885509.03230.43430.42480.49070.5018
59264.3240.5887-43.3022524.47970.4350.4350.5330.4986
60268.7241.5004-58.2741541.27490.42940.44070.4690.501
61269.1240.792-73.8864555.47040.430.4310.49920.4992

\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 & 351.6 & - & - & - & - & - & - & - \tabularnewline
38 & 252 & - & - & - & - & - & - & - \tabularnewline
39 & 188 & - & - & - & - & - & - & - \tabularnewline
40 & 146.5 & - & - & - & - & - & - & - \tabularnewline
41 & 152.9 & - & - & - & - & - & - & - \tabularnewline
42 & 148.1 & - & - & - & - & - & - & - \tabularnewline
43 & 165.1 & - & - & - & - & - & - & - \tabularnewline
44 & 177 & - & - & - & - & - & - & - \tabularnewline
45 & 206.1 & - & - & - & - & - & - & - \tabularnewline
46 & 244.9 & - & - & - & - & - & - & - \tabularnewline
47 & 228.6 & - & - & - & - & - & - & - \tabularnewline
48 & 253.4 & - & - & - & - & - & - & - \tabularnewline
49 & 241.1 & - & - & - & - & - & - & - \tabularnewline
50 & 261.4 & 249.6232 & 206.172 & 293.0743 & 0.2976 & 0.6497 & 0.4573 & 0.6497 \tabularnewline
51 & 273.7 & 239.6506 & 159.8823 & 319.4189 & 0.2014 & 0.2965 & 0.8978 & 0.4858 \tabularnewline
52 & 263.7 & 244.6518 & 123.9964 & 365.3072 & 0.3785 & 0.3185 & 0.9446 & 0.523 \tabularnewline
53 & 272.5 & 239.0258 & 85.6247 & 392.4268 & 0.3344 & 0.3763 & 0.8644 & 0.4894 \tabularnewline
54 & 263.2 & 242.6671 & 59.3401 & 425.9941 & 0.4131 & 0.3749 & 0.844 & 0.5067 \tabularnewline
55 & 279.8 & 239.5933 & 31.9221 & 447.2644 & 0.3522 & 0.4118 & 0.759 & 0.4943 \tabularnewline
56 & 298.1 & 242.0321 & 12.156 & 471.9082 & 0.3163 & 0.3737 & 0.7104 & 0.5032 \tabularnewline
57 & 267.6 & 240.2134 & -8.9492 & 489.376 & 0.4147 & 0.3244 & 0.6058 & 0.4972 \tabularnewline
58 & 264.3 & 241.7219 & -25.5885 & 509.0323 & 0.4343 & 0.4248 & 0.4907 & 0.5018 \tabularnewline
59 & 264.3 & 240.5887 & -43.3022 & 524.4797 & 0.435 & 0.435 & 0.533 & 0.4986 \tabularnewline
60 & 268.7 & 241.5004 & -58.2741 & 541.2749 & 0.4294 & 0.4407 & 0.469 & 0.501 \tabularnewline
61 & 269.1 & 240.792 & -73.8864 & 555.4704 & 0.43 & 0.431 & 0.4992 & 0.4992 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114688&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]351.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]252[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]188[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]146.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]152.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]148.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]165.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]177[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]206.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]244.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]228.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]253.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]241.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]261.4[/C][C]249.6232[/C][C]206.172[/C][C]293.0743[/C][C]0.2976[/C][C]0.6497[/C][C]0.4573[/C][C]0.6497[/C][/ROW]
[ROW][C]51[/C][C]273.7[/C][C]239.6506[/C][C]159.8823[/C][C]319.4189[/C][C]0.2014[/C][C]0.2965[/C][C]0.8978[/C][C]0.4858[/C][/ROW]
[ROW][C]52[/C][C]263.7[/C][C]244.6518[/C][C]123.9964[/C][C]365.3072[/C][C]0.3785[/C][C]0.3185[/C][C]0.9446[/C][C]0.523[/C][/ROW]
[ROW][C]53[/C][C]272.5[/C][C]239.0258[/C][C]85.6247[/C][C]392.4268[/C][C]0.3344[/C][C]0.3763[/C][C]0.8644[/C][C]0.4894[/C][/ROW]
[ROW][C]54[/C][C]263.2[/C][C]242.6671[/C][C]59.3401[/C][C]425.9941[/C][C]0.4131[/C][C]0.3749[/C][C]0.844[/C][C]0.5067[/C][/ROW]
[ROW][C]55[/C][C]279.8[/C][C]239.5933[/C][C]31.9221[/C][C]447.2644[/C][C]0.3522[/C][C]0.4118[/C][C]0.759[/C][C]0.4943[/C][/ROW]
[ROW][C]56[/C][C]298.1[/C][C]242.0321[/C][C]12.156[/C][C]471.9082[/C][C]0.3163[/C][C]0.3737[/C][C]0.7104[/C][C]0.5032[/C][/ROW]
[ROW][C]57[/C][C]267.6[/C][C]240.2134[/C][C]-8.9492[/C][C]489.376[/C][C]0.4147[/C][C]0.3244[/C][C]0.6058[/C][C]0.4972[/C][/ROW]
[ROW][C]58[/C][C]264.3[/C][C]241.7219[/C][C]-25.5885[/C][C]509.0323[/C][C]0.4343[/C][C]0.4248[/C][C]0.4907[/C][C]0.5018[/C][/ROW]
[ROW][C]59[/C][C]264.3[/C][C]240.5887[/C][C]-43.3022[/C][C]524.4797[/C][C]0.435[/C][C]0.435[/C][C]0.533[/C][C]0.4986[/C][/ROW]
[ROW][C]60[/C][C]268.7[/C][C]241.5004[/C][C]-58.2741[/C][C]541.2749[/C][C]0.4294[/C][C]0.4407[/C][C]0.469[/C][C]0.501[/C][/ROW]
[ROW][C]61[/C][C]269.1[/C][C]240.792[/C][C]-73.8864[/C][C]555.4704[/C][C]0.43[/C][C]0.431[/C][C]0.4992[/C][C]0.4992[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114688&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114688&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])
37351.6-------
38252-------
39188-------
40146.5-------
41152.9-------
42148.1-------
43165.1-------
44177-------
45206.1-------
46244.9-------
47228.6-------
48253.4-------
49241.1-------
50261.4249.6232206.172293.07430.29760.64970.45730.6497
51273.7239.6506159.8823319.41890.20140.29650.89780.4858
52263.7244.6518123.9964365.30720.37850.31850.94460.523
53272.5239.025885.6247392.42680.33440.37630.86440.4894
54263.2242.667159.3401425.99410.41310.37490.8440.5067
55279.8239.593331.9221447.26440.35220.41180.7590.4943
56298.1242.032112.156471.90820.31630.37370.71040.5032
57267.6240.2134-8.9492489.3760.41470.32440.60580.4972
58264.3241.7219-25.5885509.03230.43430.42480.49070.5018
59264.3240.5887-43.3022524.47970.4350.4350.5330.4986
60268.7241.5004-58.2741541.27490.42940.44070.4690.501
61269.1240.792-73.8864555.47040.430.4310.49920.4992







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.08880.04720138.693400
510.16980.14210.09461159.3628649.028125.476
520.25160.07790.089362.8343553.630223.5293
530.32740.140.10181120.5229695.353426.3696
540.38540.08460.0984421.6014640.60325.3101
550.44220.16780.10991616.5795803.265728.3419
560.48460.23170.12733143.60961137.600633.7283
570.52920.1140.1257750.02621089.153833.0023
580.56420.09340.1221509.77141024.777932.0122
590.6020.09860.1197562.2235978.522531.2813
600.63330.11260.1191739.8197956.822230.9325
610.66680.11760.119801.3435943.865730.7224

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0888 & 0.0472 & 0 & 138.6934 & 0 & 0 \tabularnewline
51 & 0.1698 & 0.1421 & 0.0946 & 1159.3628 & 649.0281 & 25.476 \tabularnewline
52 & 0.2516 & 0.0779 & 0.089 & 362.8343 & 553.6302 & 23.5293 \tabularnewline
53 & 0.3274 & 0.14 & 0.1018 & 1120.5229 & 695.3534 & 26.3696 \tabularnewline
54 & 0.3854 & 0.0846 & 0.0984 & 421.6014 & 640.603 & 25.3101 \tabularnewline
55 & 0.4422 & 0.1678 & 0.1099 & 1616.5795 & 803.2657 & 28.3419 \tabularnewline
56 & 0.4846 & 0.2317 & 0.1273 & 3143.6096 & 1137.6006 & 33.7283 \tabularnewline
57 & 0.5292 & 0.114 & 0.1257 & 750.0262 & 1089.1538 & 33.0023 \tabularnewline
58 & 0.5642 & 0.0934 & 0.1221 & 509.7714 & 1024.7779 & 32.0122 \tabularnewline
59 & 0.602 & 0.0986 & 0.1197 & 562.2235 & 978.5225 & 31.2813 \tabularnewline
60 & 0.6333 & 0.1126 & 0.1191 & 739.8197 & 956.8222 & 30.9325 \tabularnewline
61 & 0.6668 & 0.1176 & 0.119 & 801.3435 & 943.8657 & 30.7224 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114688&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.0888[/C][C]0.0472[/C][C]0[/C][C]138.6934[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]0.1698[/C][C]0.1421[/C][C]0.0946[/C][C]1159.3628[/C][C]649.0281[/C][C]25.476[/C][/ROW]
[ROW][C]52[/C][C]0.2516[/C][C]0.0779[/C][C]0.089[/C][C]362.8343[/C][C]553.6302[/C][C]23.5293[/C][/ROW]
[ROW][C]53[/C][C]0.3274[/C][C]0.14[/C][C]0.1018[/C][C]1120.5229[/C][C]695.3534[/C][C]26.3696[/C][/ROW]
[ROW][C]54[/C][C]0.3854[/C][C]0.0846[/C][C]0.0984[/C][C]421.6014[/C][C]640.603[/C][C]25.3101[/C][/ROW]
[ROW][C]55[/C][C]0.4422[/C][C]0.1678[/C][C]0.1099[/C][C]1616.5795[/C][C]803.2657[/C][C]28.3419[/C][/ROW]
[ROW][C]56[/C][C]0.4846[/C][C]0.2317[/C][C]0.1273[/C][C]3143.6096[/C][C]1137.6006[/C][C]33.7283[/C][/ROW]
[ROW][C]57[/C][C]0.5292[/C][C]0.114[/C][C]0.1257[/C][C]750.0262[/C][C]1089.1538[/C][C]33.0023[/C][/ROW]
[ROW][C]58[/C][C]0.5642[/C][C]0.0934[/C][C]0.1221[/C][C]509.7714[/C][C]1024.7779[/C][C]32.0122[/C][/ROW]
[ROW][C]59[/C][C]0.602[/C][C]0.0986[/C][C]0.1197[/C][C]562.2235[/C][C]978.5225[/C][C]31.2813[/C][/ROW]
[ROW][C]60[/C][C]0.6333[/C][C]0.1126[/C][C]0.1191[/C][C]739.8197[/C][C]956.8222[/C][C]30.9325[/C][/ROW]
[ROW][C]61[/C][C]0.6668[/C][C]0.1176[/C][C]0.119[/C][C]801.3435[/C][C]943.8657[/C][C]30.7224[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114688&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114688&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.08880.04720138.693400
510.16980.14210.09461159.3628649.028125.476
520.25160.07790.089362.8343553.630223.5293
530.32740.140.10181120.5229695.353426.3696
540.38540.08460.0984421.6014640.60325.3101
550.44220.16780.10991616.5795803.265728.3419
560.48460.23170.12733143.60961137.600633.7283
570.52920.1140.1257750.02621089.153833.0023
580.56420.09340.1221509.77141024.777932.0122
590.6020.09860.1197562.2235978.522531.2813
600.63330.11260.1191739.8197956.822230.9325
610.66680.11760.119801.3435943.865730.7224



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