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 computationSat, 12 Dec 2009 03:07: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/2009/Dec/12/t1260612600sq8oahvizcj3m2g.htm/, Retrieved Mon, 29 Apr 2024 10:33:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=66861, Retrieved Mon, 29 Apr 2024 10:33:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact163
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Arima forecasting] [2009-12-12 10:07:50] [e458b4e05bf28a297f8af8d9f96e59d6] [Current]
Feedback Forum

Post a new message
Dataseries X:
96.2
96.8
109.9
88
91.1
106.4
68.6
100.1
108
106
108.6
91.5
99.2
98
96.6
102.8
96.9
110
70.5
101.9
109.6
107.8
113
93.8
108
102.8
116.3
89.2
106.7
112.1
74.2
108.8
111.5
118.8
118.9
97.6
116.4
107.9
121.2
97.9
113.4
117.6
79.6
115.9
115.7
129.1
123.3
96.7
121.2
118.2
102.1
125.4
116.7
121.3
85.3
114.2
124.4
131
118.3
99.6




Summary of computational 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 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 & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66861&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]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66861&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66861&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'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[48])
3697.6-------
37116.4-------
38107.9-------
39121.2-------
4097.9-------
41113.4-------
42117.6-------
4379.6-------
44115.9-------
45115.7-------
46129.1-------
47123.3-------
4896.7-------
49121.2121.1276112.1258130.19670.493810.84651
50118.2112.3378102.7873121.97020.11650.03570.81670.9993
51102.1119.83110.1051129.63462e-040.62770.39211
52125.4107.863898.2073117.60762e-040.87690.97750.9876
53116.7115.2401105.4613125.10270.38590.02170.64270.9999
54121.3123.2794113.407133.23160.34830.90250.86831
5585.384.316174.78993.95230.420700.83130.0059
56114.2118.5996108.6896128.59320.194110.70181
57124.4122.2768112.2982132.33760.33960.94220.91
58131128.2287118.1644138.37270.29620.77030.43321
59118.3128.1382118.0378138.31890.02910.29080.82421
6099.6105.419695.4866115.44720.12770.00590.95580.9558

