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 computationThu, 08 Dec 2011 09:06:13 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/08/t13233531955swz5p3inowge5q.htm/, Retrieved Fri, 03 May 2024 11:54:38 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=152921, Retrieved Fri, 03 May 2024 11:54:38 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact32
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [data set] [2008-12-01 19:54:57] [b98453cac15ba1066b407e146608df68]
- RMP   [Standard Deviation-Mean Plot] [Unemployment] [2010-11-29 10:34:47] [b98453cac15ba1066b407e146608df68]
- RMP     [ARIMA Forecasting] [Unemployment] [2010-11-29 20:46:45] [b98453cac15ba1066b407e146608df68]
- R PD        [ARIMA Forecasting] [ARIMA forecasting] [2011-12-08 14:06:13] [1a4698f17d8e7f554418314cf0e4bd67] [Current]
Feedback Forum

Post a new message
Dataseries X:
114,7
108
101,3
108,4
105,6
120,4
107,6
111,4
122,1
104,8
103,2
112,3
123,1
115,5
106,3
119,9
119,5
120,9
127,5
116,6
126,7
110,6
100,4
125,2
125
105,2
102,7
94,2
97
111,1
102
97,3
109,8
98,9
93,2
115,2
115
107
104,1
106
110,8
127,8
116,9
113,8
131,6
106,1
107,2
127,4
123
121,8
117,6
118,4
121,8
141,9
122,1
132,2
131,6
108,8
120,4
134,7




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net

\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 & 4 seconds \tabularnewline
R Server & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=152921&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]4 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=152921&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=152921&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 time4 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net







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])
36115.2-------
37115-------
38107-------
39104.1-------
40106-------
41110.8-------
42127.8-------
43116.9-------
44113.8-------
45131.6-------
46106.1-------
47107.2-------
48127.4-------
49123128.7146118.8796139.36330.14640.59560.99420.5956
50121.8123.9141113.4273135.37040.35880.56210.99810.2755
51117.6115.2059103.7975127.86830.35550.15370.95720.0295
52118.4121.7675107.5482137.86680.34090.69410.97250.2464
53121.8124.3058109.0129141.74420.38910.74660.93550.364
54141.9130.7662113.2274151.02180.14070.80720.6130.6277
55122.1127.6049109.1472149.1840.30850.09710.83460.5074
56132.2124.4674105.7349146.51870.24590.58330.82850.3972
57131.6134.1384112.7437159.59320.42250.55930.57750.6981
58108.8116.983797.4427140.44340.24710.1110.81840.1921
59120.4110.580291.4823133.6650.20220.56010.61290.0766
60134.7130.1852106.7423158.77670.37850.74880.57570.5757

