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, 04 Dec 2009 07:55:47 -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/04/t12599391391u79ira5o966l5s.htm/, Retrieved Sun, 28 Apr 2024 14:23:35 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=63713, Retrieved Sun, 28 Apr 2024 14:23:35 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact142
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]
F RMP   [Standard Deviation-Mean Plot] [Taak 8 stap 1] [2008-12-12 12:09:36] [491a70d26f8c977398d8a0c1c87d3dd4]
-    D    [Standard Deviation-Mean Plot] [paper standard de...] [2008-12-12 14:44:37] [491a70d26f8c977398d8a0c1c87d3dd4]
- RM D      [Variance Reduction Matrix] [paper variance re...] [2008-12-12 14:54:46] [491a70d26f8c977398d8a0c1c87d3dd4]
- RMP         [ARIMA Backward Selection] [Paper ARIMA backw...] [2008-12-16 19:22:07] [491a70d26f8c977398d8a0c1c87d3dd4]
- RM            [ARIMA Forecasting] [Paper Arima forec...] [2008-12-16 19:55:16] [491a70d26f8c977398d8a0c1c87d3dd4]
-  MPD              [ARIMA Forecasting] [Ws 9] [2009-12-04 14:55:47] [d41d8cd98f00b204e9800998ecf8427e] [Current]
-                     [ARIMA Forecasting] [Workshop 9-1] [2009-12-04 21:41:47] [aba88da643e3763d32ff92bd8f92a385]
Feedback Forum

Post a new message
Dataseries X:
62
64
62
64
64
69
69
65
56
58
53
62
55
60
59
58
53
57
57
53
54
53
57
57
55
49
50
49
54
58
58
52
56
52
59
53
52
53
51
50
56
52
46
48
46
48
48
49
53
48
51
48
50
55
52
53
52
55
53
53
56
54
52
55
54
59
56
56
51
53
52
51
46
49
46
55
57
53
52
53
50
54
53
50
51
52
47
51
49
53
52
45
53
51
48
48
48
48
40
43
40
39
39
36
41
39
40
39
46
40
37
37
44
41
40
36
38
43
42
45
46




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=63713&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 time8 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[109])
9748-------
9848-------
9940-------
10043-------
10140-------
10239-------
10339-------
10436-------
10541-------
10639-------
10740-------
10839-------
10946-------
1104042.181636.197148.16610.23750.10550.02840.1055
1113743.362936.657450.06850.03150.83720.83720.2204
1123744.29336.596251.98970.03160.96840.6290.3319
1134445.160936.871753.450.39190.97320.88880.4214
1144143.714634.7952.63910.27550.4750.84980.3079
1154043.966734.390753.54270.20840.72820.84530.3386
1163643.396833.070853.72290.08020.74050.91980.3106
1173843.171732.050254.29320.1810.89690.6490.3091
1184343.496931.602555.39130.46740.81750.77070.34
1194244.652932.085957.21990.33950.60170.7660.4168
1204544.431.284557.51540.46430.64010.79020.4055
1214647.403333.847460.95920.41960.63590.58040.5804

