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, 10 Dec 2009 05:28:32 -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/10/t1260448165vnqad36ost0ky1w.htm/, Retrieved Thu, 25 Apr 2024 12:08:47 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=65310, Retrieved Thu, 25 Apr 2024 12:08:47 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact177
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [Shw10: ARIMA Fore...] [2009-12-04 15:42:20] [3c8b83428ce260cd44df892bb7619588]
-   PD  [ARIMA Forecasting] [WS 10: arima forc...] [2009-12-05 13:03:21] [f924a0adda9c1905a1ba8f1c751261ff]
-   P       [ARIMA Forecasting] [xt arima forecast] [2009-12-10 12:28:32] [ac86848d66148c9c4c9404e0c9a511eb] [Current]
- R PD        [ARIMA Forecasting] [] [2009-12-11 15:23:11] [2c5be225250d91402426bbbf07a5e2b3]
Feedback Forum

Post a new message
Dataseries X:
79.8
83.4
113.6
112.9
104
109.9
99
106.3
128.9
111.1
102.9
130
87
87.5
117.6
103.4
110.8
112.6
102.5
112.4
135.6
105.1
127.7
137
91
90.5
122.4
123.3
124.3
120
118.1
119
142.7
123.6
129.6
151.6
110.4
99.2
130.5
136.2
129.7
128
121.6
135.8
143.8
147.5
136.2
156.6
123.3
104.5
139.8
136.5
112.1
118.5
94.4
102.3
111.4
99.2
87.8
115.8




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65310&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 time2 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])
36151.6-------
37110.4-------
3899.2-------
39130.5-------
40136.2-------
41129.7-------
42128-------
43121.6-------
44135.8-------
45143.8-------
46147.5-------
47136.2-------
48156.6-------
49123.3123.492108.7984138.18570.489800.95960
50104.5109.396894.6936124.10.2570.03190.9130
51139.8138.4013122.9044153.89820.429810.84120.0107
52136.5146.4782129.7536163.20280.12110.78310.88580.1178
53112.1139.8621122.4449157.27939e-040.64740.87360.0298
54118.5137.1873119.3187155.0560.02020.9970.84320.0166
5594.4131.2797112.5697149.98971e-040.90970.84470.004
56102.3145.6853126.3421165.0285010.84170.1344
57111.4153.3713133.4667173.276010.8270.3753
5899.2157.1277136.611177.6444010.82110.5201
5987.8145.9386124.8223167.0549010.8170.1612
60115.8166.2632144.6015187.9249010.8090.809