\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 & 115.2 & - & - & - & - & - & - & - \tabularnewline
37 & 115 & - & - & - & - & - & - & - \tabularnewline
38 & 107 & - & - & - & - & - & - & - \tabularnewline
39 & 104.1 & - & - & - & - & - & - & - \tabularnewline
40 & 106 & - & - & - & - & - & - & - \tabularnewline
41 & 110.8 & - & - & - & - & - & - & - \tabularnewline
42 & 127.8 & - & - & - & - & - & - & - \tabularnewline
43 & 116.9 & - & - & - & - & - & - & - \tabularnewline
44 & 113.8 & - & - & - & - & - & - & - \tabularnewline
45 & 131.6 & - & - & - & - & - & - & - \tabularnewline
46 & 106.1 & - & - & - & - & - & - & - \tabularnewline
47 & 107.2 & - & - & - & - & - & - & - \tabularnewline
48 & 127.4 & - & - & - & - & - & - & - \tabularnewline
49 & 123 & 128.7146 & 118.8796 & 139.3633 & 0.1464 & 0.5956 & 0.9942 & 0.5956 \tabularnewline
50 & 121.8 & 123.9141 & 113.4273 & 135.3704 & 0.3588 & 0.5621 & 0.9981 & 0.2755 \tabularnewline
51 & 117.6 & 115.2059 & 103.7975 & 127.8683 & 0.3555 & 0.1537 & 0.9572 & 0.0295 \tabularnewline
52 & 118.4 & 121.7675 & 107.5482 & 137.8668 & 0.3409 & 0.6941 & 0.9725 & 0.2464 \tabularnewline
53 & 121.8 & 124.3058 & 109.0129 & 141.7442 & 0.3891 & 0.7466 & 0.9355 & 0.364 \tabularnewline
54 & 141.9 & 130.7662 & 113.2274 & 151.0218 & 0.1407 & 0.8072 & 0.613 & 0.6277 \tabularnewline
55 & 122.1 & 127.6049 & 109.1472 & 149.184 & 0.3085 & 0.0971 & 0.8346 & 0.5074 \tabularnewline
56 & 132.2 & 124.4674 & 105.7349 & 146.5187 & 0.2459 & 0.5833 & 0.8285 & 0.3972 \tabularnewline
57 & 131.6 & 134.1384 & 112.7437 & 159.5932 & 0.4225 & 0.5593 & 0.5775 & 0.6981 \tabularnewline
58 & 108.8 & 116.9837 & 97.4427 & 140.4434 & 0.2471 & 0.111 & 0.8184 & 0.1921 \tabularnewline
59 & 120.4 & 110.5802 & 91.4823 & 133.665 & 0.2022 & 0.5601 & 0.6129 & 0.0766 \tabularnewline
60 & 134.7 & 130.1852 & 106.7423 & 158.7767 & 0.3785 & 0.7488 & 0.5757 & 0.5757 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=152921&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]115.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]115[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]107[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]104.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]106[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]110.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]127.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]116.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]113.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]131.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]106.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]107.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]127.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]123[/C][C]128.7146[/C][C]118.8796[/C][C]139.3633[/C][C]0.1464[/C][C]0.5956[/C][C]0.9942[/C][C]0.5956[/C][/ROW]
[ROW][C]50[/C][C]121.8[/C][C]123.9141[/C][C]113.4273[/C][C]135.3704[/C][C]0.3588[/C][C]0.5621[/C][C]0.9981[/C][C]0.2755[/C][/ROW]
[ROW][C]51[/C][C]117.6[/C][C]115.2059[/C][C]103.7975[/C][C]127.8683[/C][C]0.3555[/C][C]0.1537[/C][C]0.9572[/C][C]0.0295[/C][/ROW]
[ROW][C]52[/C][C]118.4[/C][C]121.7675[/C][C]107.5482[/C][C]137.8668[/C][C]0.3409[/C][C]0.6941[/C][C]0.9725[/C][C]0.2464[/C][/ROW]
[ROW][C]53[/C][C]121.8[/C][C]124.3058[/C][C]109.0129[/C][C]141.7442[/C][C]0.3891[/C][C]0.7466[/C][C]0.9355[/C][C]0.364[/C][/ROW]
[ROW][C]54[/C][C]141.9[/C][C]130.7662[/C][C]113.2274[/C][C]151.0218[/C][C]0.1407[/C][C]0.8072[/C][C]0.613[/C][C]0.6277[/C][/ROW]
[ROW][C]55[/C][C]122.1[/C][C]127.6049[/C][C]109.1472[/C][C]149.184[/C][C]0.3085[/C][C]0.0971[/C][C]0.8346[/C][C]0.5074[/C][/ROW]
[ROW][C]56[/C][C]132.2[/C][C]124.4674[/C][C]105.7349[/C][C]146.5187[/C][C]0.2459[/C][C]0.5833[/C][C]0.8285[/C][C]0.3972[/C][/ROW]
[ROW][C]57[/C][C]131.6[/C][C]134.1384[/C][C]112.7437[/C][C]159.5932[/C][C]0.4225[/C][C]0.5593[/C][C]0.5775[/C][C]0.6981[/C][/ROW]
[ROW][C]58[/C][C]108.8[/C][C]116.9837[/C][C]97.4427[/C][C]140.4434[/C][C]0.2471[/C][C]0.111[/C][C]0.8184[/C][C]0.1921[/C][/ROW]
[ROW][C]59[/C][C]120.4[/C][C]110.5802[/C][C]91.4823[/C][C]133.665[/C][C]0.2022[/C][C]0.5601[/C][C]0.6129[/C][C]0.0766[/C][/ROW]
[ROW][C]60[/C][C]134.7[/C][C]130.1852[/C][C]106.7423[/C][C]158.7767[/C][C]0.3785[/C][C]0.7488[/C][C]0.5757[/C][C]0.5757[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=152921&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=152921&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])
36115.2-------
37115-------
38107-------
39104.1-------
40106-------
41110.8-------
42127.8-------
43116.9-------
44113.8-------
45131.6-------
46106.1-------
47107.2-------
48127.4-------
49123128.7146118.8796139.36330.14640.59560.99420.5956
50121.8123.9141113.4273135.37040.35880.56210.99810.2755
51117.6115.2059103.7975127.86830.35550.15370.95720.0295
52118.4121.7675107.5482137.86680.34090.69410.97250.2464
53121.8124.3058109.0129141.74420.38910.74660.93550.364
54141.9130.7662113.2274151.02180.14070.80720.6130.6277
55122.1127.6049109.1472149.1840.30850.09710.83460.5074
56132.2124.4674105.7349146.51870.24590.58330.82850.3972
57131.6134.1384112.7437159.59320.42250.55930.57750.6981
58108.8116.983797.4427140.44340.24710.1110.81840.1921
59120.4110.580291.4823133.6650.20220.56010.61290.0766
60134.7130.1852106.7423158.77670.37850.74880.57570.5757







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0422-0.0444032.656900
500.0472-0.01710.03074.469518.56324.3085
510.05610.02080.02745.731514.28593.7797
520.0675-0.02770.027511.340113.54953.681
530.0716-0.02020.0266.279212.09543.4778
540.0790.08510.0359123.96130.73975.5443
550.0863-0.04310.036930.303730.67745.5387
560.09040.06210.040159.792434.31685.8581
570.0968-0.01890.03776.443731.21985.5875
580.1023-0.070.040966.972734.79515.8987
590.10650.08880.045396.42940.39826.356
600.11210.03470.044420.383238.73026.2234

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0422 & -0.0444 & 0 & 32.6569 & 0 & 0 \tabularnewline
50 & 0.0472 & -0.0171 & 0.0307 & 4.4695 & 18.5632 & 4.3085 \tabularnewline
51 & 0.0561 & 0.0208 & 0.0274 & 5.7315 & 14.2859 & 3.7797 \tabularnewline
52 & 0.0675 & -0.0277 & 0.0275 & 11.3401 & 13.5495 & 3.681 \tabularnewline
53 & 0.0716 & -0.0202 & 0.026 & 6.2792 & 12.0954 & 3.4778 \tabularnewline
54 & 0.079 & 0.0851 & 0.0359 & 123.961 & 30.7397 & 5.5443 \tabularnewline
55 & 0.0863 & -0.0431 & 0.0369 & 30.3037 & 30.6774 & 5.5387 \tabularnewline
56 & 0.0904 & 0.0621 & 0.0401 & 59.7924 & 34.3168 & 5.8581 \tabularnewline
57 & 0.0968 & -0.0189 & 0.0377 & 6.4437 & 31.2198 & 5.5875 \tabularnewline
58 & 0.1023 & -0.07 & 0.0409 & 66.9727 & 34.7951 & 5.8987 \tabularnewline
59 & 0.1065 & 0.0888 & 0.0453 & 96.429 & 40.3982 & 6.356 \tabularnewline
60 & 0.1121 & 0.0347 & 0.0444 & 20.3832 & 38.7302 & 6.2234 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=152921&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.0422[/C][C]-0.0444[/C][C]0[/C][C]32.6569[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0472[/C][C]-0.0171[/C][C]0.0307[/C][C]4.4695[/C][C]18.5632[/C][C]4.3085[/C][/ROW]
[ROW][C]51[/C][C]0.0561[/C][C]0.0208[/C][C]0.0274[/C][C]5.7315[/C][C]14.2859[/C][C]3.7797[/C][/ROW]
[ROW][C]52[/C][C]0.0675[/C][C]-0.0277[/C][C]0.0275[/C][C]11.3401[/C][C]13.5495[/C][C]3.681[/C][/ROW]
[ROW][C]53[/C][C]0.0716[/C][C]-0.0202[/C][C]0.026[/C][C]6.2792[/C][C]12.0954[/C][C]3.4778[/C][/ROW]
[ROW][C]54[/C][C]0.079[/C][C]0.0851[/C][C]0.0359[/C][C]123.961[/C][C]30.7397[/C][C]5.5443[/C][/ROW]
[ROW][C]55[/C][C]0.0863[/C][C]-0.0431[/C][C]0.0369[/C][C]30.3037[/C][C]30.6774[/C][C]5.5387[/C][/ROW]
[ROW][C]56[/C][C]0.0904[/C][C]0.0621[/C][C]0.0401[/C][C]59.7924[/C][C]34.3168[/C][C]5.8581[/C][/ROW]
[ROW][C]57[/C][C]0.0968[/C][C]-0.0189[/C][C]0.0377[/C][C]6.4437[/C][C]31.2198[/C][C]5.5875[/C][/ROW]
[ROW][C]58[/C][C]0.1023[/C][C]-0.07[/C][C]0.0409[/C][C]66.9727[/C][C]34.7951[/C][C]5.8987[/C][/ROW]
[ROW][C]59[/C][C]0.1065[/C][C]0.0888[/C][C]0.0453[/C][C]96.429[/C][C]40.3982[/C][C]6.356[/C][/ROW]
[ROW][C]60[/C][C]0.1121[/C][C]0.0347[/C][C]0.0444[/C][C]20.3832[/C][C]38.7302[/C][C]6.2234[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=152921&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=152921&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.0422-0.0444032.656900
500.0472-0.01710.03074.469518.56324.3085
510.05610.02080.02745.731514.28593.7797
520.0675-0.02770.027511.340113.54953.681
530.0716-0.02020.0266.279212.09543.4778
540.0790.08510.0359123.96130.73975.5443
550.0863-0.04310.036930.303730.67745.5387
560.09040.06210.040159.792434.31685.8581
570.0968-0.01890.03776.443731.21985.5875
580.1023-0.070.040966.972734.79515.8987
590.10650.08880.045396.42940.39826.356
600.11210.03470.044420.383238.73026.2234



Parameters (Session):
par1 = 1 ; par2 = 0 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = White Noise ; par7 = 0.95 ;
Parameters (R input):
par1 = 12 ; par2 = 0.0 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 2 ; 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,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')