\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[109]) \tabularnewline
97 & 48 & - & - & - & - & - & - & - \tabularnewline
98 & 48 & - & - & - & - & - & - & - \tabularnewline
99 & 40 & - & - & - & - & - & - & - \tabularnewline
100 & 43 & - & - & - & - & - & - & - \tabularnewline
101 & 40 & - & - & - & - & - & - & - \tabularnewline
102 & 39 & - & - & - & - & - & - & - \tabularnewline
103 & 39 & - & - & - & - & - & - & - \tabularnewline
104 & 36 & - & - & - & - & - & - & - \tabularnewline
105 & 41 & - & - & - & - & - & - & - \tabularnewline
106 & 39 & - & - & - & - & - & - & - \tabularnewline
107 & 40 & - & - & - & - & - & - & - \tabularnewline
108 & 39 & - & - & - & - & - & - & - \tabularnewline
109 & 46 & - & - & - & - & - & - & - \tabularnewline
110 & 40 & 42.1816 & 36.1971 & 48.1661 & 0.2375 & 0.1055 & 0.0284 & 0.1055 \tabularnewline
111 & 37 & 43.3629 & 36.6574 & 50.0685 & 0.0315 & 0.8372 & 0.8372 & 0.2204 \tabularnewline
112 & 37 & 44.293 & 36.5962 & 51.9897 & 0.0316 & 0.9684 & 0.629 & 0.3319 \tabularnewline
113 & 44 & 45.1609 & 36.8717 & 53.45 & 0.3919 & 0.9732 & 0.8888 & 0.4214 \tabularnewline
114 & 41 & 43.7146 & 34.79 & 52.6391 & 0.2755 & 0.475 & 0.8498 & 0.3079 \tabularnewline
115 & 40 & 43.9667 & 34.3907 & 53.5427 & 0.2084 & 0.7282 & 0.8453 & 0.3386 \tabularnewline
116 & 36 & 43.3968 & 33.0708 & 53.7229 & 0.0802 & 0.7405 & 0.9198 & 0.3106 \tabularnewline
117 & 38 & 43.1717 & 32.0502 & 54.2932 & 0.181 & 0.8969 & 0.649 & 0.3091 \tabularnewline
118 & 43 & 43.4969 & 31.6025 & 55.3913 & 0.4674 & 0.8175 & 0.7707 & 0.34 \tabularnewline
119 & 42 & 44.6529 & 32.0859 & 57.2199 & 0.3395 & 0.6017 & 0.766 & 0.4168 \tabularnewline
120 & 45 & 44.4 & 31.2845 & 57.5154 & 0.4643 & 0.6401 & 0.7902 & 0.4055 \tabularnewline
121 & 46 & 47.4033 & 33.8474 & 60.9592 & 0.4196 & 0.6359 & 0.5804 & 0.5804 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=63713&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[109])[/C][/ROW]
[ROW][C]97[/C][C]48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]40[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]43[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]40[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]39[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]39[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]36[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]41[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]39[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]40[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]39[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]46[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]40[/C][C]42.1816[/C][C]36.1971[/C][C]48.1661[/C][C]0.2375[/C][C]0.1055[/C][C]0.0284[/C][C]0.1055[/C][/ROW]
[ROW][C]111[/C][C]37[/C][C]43.3629[/C][C]36.6574[/C][C]50.0685[/C][C]0.0315[/C][C]0.8372[/C][C]0.8372[/C][C]0.2204[/C][/ROW]
[ROW][C]112[/C][C]37[/C][C]44.293[/C][C]36.5962[/C][C]51.9897[/C][C]0.0316[/C][C]0.9684[/C][C]0.629[/C][C]0.3319[/C][/ROW]
[ROW][C]113[/C][C]44[/C][C]45.1609[/C][C]36.8717[/C][C]53.45[/C][C]0.3919[/C][C]0.9732[/C][C]0.8888[/C][C]0.4214[/C][/ROW]
[ROW][C]114[/C][C]41[/C][C]43.7146[/C][C]34.79[/C][C]52.6391[/C][C]0.2755[/C][C]0.475[/C][C]0.8498[/C][C]0.3079[/C][/ROW]
[ROW][C]115[/C][C]40[/C][C]43.9667[/C][C]34.3907[/C][C]53.5427[/C][C]0.2084[/C][C]0.7282[/C][C]0.8453[/C][C]0.3386[/C][/ROW]
[ROW][C]116[/C][C]36[/C][C]43.3968[/C][C]33.0708[/C][C]53.7229[/C][C]0.0802[/C][C]0.7405[/C][C]0.9198[/C][C]0.3106[/C][/ROW]
[ROW][C]117[/C][C]38[/C][C]43.1717[/C][C]32.0502[/C][C]54.2932[/C][C]0.181[/C][C]0.8969[/C][C]0.649[/C][C]0.3091[/C][/ROW]
[ROW][C]118[/C][C]43[/C][C]43.4969[/C][C]31.6025[/C][C]55.3913[/C][C]0.4674[/C][C]0.8175[/C][C]0.7707[/C][C]0.34[/C][/ROW]
[ROW][C]119[/C][C]42[/C][C]44.6529[/C][C]32.0859[/C][C]57.2199[/C][C]0.3395[/C][C]0.6017[/C][C]0.766[/C][C]0.4168[/C][/ROW]
[ROW][C]120[/C][C]45[/C][C]44.4[/C][C]31.2845[/C][C]57.5154[/C][C]0.4643[/C][C]0.6401[/C][C]0.7902[/C][C]0.4055[/C][/ROW]
[ROW][C]121[/C][C]46[/C][C]47.4033[/C][C]33.8474[/C][C]60.9592[/C][C]0.4196[/C][C]0.6359[/C][C]0.5804[/C][C]0.5804[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=63713&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=63713&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[109])
9748-------
9848-------
9940-------
10043-------
10140-------
10239-------
10339-------
10436-------
10541-------
10639-------
10740-------
10839-------
10946-------
1104042.181636.197148.16610.23750.10550.02840.1055
1113743.362936.657450.06850.03150.83720.83720.2204
1123744.29336.596251.98970.03160.96840.6290.3319
1134445.160936.871753.450.39190.97320.88880.4214
1144143.714634.7952.63910.27550.4750.84980.3079
1154043.966734.390753.54270.20840.72820.84530.3386
1163643.396833.070853.72290.08020.74050.91980.3106
1173843.171732.050254.29320.1810.89690.6490.3091
1184343.496931.602555.39130.46740.81750.77070.34
1194244.652932.085957.21990.33950.60170.7660.4168
1204544.431.284557.51540.46430.64010.79020.4055
1214647.403333.847460.95920.41960.63590.58040.5804







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1100.0724-0.05170.00434.75940.39660.6298
1110.0789-0.14670.012240.48713.37391.8368
1120.0887-0.16470.013753.18724.43232.1053
1130.0936-0.02570.00211.34760.11230.3351
1140.1042-0.06210.00527.36880.61410.7836
1150.1111-0.09020.007515.7351.31131.1451
1160.1214-0.17040.014254.71314.55942.1353
1170.1314-0.11980.0126.74642.22891.4929
1180.1395-0.01140.0010.24690.02060.1434
1190.1436-0.05940.0057.0380.58650.7658
1200.15070.01350.00110.360.030.1732
1210.1459-0.02960.00251.96910.16410.4051

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
110 & 0.0724 & -0.0517 & 0.0043 & 4.7594 & 0.3966 & 0.6298 \tabularnewline
111 & 0.0789 & -0.1467 & 0.0122 & 40.4871 & 3.3739 & 1.8368 \tabularnewline
112 & 0.0887 & -0.1647 & 0.0137 & 53.1872 & 4.4323 & 2.1053 \tabularnewline
113 & 0.0936 & -0.0257 & 0.0021 & 1.3476 & 0.1123 & 0.3351 \tabularnewline
114 & 0.1042 & -0.0621 & 0.0052 & 7.3688 & 0.6141 & 0.7836 \tabularnewline
115 & 0.1111 & -0.0902 & 0.0075 & 15.735 & 1.3113 & 1.1451 \tabularnewline
116 & 0.1214 & -0.1704 & 0.0142 & 54.7131 & 4.5594 & 2.1353 \tabularnewline
117 & 0.1314 & -0.1198 & 0.01 & 26.7464 & 2.2289 & 1.4929 \tabularnewline
118 & 0.1395 & -0.0114 & 0.001 & 0.2469 & 0.0206 & 0.1434 \tabularnewline
119 & 0.1436 & -0.0594 & 0.005 & 7.038 & 0.5865 & 0.7658 \tabularnewline
120 & 0.1507 & 0.0135 & 0.0011 & 0.36 & 0.03 & 0.1732 \tabularnewline
121 & 0.1459 & -0.0296 & 0.0025 & 1.9691 & 0.1641 & 0.4051 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=63713&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]110[/C][C]0.0724[/C][C]-0.0517[/C][C]0.0043[/C][C]4.7594[/C][C]0.3966[/C][C]0.6298[/C][/ROW]
[ROW][C]111[/C][C]0.0789[/C][C]-0.1467[/C][C]0.0122[/C][C]40.4871[/C][C]3.3739[/C][C]1.8368[/C][/ROW]
[ROW][C]112[/C][C]0.0887[/C][C]-0.1647[/C][C]0.0137[/C][C]53.1872[/C][C]4.4323[/C][C]2.1053[/C][/ROW]
[ROW][C]113[/C][C]0.0936[/C][C]-0.0257[/C][C]0.0021[/C][C]1.3476[/C][C]0.1123[/C][C]0.3351[/C][/ROW]
[ROW][C]114[/C][C]0.1042[/C][C]-0.0621[/C][C]0.0052[/C][C]7.3688[/C][C]0.6141[/C][C]0.7836[/C][/ROW]
[ROW][C]115[/C][C]0.1111[/C][C]-0.0902[/C][C]0.0075[/C][C]15.735[/C][C]1.3113[/C][C]1.1451[/C][/ROW]
[ROW][C]116[/C][C]0.1214[/C][C]-0.1704[/C][C]0.0142[/C][C]54.7131[/C][C]4.5594[/C][C]2.1353[/C][/ROW]
[ROW][C]117[/C][C]0.1314[/C][C]-0.1198[/C][C]0.01[/C][C]26.7464[/C][C]2.2289[/C][C]1.4929[/C][/ROW]
[ROW][C]118[/C][C]0.1395[/C][C]-0.0114[/C][C]0.001[/C][C]0.2469[/C][C]0.0206[/C][C]0.1434[/C][/ROW]
[ROW][C]119[/C][C]0.1436[/C][C]-0.0594[/C][C]0.005[/C][C]7.038[/C][C]0.5865[/C][C]0.7658[/C][/ROW]
[ROW][C]120[/C][C]0.1507[/C][C]0.0135[/C][C]0.0011[/C][C]0.36[/C][C]0.03[/C][C]0.1732[/C][/ROW]
[ROW][C]121[/C][C]0.1459[/C][C]-0.0296[/C][C]0.0025[/C][C]1.9691[/C][C]0.1641[/C][C]0.4051[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=63713&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=63713&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
1100.0724-0.05170.00434.75940.39660.6298
1110.0789-0.14670.012240.48713.37391.8368
1120.0887-0.16470.013753.18724.43232.1053
1130.0936-0.02570.00211.34760.11230.3351
1140.1042-0.06210.00527.36880.61410.7836
1150.1111-0.09020.007515.7351.31131.1451
1160.1214-0.17040.014254.71314.55942.1353
1170.1314-0.11980.0126.74642.22891.4929
1180.1395-0.01140.0010.24690.02060.1434
1190.1436-0.05940.0057.0380.58650.7658
1200.15070.01350.00110.360.030.1732
1210.1459-0.02960.00251.96910.16410.4051



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