\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[48]) \tabularnewline
36 & 97.6 & - & - & - & - & - & - & - \tabularnewline
37 & 116.4 & - & - & - & - & - & - & - \tabularnewline
38 & 107.9 & - & - & - & - & - & - & - \tabularnewline
39 & 121.2 & - & - & - & - & - & - & - \tabularnewline
40 & 97.9 & - & - & - & - & - & - & - \tabularnewline
41 & 113.4 & - & - & - & - & - & - & - \tabularnewline
42 & 117.6 & - & - & - & - & - & - & - \tabularnewline
43 & 79.6 & - & - & - & - & - & - & - \tabularnewline
44 & 115.9 & - & - & - & - & - & - & - \tabularnewline
45 & 115.7 & - & - & - & - & - & - & - \tabularnewline
46 & 129.1 & - & - & - & - & - & - & - \tabularnewline
47 & 123.3 & - & - & - & - & - & - & - \tabularnewline
48 & 96.7 & - & - & - & - & - & - & - \tabularnewline
49 & 121.2 & 121.1276 & 112.1258 & 130.1967 & 0.4938 & 1 & 0.8465 & 1 \tabularnewline
50 & 118.2 & 112.3378 & 102.7873 & 121.9702 & 0.1165 & 0.0357 & 0.8167 & 0.9993 \tabularnewline
51 & 102.1 & 119.83 & 110.1051 & 129.6346 & 2e-04 & 0.6277 & 0.3921 & 1 \tabularnewline
52 & 125.4 & 107.8638 & 98.2073 & 117.6076 & 2e-04 & 0.8769 & 0.9775 & 0.9876 \tabularnewline
53 & 116.7 & 115.2401 & 105.4613 & 125.1027 & 0.3859 & 0.0217 & 0.6427 & 0.9999 \tabularnewline
54 & 121.3 & 123.2794 & 113.407 & 133.2316 & 0.3483 & 0.9025 & 0.8683 & 1 \tabularnewline
55 & 85.3 & 84.3161 & 74.789 & 93.9523 & 0.4207 & 0 & 0.8313 & 0.0059 \tabularnewline
56 & 114.2 & 118.5996 & 108.6896 & 128.5932 & 0.1941 & 1 & 0.7018 & 1 \tabularnewline
57 & 124.4 & 122.2768 & 112.2982 & 132.3376 & 0.3396 & 0.9422 & 0.9 & 1 \tabularnewline
58 & 131 & 128.2287 & 118.1644 & 138.3727 & 0.2962 & 0.7703 & 0.4332 & 1 \tabularnewline
59 & 118.3 & 128.1382 & 118.0378 & 138.3189 & 0.0291 & 0.2908 & 0.8242 & 1 \tabularnewline
60 & 99.6 & 105.4196 & 95.4866 & 115.4472 & 0.1277 & 0.0059 & 0.9558 & 0.9558 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66861&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[48])[/C][/ROW]
[ROW][C]36[/C][C]97.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]116.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]107.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]121.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]97.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]113.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]117.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]79.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]115.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]115.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]129.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]123.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]96.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]121.2[/C][C]121.1276[/C][C]112.1258[/C][C]130.1967[/C][C]0.4938[/C][C]1[/C][C]0.8465[/C][C]1[/C][/ROW]
[ROW][C]50[/C][C]118.2[/C][C]112.3378[/C][C]102.7873[/C][C]121.9702[/C][C]0.1165[/C][C]0.0357[/C][C]0.8167[/C][C]0.9993[/C][/ROW]
[ROW][C]51[/C][C]102.1[/C][C]119.83[/C][C]110.1051[/C][C]129.6346[/C][C]2e-04[/C][C]0.6277[/C][C]0.3921[/C][C]1[/C][/ROW]
[ROW][C]52[/C][C]125.4[/C][C]107.8638[/C][C]98.2073[/C][C]117.6076[/C][C]2e-04[/C][C]0.8769[/C][C]0.9775[/C][C]0.9876[/C][/ROW]
[ROW][C]53[/C][C]116.7[/C][C]115.2401[/C][C]105.4613[/C][C]125.1027[/C][C]0.3859[/C][C]0.0217[/C][C]0.6427[/C][C]0.9999[/C][/ROW]
[ROW][C]54[/C][C]121.3[/C][C]123.2794[/C][C]113.407[/C][C]133.2316[/C][C]0.3483[/C][C]0.9025[/C][C]0.8683[/C][C]1[/C][/ROW]
[ROW][C]55[/C][C]85.3[/C][C]84.3161[/C][C]74.789[/C][C]93.9523[/C][C]0.4207[/C][C]0[/C][C]0.8313[/C][C]0.0059[/C][/ROW]
[ROW][C]56[/C][C]114.2[/C][C]118.5996[/C][C]108.6896[/C][C]128.5932[/C][C]0.1941[/C][C]1[/C][C]0.7018[/C][C]1[/C][/ROW]
[ROW][C]57[/C][C]124.4[/C][C]122.2768[/C][C]112.2982[/C][C]132.3376[/C][C]0.3396[/C][C]0.9422[/C][C]0.9[/C][C]1[/C][/ROW]
[ROW][C]58[/C][C]131[/C][C]128.2287[/C][C]118.1644[/C][C]138.3727[/C][C]0.2962[/C][C]0.7703[/C][C]0.4332[/C][C]1[/C][/ROW]
[ROW][C]59[/C][C]118.3[/C][C]128.1382[/C][C]118.0378[/C][C]138.3189[/C][C]0.0291[/C][C]0.2908[/C][C]0.8242[/C][C]1[/C][/ROW]
[ROW][C]60[/C][C]99.6[/C][C]105.4196[/C][C]95.4866[/C][C]115.4472[/C][C]0.1277[/C][C]0.0059[/C][C]0.9558[/C][C]0.9558[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66861&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66861&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[48])
3697.6-------
37116.4-------
38107.9-------
39121.2-------
4097.9-------
41113.4-------
42117.6-------
4379.6-------
44115.9-------
45115.7-------
46129.1-------
47123.3-------
4896.7-------
49121.2121.1276112.1258130.19670.493810.84651
50118.2112.3378102.7873121.97020.11650.03570.81670.9993
51102.1119.83110.1051129.63462e-040.62770.39211
52125.4107.863898.2073117.60762e-040.87690.97750.9876
53116.7115.2401105.4613125.10270.38590.02170.64270.9999
54121.3123.2794113.407133.23160.34830.90250.86831
5585.384.316174.78993.95230.420700.83130.0059
56114.2118.5996108.6896128.59320.194110.70181
57124.4122.2768112.2982132.33760.33960.94220.91
58131128.2287118.1644138.37270.29620.77030.43321
59118.3128.1382118.0378138.31890.02910.29080.82421
6099.6105.419695.4866115.44720.12770.00590.95580.9558







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.03826e-0400.005200
500.04370.05220.026434.365817.18554.1455
510.0417-0.1480.0669314.3538116.241610.7815
520.04610.16260.0908307.5188164.060912.8086
530.04370.01270.07522.1313131.67511.475
540.0412-0.01610.06533.918110.382210.5063
550.05830.01170.05770.96894.75169.734
560.043-0.03710.055119.356685.32729.2373
570.0420.01740.05094.507976.34738.7377
580.04040.02160.0487.679969.48058.3355
590.0405-0.07680.050696.790371.96328.4831
600.0485-0.05520.05133.867568.78868.2939

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0382 & 6e-04 & 0 & 0.0052 & 0 & 0 \tabularnewline
50 & 0.0437 & 0.0522 & 0.0264 & 34.3658 & 17.1855 & 4.1455 \tabularnewline
51 & 0.0417 & -0.148 & 0.0669 & 314.3538 & 116.2416 & 10.7815 \tabularnewline
52 & 0.0461 & 0.1626 & 0.0908 & 307.5188 & 164.0609 & 12.8086 \tabularnewline
53 & 0.0437 & 0.0127 & 0.0752 & 2.1313 & 131.675 & 11.475 \tabularnewline
54 & 0.0412 & -0.0161 & 0.0653 & 3.918 & 110.3822 & 10.5063 \tabularnewline
55 & 0.0583 & 0.0117 & 0.0577 & 0.968 & 94.7516 & 9.734 \tabularnewline
56 & 0.043 & -0.0371 & 0.0551 & 19.3566 & 85.3272 & 9.2373 \tabularnewline
57 & 0.042 & 0.0174 & 0.0509 & 4.5079 & 76.3473 & 8.7377 \tabularnewline
58 & 0.0404 & 0.0216 & 0.048 & 7.6799 & 69.4805 & 8.3355 \tabularnewline
59 & 0.0405 & -0.0768 & 0.0506 & 96.7903 & 71.9632 & 8.4831 \tabularnewline
60 & 0.0485 & -0.0552 & 0.051 & 33.8675 & 68.7886 & 8.2939 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66861&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]49[/C][C]0.0382[/C][C]6e-04[/C][C]0[/C][C]0.0052[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0437[/C][C]0.0522[/C][C]0.0264[/C][C]34.3658[/C][C]17.1855[/C][C]4.1455[/C][/ROW]
[ROW][C]51[/C][C]0.0417[/C][C]-0.148[/C][C]0.0669[/C][C]314.3538[/C][C]116.2416[/C][C]10.7815[/C][/ROW]
[ROW][C]52[/C][C]0.0461[/C][C]0.1626[/C][C]0.0908[/C][C]307.5188[/C][C]164.0609[/C][C]12.8086[/C][/ROW]
[ROW][C]53[/C][C]0.0437[/C][C]0.0127[/C][C]0.0752[/C][C]2.1313[/C][C]131.675[/C][C]11.475[/C][/ROW]
[ROW][C]54[/C][C]0.0412[/C][C]-0.0161[/C][C]0.0653[/C][C]3.918[/C][C]110.3822[/C][C]10.5063[/C][/ROW]
[ROW][C]55[/C][C]0.0583[/C][C]0.0117[/C][C]0.0577[/C][C]0.968[/C][C]94.7516[/C][C]9.734[/C][/ROW]
[ROW][C]56[/C][C]0.043[/C][C]-0.0371[/C][C]0.0551[/C][C]19.3566[/C][C]85.3272[/C][C]9.2373[/C][/ROW]
[ROW][C]57[/C][C]0.042[/C][C]0.0174[/C][C]0.0509[/C][C]4.5079[/C][C]76.3473[/C][C]8.7377[/C][/ROW]
[ROW][C]58[/C][C]0.0404[/C][C]0.0216[/C][C]0.048[/C][C]7.6799[/C][C]69.4805[/C][C]8.3355[/C][/ROW]
[ROW][C]59[/C][C]0.0405[/C][C]-0.0768[/C][C]0.0506[/C][C]96.7903[/C][C]71.9632[/C][C]8.4831[/C][/ROW]
[ROW][C]60[/C][C]0.0485[/C][C]-0.0552[/C][C]0.051[/C][C]33.8675[/C][C]68.7886[/C][C]8.2939[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66861&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66861&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
490.03826e-0400.005200
500.04370.05220.026434.365817.18554.1455
510.0417-0.1480.0669314.3538116.241610.7815
520.04610.16260.0908307.5188164.060912.8086
530.04370.01270.07522.1313131.67511.475
540.0412-0.01610.06533.918110.382210.5063
550.05830.01170.05770.96894.75169.734
560.043-0.03710.055119.356685.32729.2373
570.0420.01740.05094.507976.34738.7377
580.04040.02160.0487.679969.48058.3355
590.0405-0.07680.050696.790371.96328.4831
600.0485-0.05520.05133.867568.78868.2939



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