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 computationMon, 07 Dec 2009 03:47:16 -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/07/t12601829152kiz1mv7369pnxz.htm/, Retrieved Tue, 30 Apr 2024 19:31:08 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=64550, Retrieved Tue, 30 Apr 2024 19:31:08 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact175
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-12 13:32:37] [76963dc1903f0f612b6153510a3818cf]
- R  D  [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-17 12:14:40] [76963dc1903f0f612b6153510a3818cf]
-         [Univariate Explorative Data Analysis] [Run Sequence Plot...] [2008-12-22 18:19:51] [1ce0d16c8f4225c977b42c8fa93bc163]
- RMP       [Spectral Analysis] [Identifying Integ...] [2009-11-22 12:38:17] [b98453cac15ba1066b407e146608df68]
- R  D        [Spectral Analysis] [Spectrum Link 1] [2009-11-25 19:37:00] [1f74ef2f756548f1f3a7b6136ea56d7f]
-   PD          [Spectral Analysis] [Spectrum d=0, D=0] [2009-12-02 20:47:15] [74be16979710d4c4e7c6647856088456]
-   PD            [Spectral Analysis] [Spectrum d=1, D=1] [2009-12-03 17:21:13] [1f74ef2f756548f1f3a7b6136ea56d7f]
- RMP                 [ARIMA Forecasting] [test] [2009-12-07 10:47:16] [026d431dc78a3ce53a040b5408fc0322] [Current]
Feedback Forum

Post a new message
Dataseries X:
111.5
108.1
124.5
106.3
111.1
121.3
116.5
117.4
123.6
98.4
107.2
118.9
111.9
115.2
124.4
104.6
117
126.2
117.5
122.2
124.1
105.8
107.5
125.6
112.1
120.1
130.6
109.8
122.1
129.5
132.1
133.3
128.4
114.7
114.1
136.9
123.4
134
137
127.8
140.1
140.4
157.8
151.8
141.1
138.8
141.1
139.5
150.7
144.4
146
143.6
143.1
156.4
164.8
145.1
153.4
133.2
131.4
145.9




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=64550&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 time1 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])
36136.9-------
37123.4-------
38134-------
39137-------
40127.8-------
41140.1-------
42140.4-------
43157.8-------
44151.8-------
45141.1-------
46138.8-------
47141.1-------
48139.5-------
49150.7143.0971133.5715152.62260.05890.770410.7704
50144.4153.6262144.0083163.2440.030.724510.998
51146146.7389137.0049156.47290.44090.68120.97510.9275
52143.6144.7531133.3627156.14340.42140.41510.99820.817
53143.1156.4086144.7062168.11090.01290.9840.99680.9977
54156.4152.5633140.5984164.52810.26480.93950.97680.9838
55164.8169.6992156.9375182.46080.22590.97950.96621
56145.1165.2687152.1195178.4180.00130.52790.97770.9999
57153.4154.3602140.8783167.84220.44450.91090.97310.9846
58133.2153.2495139.2356167.26330.00250.49160.97840.9728
59131.4155.598141.1934170.00275e-040.99880.97570.9858
60145.9153.4804138.7234168.23730.1570.99830.96830.9683