\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 & 151.6 & - & - & - & - & - & - & - \tabularnewline
37 & 110.4 & - & - & - & - & - & - & - \tabularnewline
38 & 99.2 & - & - & - & - & - & - & - \tabularnewline
39 & 130.5 & - & - & - & - & - & - & - \tabularnewline
40 & 136.2 & - & - & - & - & - & - & - \tabularnewline
41 & 129.7 & - & - & - & - & - & - & - \tabularnewline
42 & 128 & - & - & - & - & - & - & - \tabularnewline
43 & 121.6 & - & - & - & - & - & - & - \tabularnewline
44 & 135.8 & - & - & - & - & - & - & - \tabularnewline
45 & 143.8 & - & - & - & - & - & - & - \tabularnewline
46 & 147.5 & - & - & - & - & - & - & - \tabularnewline
47 & 136.2 & - & - & - & - & - & - & - \tabularnewline
48 & 156.6 & - & - & - & - & - & - & - \tabularnewline
49 & 123.3 & 123.492 & 108.7984 & 138.1857 & 0.4898 & 0 & 0.9596 & 0 \tabularnewline
50 & 104.5 & 109.3968 & 94.6936 & 124.1 & 0.257 & 0.0319 & 0.913 & 0 \tabularnewline
51 & 139.8 & 138.4013 & 122.9044 & 153.8982 & 0.4298 & 1 & 0.8412 & 0.0107 \tabularnewline
52 & 136.5 & 146.4782 & 129.7536 & 163.2028 & 0.1211 & 0.7831 & 0.8858 & 0.1178 \tabularnewline
53 & 112.1 & 139.8621 & 122.4449 & 157.2793 & 9e-04 & 0.6474 & 0.8736 & 0.0298 \tabularnewline
54 & 118.5 & 137.1873 & 119.3187 & 155.056 & 0.0202 & 0.997 & 0.8432 & 0.0166 \tabularnewline
55 & 94.4 & 131.2797 & 112.5697 & 149.9897 & 1e-04 & 0.9097 & 0.8447 & 0.004 \tabularnewline
56 & 102.3 & 145.6853 & 126.3421 & 165.0285 & 0 & 1 & 0.8417 & 0.1344 \tabularnewline
57 & 111.4 & 153.3713 & 133.4667 & 173.276 & 0 & 1 & 0.827 & 0.3753 \tabularnewline
58 & 99.2 & 157.1277 & 136.611 & 177.6444 & 0 & 1 & 0.8211 & 0.5201 \tabularnewline
59 & 87.8 & 145.9386 & 124.8223 & 167.0549 & 0 & 1 & 0.817 & 0.1612 \tabularnewline
60 & 115.8 & 166.2632 & 144.6015 & 187.9249 & 0 & 1 & 0.809 & 0.809 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65310&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]151.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]110.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]99.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]130.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]136.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]129.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]128[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]121.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]135.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]143.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]147.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]136.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]156.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]123.3[/C][C]123.492[/C][C]108.7984[/C][C]138.1857[/C][C]0.4898[/C][C]0[/C][C]0.9596[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]104.5[/C][C]109.3968[/C][C]94.6936[/C][C]124.1[/C][C]0.257[/C][C]0.0319[/C][C]0.913[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]139.8[/C][C]138.4013[/C][C]122.9044[/C][C]153.8982[/C][C]0.4298[/C][C]1[/C][C]0.8412[/C][C]0.0107[/C][/ROW]
[ROW][C]52[/C][C]136.5[/C][C]146.4782[/C][C]129.7536[/C][C]163.2028[/C][C]0.1211[/C][C]0.7831[/C][C]0.8858[/C][C]0.1178[/C][/ROW]
[ROW][C]53[/C][C]112.1[/C][C]139.8621[/C][C]122.4449[/C][C]157.2793[/C][C]9e-04[/C][C]0.6474[/C][C]0.8736[/C][C]0.0298[/C][/ROW]
[ROW][C]54[/C][C]118.5[/C][C]137.1873[/C][C]119.3187[/C][C]155.056[/C][C]0.0202[/C][C]0.997[/C][C]0.8432[/C][C]0.0166[/C][/ROW]
[ROW][C]55[/C][C]94.4[/C][C]131.2797[/C][C]112.5697[/C][C]149.9897[/C][C]1e-04[/C][C]0.9097[/C][C]0.8447[/C][C]0.004[/C][/ROW]
[ROW][C]56[/C][C]102.3[/C][C]145.6853[/C][C]126.3421[/C][C]165.0285[/C][C]0[/C][C]1[/C][C]0.8417[/C][C]0.1344[/C][/ROW]
[ROW][C]57[/C][C]111.4[/C][C]153.3713[/C][C]133.4667[/C][C]173.276[/C][C]0[/C][C]1[/C][C]0.827[/C][C]0.3753[/C][/ROW]
[ROW][C]58[/C][C]99.2[/C][C]157.1277[/C][C]136.611[/C][C]177.6444[/C][C]0[/C][C]1[/C][C]0.8211[/C][C]0.5201[/C][/ROW]
[ROW][C]59[/C][C]87.8[/C][C]145.9386[/C][C]124.8223[/C][C]167.0549[/C][C]0[/C][C]1[/C][C]0.817[/C][C]0.1612[/C][/ROW]
[ROW][C]60[/C][C]115.8[/C][C]166.2632[/C][C]144.6015[/C][C]187.9249[/C][C]0[/C][C]1[/C][C]0.809[/C][C]0.809[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65310&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65310&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])
36151.6-------
37110.4-------
3899.2-------
39130.5-------
40136.2-------
41129.7-------
42128-------
43121.6-------
44135.8-------
45143.8-------
46147.5-------
47136.2-------
48156.6-------
49123.3123.492108.7984138.18570.489800.95960
50104.5109.396894.6936124.10.2570.03190.9130
51139.8138.4013122.9044153.89820.429810.84120.0107
52136.5146.4782129.7536163.20280.12110.78310.88580.1178
53112.1139.8621122.4449157.27939e-040.64740.87360.0298
54118.5137.1873119.3187155.0560.02020.9970.84320.0166
5594.4131.2797112.5697149.98971e-040.90970.84470.004
56102.3145.6853126.3421165.0285010.84170.1344
57111.4153.3713133.4667173.276010.8270.3753
5899.2157.1277136.611177.6444010.82110.5201
5987.8145.9386124.8223167.0549010.8170.1612
60115.8166.2632144.6015187.9249010.8090.809







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0607-0.00161e-040.03690.00310.0554
500.0686-0.04480.003723.97891.99821.4136
510.05710.01018e-041.95640.1630.4038
520.0583-0.06810.005799.56488.29712.8805
530.0635-0.19850.0165770.734464.22798.0142
540.0665-0.13620.0114349.215529.10135.3946
550.0727-0.28090.02341360.1142113.342910.6463
560.0677-0.29780.02481882.2839156.85712.5243
570.0662-0.27370.02281761.5916146.799312.1161
580.0666-0.36870.03073355.6183279.634916.7223
590.0738-0.39840.03323380.0925281.674416.7832
600.0665-0.30350.02532546.5306212.210914.5675

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0607 & -0.0016 & 1e-04 & 0.0369 & 0.0031 & 0.0554 \tabularnewline
50 & 0.0686 & -0.0448 & 0.0037 & 23.9789 & 1.9982 & 1.4136 \tabularnewline
51 & 0.0571 & 0.0101 & 8e-04 & 1.9564 & 0.163 & 0.4038 \tabularnewline
52 & 0.0583 & -0.0681 & 0.0057 & 99.5648 & 8.2971 & 2.8805 \tabularnewline
53 & 0.0635 & -0.1985 & 0.0165 & 770.7344 & 64.2279 & 8.0142 \tabularnewline
54 & 0.0665 & -0.1362 & 0.0114 & 349.2155 & 29.1013 & 5.3946 \tabularnewline
55 & 0.0727 & -0.2809 & 0.0234 & 1360.1142 & 113.3429 & 10.6463 \tabularnewline
56 & 0.0677 & -0.2978 & 0.0248 & 1882.2839 & 156.857 & 12.5243 \tabularnewline
57 & 0.0662 & -0.2737 & 0.0228 & 1761.5916 & 146.7993 & 12.1161 \tabularnewline
58 & 0.0666 & -0.3687 & 0.0307 & 3355.6183 & 279.6349 & 16.7223 \tabularnewline
59 & 0.0738 & -0.3984 & 0.0332 & 3380.0925 & 281.6744 & 16.7832 \tabularnewline
60 & 0.0665 & -0.3035 & 0.0253 & 2546.5306 & 212.2109 & 14.5675 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65310&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.0607[/C][C]-0.0016[/C][C]1e-04[/C][C]0.0369[/C][C]0.0031[/C][C]0.0554[/C][/ROW]
[ROW][C]50[/C][C]0.0686[/C][C]-0.0448[/C][C]0.0037[/C][C]23.9789[/C][C]1.9982[/C][C]1.4136[/C][/ROW]
[ROW][C]51[/C][C]0.0571[/C][C]0.0101[/C][C]8e-04[/C][C]1.9564[/C][C]0.163[/C][C]0.4038[/C][/ROW]
[ROW][C]52[/C][C]0.0583[/C][C]-0.0681[/C][C]0.0057[/C][C]99.5648[/C][C]8.2971[/C][C]2.8805[/C][/ROW]
[ROW][C]53[/C][C]0.0635[/C][C]-0.1985[/C][C]0.0165[/C][C]770.7344[/C][C]64.2279[/C][C]8.0142[/C][/ROW]
[ROW][C]54[/C][C]0.0665[/C][C]-0.1362[/C][C]0.0114[/C][C]349.2155[/C][C]29.1013[/C][C]5.3946[/C][/ROW]
[ROW][C]55[/C][C]0.0727[/C][C]-0.2809[/C][C]0.0234[/C][C]1360.1142[/C][C]113.3429[/C][C]10.6463[/C][/ROW]
[ROW][C]56[/C][C]0.0677[/C][C]-0.2978[/C][C]0.0248[/C][C]1882.2839[/C][C]156.857[/C][C]12.5243[/C][/ROW]
[ROW][C]57[/C][C]0.0662[/C][C]-0.2737[/C][C]0.0228[/C][C]1761.5916[/C][C]146.7993[/C][C]12.1161[/C][/ROW]
[ROW][C]58[/C][C]0.0666[/C][C]-0.3687[/C][C]0.0307[/C][C]3355.6183[/C][C]279.6349[/C][C]16.7223[/C][/ROW]
[ROW][C]59[/C][C]0.0738[/C][C]-0.3984[/C][C]0.0332[/C][C]3380.0925[/C][C]281.6744[/C][C]16.7832[/C][/ROW]
[ROW][C]60[/C][C]0.0665[/C][C]-0.3035[/C][C]0.0253[/C][C]2546.5306[/C][C]212.2109[/C][C]14.5675[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65310&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65310&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.0607-0.00161e-040.03690.00310.0554
500.0686-0.04480.003723.97891.99821.4136
510.05710.01018e-041.95640.1630.4038
520.0583-0.06810.005799.56488.29712.8805
530.0635-0.19850.0165770.734464.22798.0142
540.0665-0.13620.0114349.215529.10135.3946
550.0727-0.28090.02341360.1142113.342910.6463
560.0677-0.29780.02481882.2839156.85712.5243
570.0662-0.27370.02281761.5916146.799312.1161
580.0666-0.36870.03073355.6183279.634916.7223
590.0738-0.39840.03323380.0925281.674416.7832
600.0665-0.30350.02532546.5306212.210914.5675



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