\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 & 136.9 & - & - & - & - & - & - & - \tabularnewline
37 & 123.4 & - & - & - & - & - & - & - \tabularnewline
38 & 134 & - & - & - & - & - & - & - \tabularnewline
39 & 137 & - & - & - & - & - & - & - \tabularnewline
40 & 127.8 & - & - & - & - & - & - & - \tabularnewline
41 & 140.1 & - & - & - & - & - & - & - \tabularnewline
42 & 140.4 & - & - & - & - & - & - & - \tabularnewline
43 & 157.8 & - & - & - & - & - & - & - \tabularnewline
44 & 151.8 & - & - & - & - & - & - & - \tabularnewline
45 & 141.1 & - & - & - & - & - & - & - \tabularnewline
46 & 138.8 & - & - & - & - & - & - & - \tabularnewline
47 & 141.1 & - & - & - & - & - & - & - \tabularnewline
48 & 139.5 & - & - & - & - & - & - & - \tabularnewline
49 & 150.7 & 143.0971 & 133.5715 & 152.6226 & 0.0589 & 0.7704 & 1 & 0.7704 \tabularnewline
50 & 144.4 & 153.6262 & 144.0083 & 163.244 & 0.03 & 0.7245 & 1 & 0.998 \tabularnewline
51 & 146 & 146.7389 & 137.0049 & 156.4729 & 0.4409 & 0.6812 & 0.9751 & 0.9275 \tabularnewline
52 & 143.6 & 144.7531 & 133.3627 & 156.1434 & 0.4214 & 0.4151 & 0.9982 & 0.817 \tabularnewline
53 & 143.1 & 156.4086 & 144.7062 & 168.1109 & 0.0129 & 0.984 & 0.9968 & 0.9977 \tabularnewline
54 & 156.4 & 152.5633 & 140.5984 & 164.5281 & 0.2648 & 0.9395 & 0.9768 & 0.9838 \tabularnewline
55 & 164.8 & 169.6992 & 156.9375 & 182.4608 & 0.2259 & 0.9795 & 0.9662 & 1 \tabularnewline
56 & 145.1 & 165.2687 & 152.1195 & 178.418 & 0.0013 & 0.5279 & 0.9777 & 0.9999 \tabularnewline
57 & 153.4 & 154.3602 & 140.8783 & 167.8422 & 0.4445 & 0.9109 & 0.9731 & 0.9846 \tabularnewline
58 & 133.2 & 153.2495 & 139.2356 & 167.2633 & 0.0025 & 0.4916 & 0.9784 & 0.9728 \tabularnewline
59 & 131.4 & 155.598 & 141.1934 & 170.0027 & 5e-04 & 0.9988 & 0.9757 & 0.9858 \tabularnewline
60 & 145.9 & 153.4804 & 138.7234 & 168.2373 & 0.157 & 0.9983 & 0.9683 & 0.9683 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=64550&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]136.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]123.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]134[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]137[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]127.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]140.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]140.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]157.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]151.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]141.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]138.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]141.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]139.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]150.7[/C][C]143.0971[/C][C]133.5715[/C][C]152.6226[/C][C]0.0589[/C][C]0.7704[/C][C]1[/C][C]0.7704[/C][/ROW]
[ROW][C]50[/C][C]144.4[/C][C]153.6262[/C][C]144.0083[/C][C]163.244[/C][C]0.03[/C][C]0.7245[/C][C]1[/C][C]0.998[/C][/ROW]
[ROW][C]51[/C][C]146[/C][C]146.7389[/C][C]137.0049[/C][C]156.4729[/C][C]0.4409[/C][C]0.6812[/C][C]0.9751[/C][C]0.9275[/C][/ROW]
[ROW][C]52[/C][C]143.6[/C][C]144.7531[/C][C]133.3627[/C][C]156.1434[/C][C]0.4214[/C][C]0.4151[/C][C]0.9982[/C][C]0.817[/C][/ROW]
[ROW][C]53[/C][C]143.1[/C][C]156.4086[/C][C]144.7062[/C][C]168.1109[/C][C]0.0129[/C][C]0.984[/C][C]0.9968[/C][C]0.9977[/C][/ROW]
[ROW][C]54[/C][C]156.4[/C][C]152.5633[/C][C]140.5984[/C][C]164.5281[/C][C]0.2648[/C][C]0.9395[/C][C]0.9768[/C][C]0.9838[/C][/ROW]
[ROW][C]55[/C][C]164.8[/C][C]169.6992[/C][C]156.9375[/C][C]182.4608[/C][C]0.2259[/C][C]0.9795[/C][C]0.9662[/C][C]1[/C][/ROW]
[ROW][C]56[/C][C]145.1[/C][C]165.2687[/C][C]152.1195[/C][C]178.418[/C][C]0.0013[/C][C]0.5279[/C][C]0.9777[/C][C]0.9999[/C][/ROW]
[ROW][C]57[/C][C]153.4[/C][C]154.3602[/C][C]140.8783[/C][C]167.8422[/C][C]0.4445[/C][C]0.9109[/C][C]0.9731[/C][C]0.9846[/C][/ROW]
[ROW][C]58[/C][C]133.2[/C][C]153.2495[/C][C]139.2356[/C][C]167.2633[/C][C]0.0025[/C][C]0.4916[/C][C]0.9784[/C][C]0.9728[/C][/ROW]
[ROW][C]59[/C][C]131.4[/C][C]155.598[/C][C]141.1934[/C][C]170.0027[/C][C]5e-04[/C][C]0.9988[/C][C]0.9757[/C][C]0.9858[/C][/ROW]
[ROW][C]60[/C][C]145.9[/C][C]153.4804[/C][C]138.7234[/C][C]168.2373[/C][C]0.157[/C][C]0.9983[/C][C]0.9683[/C][C]0.9683[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=64550&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=64550&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])
36136.9-------
37123.4-------
38134-------
39137-------
40127.8-------
41140.1-------
42140.4-------
43157.8-------
44151.8-------
45141.1-------
46138.8-------
47141.1-------
48139.5-------
49150.7143.0971133.5715152.62260.05890.770410.7704
50144.4153.6262144.0083163.2440.030.724510.998
51146146.7389137.0049156.47290.44090.68120.97510.9275
52143.6144.7531133.3627156.14340.42140.41510.99820.817
53143.1156.4086144.7062168.11090.01290.9840.99680.9977
54156.4152.5633140.5984164.52810.26480.93950.97680.9838
55164.8169.6992156.9375182.46080.22590.97950.96621
56145.1165.2687152.1195178.4180.00130.52790.97770.9999
57153.4154.3602140.8783167.84220.44450.91090.97310.9846
58133.2153.2495139.2356167.26330.00250.49160.97840.9728
59131.4155.598141.1934170.00275e-040.99880.97570.9858
60145.9153.4804138.7234168.23730.1570.99830.96830.9683







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0340.0531057.804500
500.0319-0.06010.056685.121971.46328.4536
510.0338-0.0050.03940.54647.82416.9155
520.0401-0.0080.03151.329536.20056.0167
530.0382-0.08510.0423177.117964.3848.024
540.040.02510.039414.720556.10677.4904
550.0384-0.02890.037924.001851.52037.1778
560.0406-0.1220.0484406.778295.92759.7943
570.0446-0.00620.04370.922185.37149.2397
580.0467-0.13080.0524401.9806117.032310.8181
590.0472-0.15550.0618585.5456159.624412.6343
600.0491-0.04940.060857.4617151.110912.2927

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.034 & 0.0531 & 0 & 57.8045 & 0 & 0 \tabularnewline
50 & 0.0319 & -0.0601 & 0.0566 & 85.1219 & 71.4632 & 8.4536 \tabularnewline
51 & 0.0338 & -0.005 & 0.0394 & 0.546 & 47.8241 & 6.9155 \tabularnewline
52 & 0.0401 & -0.008 & 0.0315 & 1.3295 & 36.2005 & 6.0167 \tabularnewline
53 & 0.0382 & -0.0851 & 0.0423 & 177.1179 & 64.384 & 8.024 \tabularnewline
54 & 0.04 & 0.0251 & 0.0394 & 14.7205 & 56.1067 & 7.4904 \tabularnewline
55 & 0.0384 & -0.0289 & 0.0379 & 24.0018 & 51.5203 & 7.1778 \tabularnewline
56 & 0.0406 & -0.122 & 0.0484 & 406.7782 & 95.9275 & 9.7943 \tabularnewline
57 & 0.0446 & -0.0062 & 0.0437 & 0.9221 & 85.3714 & 9.2397 \tabularnewline
58 & 0.0467 & -0.1308 & 0.0524 & 401.9806 & 117.0323 & 10.8181 \tabularnewline
59 & 0.0472 & -0.1555 & 0.0618 & 585.5456 & 159.6244 & 12.6343 \tabularnewline
60 & 0.0491 & -0.0494 & 0.0608 & 57.4617 & 151.1109 & 12.2927 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=64550&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.034[/C][C]0.0531[/C][C]0[/C][C]57.8045[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0319[/C][C]-0.0601[/C][C]0.0566[/C][C]85.1219[/C][C]71.4632[/C][C]8.4536[/C][/ROW]
[ROW][C]51[/C][C]0.0338[/C][C]-0.005[/C][C]0.0394[/C][C]0.546[/C][C]47.8241[/C][C]6.9155[/C][/ROW]
[ROW][C]52[/C][C]0.0401[/C][C]-0.008[/C][C]0.0315[/C][C]1.3295[/C][C]36.2005[/C][C]6.0167[/C][/ROW]
[ROW][C]53[/C][C]0.0382[/C][C]-0.0851[/C][C]0.0423[/C][C]177.1179[/C][C]64.384[/C][C]8.024[/C][/ROW]
[ROW][C]54[/C][C]0.04[/C][C]0.0251[/C][C]0.0394[/C][C]14.7205[/C][C]56.1067[/C][C]7.4904[/C][/ROW]
[ROW][C]55[/C][C]0.0384[/C][C]-0.0289[/C][C]0.0379[/C][C]24.0018[/C][C]51.5203[/C][C]7.1778[/C][/ROW]
[ROW][C]56[/C][C]0.0406[/C][C]-0.122[/C][C]0.0484[/C][C]406.7782[/C][C]95.9275[/C][C]9.7943[/C][/ROW]
[ROW][C]57[/C][C]0.0446[/C][C]-0.0062[/C][C]0.0437[/C][C]0.9221[/C][C]85.3714[/C][C]9.2397[/C][/ROW]
[ROW][C]58[/C][C]0.0467[/C][C]-0.1308[/C][C]0.0524[/C][C]401.9806[/C][C]117.0323[/C][C]10.8181[/C][/ROW]
[ROW][C]59[/C][C]0.0472[/C][C]-0.1555[/C][C]0.0618[/C][C]585.5456[/C][C]159.6244[/C][C]12.6343[/C][/ROW]
[ROW][C]60[/C][C]0.0491[/C][C]-0.0494[/C][C]0.0608[/C][C]57.4617[/C][C]151.1109[/C][C]12.2927[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=64550&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=64550&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.0340.0531057.804500
500.0319-0.06010.056685.121971.46328.4536
510.0338-0.0050.03940.54647.82416.9155
520.0401-0.0080.03151.329536.20056.0167
530.0382-0.08510.0423177.117964.3848.024
540.040.02510.039414.720556.10677.4904
550.0384-0.02890.037924.001851.52037.1778
560.0406-0.1220.0484406.778295.92759.7943
570.0446-0.00620.04370.922185.37149.2397
580.0467-0.13080.0524401.9806117.032310.8181
590.0472-0.15550.0618585.5456159.624412.6343
600.0491-0.04940.060857.4617151.110912.2927



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