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, 18 Dec 2014 15:10:41 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2014/Dec/18/t14189154548ox7w7hc3m53o62.htm/, Retrieved Fri, 17 May 2024 16:51:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=271048, Retrieved Fri, 17 May 2024 16:51:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact65
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecasting] [2014-12-18 15:10:41] [9636d26fd774798d33054b538c301d75] [Current]
Feedback Forum

Post a new message
Dataseries X:
12.9
12.2
12.8
7.4
6.7
12.6
14.8
13.3
11.1
8.2
11.4
6.4
10.6
12
6.3
11.3
11.9
9.3
9.6
10
6.4
13.8
10.8
13.8
11.7
10.9
16.1
13.4
9.9
11.5
8.3
11.7
9
9.7
10.8
10.3
10.4
12.7
9.3
11.8
5.9
11.4
13
10.8
12.3
11.3
11.8
7.9
12.7
12.3
11.6
6.7
10.9
12.1
13.3
10.1
5.7
14.3
8
13.3
9.3
12.5
7.6
15.9
9.2
9.1
11.1
13
14.5
12.2
12.3
11.4
8.8
14.6
12.6
13
12.6
13.2
9.9
7.7
10.5
13.4
10.9
4.3
10.3
11.8
11.2
11.4
8.6
13.2
12.6
5.6
9.9
8.8
7.7
9
7.3
11.4
13.6
7.9
10.7
10.3
8.3
9.6
14.2
8.5
13.5
4.9
6.4
9.6
11.6
11.1
4.35
12.7
18.1
17.85
16.6
12.6
17.1
19.1
16.1
13.35
18.4
14.7
10.6
12.6
16.2
13.6
18.9
14.1
14.5
16.15
14.75
14.8
12.45
12.65
17.35
8.6
18.4
16.1
11.6
17.75
15.25
17.65
16.35
17.65
13.6
14.35
14.75
18.25
9.9
16
18.25
16.85
14.6
13.85
18.95
15.6
14.85
11.75
18.45
15.9
17.1
16.1
19.9
10.95
18.45
15.1
15
11.35
15.95
18.1
14.6
15.4
15.4
17.6
13.35
19.1
15.35
7.6
13.4
13.9
19.1
15.25
12.9
16.1
17.35
13.15
12.15
12.6
10.35
15.4
9.6
18.2
13.6
14.85
14.75
14.1
14.9
16.25
19.25
13.6
13.6
15.65
12.75
14.6
9.85
12.65
19.2
16.6
11.2
15.25
11.9
13.2
16.35
12.4
15.85
18.15
11.15
15.65
17.75
7.65
12.35
15.6
19.3
15.2
17.1
15.6
18.4
19.05
18.55
19.1
13.1
12.85
9.5
4.5
11.85
13.6
11.7
12.4
13.35
11.4
14.9
19.9
11.2
14.6
17.6
14.05
16.1
13.35
11.85
11.95
14.75
15.15
13.2
16.85
7.85
7.7
12.6
7.85
10.95
12.35
9.95
14.9
16.65
13.4
13.95
15.7
16.85
10.95
15.35
12.2
15.1
17.75
15.2
14.6
16.65
8.1




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=271048&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' @ jenkins.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[266])
26516.65-------
26613.4-------
26713.950-26.173326.17330.14810.15780.15780.1578
26815.70-26.173326.17330.11990.14810.14810.1578
26916.850-26.173326.17330.10350.11990.11990.1578
27010.950-26.173326.17330.20610.10350.10350.1578
27115.350-26.173326.17330.12520.20610.20610.1578
27212.20-26.173326.17330.18050.12520.12520.1578
27315.10-26.173326.17330.12910.18050.18050.1578
27417.750-26.173326.17330.09190.12910.12910.1578
27515.20-26.173326.17330.12750.09190.09190.1578
27614.60-26.173326.17330.13710.12750.12750.1578
27716.650-26.173326.17330.10620.13710.13710.1578
2788.10-26.173326.17330.27210.10620.10620.1578

\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[266]) \tabularnewline
265 & 16.65 & - & - & - & - & - & - & - \tabularnewline
266 & 13.4 & - & - & - & - & - & - & - \tabularnewline
267 & 13.95 & 0 & -26.1733 & 26.1733 & 0.1481 & 0.1578 & 0.1578 & 0.1578 \tabularnewline
268 & 15.7 & 0 & -26.1733 & 26.1733 & 0.1199 & 0.1481 & 0.1481 & 0.1578 \tabularnewline
269 & 16.85 & 0 & -26.1733 & 26.1733 & 0.1035 & 0.1199 & 0.1199 & 0.1578 \tabularnewline
270 & 10.95 & 0 & -26.1733 & 26.1733 & 0.2061 & 0.1035 & 0.1035 & 0.1578 \tabularnewline
271 & 15.35 & 0 & -26.1733 & 26.1733 & 0.1252 & 0.2061 & 0.2061 & 0.1578 \tabularnewline
272 & 12.2 & 0 & -26.1733 & 26.1733 & 0.1805 & 0.1252 & 0.1252 & 0.1578 \tabularnewline
273 & 15.1 & 0 & -26.1733 & 26.1733 & 0.1291 & 0.1805 & 0.1805 & 0.1578 \tabularnewline
274 & 17.75 & 0 & -26.1733 & 26.1733 & 0.0919 & 0.1291 & 0.1291 & 0.1578 \tabularnewline
275 & 15.2 & 0 & -26.1733 & 26.1733 & 0.1275 & 0.0919 & 0.0919 & 0.1578 \tabularnewline
276 & 14.6 & 0 & -26.1733 & 26.1733 & 0.1371 & 0.1275 & 0.1275 & 0.1578 \tabularnewline
277 & 16.65 & 0 & -26.1733 & 26.1733 & 0.1062 & 0.1371 & 0.1371 & 0.1578 \tabularnewline
278 & 8.1 & 0 & -26.1733 & 26.1733 & 0.2721 & 0.1062 & 0.1062 & 0.1578 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=271048&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[266])[/C][/ROW]
[ROW][C]265[/C][C]16.65[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]266[/C][C]13.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]267[/C][C]13.95[/C][C]0[/C][C]-26.1733[/C][C]26.1733[/C][C]0.1481[/C][C]0.1578[/C][C]0.1578[/C][C]0.1578[/C][/ROW]
[ROW][C]268[/C][C]15.7[/C][C]0[/C][C]-26.1733[/C][C]26.1733[/C][C]0.1199[/C][C]0.1481[/C][C]0.1481[/C][C]0.1578[/C][/ROW]
[ROW][C]269[/C][C]16.85[/C][C]0[/C][C]-26.1733[/C][C]26.1733[/C][C]0.1035[/C][C]0.1199[/C][C]0.1199[/C][C]0.1578[/C][/ROW]
[ROW][C]270[/C][C]10.95[/C][C]0[/C][C]-26.1733[/C][C]26.1733[/C][C]0.2061[/C][C]0.1035[/C][C]0.1035[/C][C]0.1578[/C][/ROW]
[ROW][C]271[/C][C]15.35[/C][C]0[/C][C]-26.1733[/C][C]26.1733[/C][C]0.1252[/C][C]0.2061[/C][C]0.2061[/C][C]0.1578[/C][/ROW]
[ROW][C]272[/C][C]12.2[/C][C]0[/C][C]-26.1733[/C][C]26.1733[/C][C]0.1805[/C][C]0.1252[/C][C]0.1252[/C][C]0.1578[/C][/ROW]
[ROW][C]273[/C][C]15.1[/C][C]0[/C][C]-26.1733[/C][C]26.1733[/C][C]0.1291[/C][C]0.1805[/C][C]0.1805[/C][C]0.1578[/C][/ROW]
[ROW][C]274[/C][C]17.75[/C][C]0[/C][C]-26.1733[/C][C]26.1733[/C][C]0.0919[/C][C]0.1291[/C][C]0.1291[/C][C]0.1578[/C][/ROW]
[ROW][C]275[/C][C]15.2[/C][C]0[/C][C]-26.1733[/C][C]26.1733[/C][C]0.1275[/C][C]0.0919[/C][C]0.0919[/C][C]0.1578[/C][/ROW]
[ROW][C]276[/C][C]14.6[/C][C]0[/C][C]-26.1733[/C][C]26.1733[/C][C]0.1371[/C][C]0.1275[/C][C]0.1275[/C][C]0.1578[/C][/ROW]
[ROW][C]277[/C][C]16.65[/C][C]0[/C][C]-26.1733[/C][C]26.1733[/C][C]0.1062[/C][C]0.1371[/C][C]0.1371[/C][C]0.1578[/C][/ROW]
[ROW][C]278[/C][C]8.1[/C][C]0[/C][C]-26.1733[/C][C]26.1733[/C][C]0.2721[/C][C]0.1062[/C][C]0.1062[/C][C]0.1578[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=271048&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=271048&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[266])
26516.65-------
26613.4-------
26713.950-26.173326.17330.14810.15780.15780.1578
26815.70-26.173326.17330.11990.14810.14810.1578
26916.850-26.173326.17330.10350.11990.11990.1578
27010.950-26.173326.17330.20610.10350.10350.1578
27115.350-26.173326.17330.12520.20610.20610.1578
27212.20-26.173326.17330.18050.12520.12520.1578
27315.10-26.173326.17330.12910.18050.18050.1578
27417.750-26.173326.17330.09190.12910.12910.1578
27515.20-26.173326.17330.12750.09190.09190.1578
27614.60-26.173326.17330.13710.12750.12750.1578
27716.650-26.173326.17330.10620.13710.13710.1578
2788.10-26.173326.17330.27210.10620.10620.1578







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
267Inf112194.6025004.30434.3043
268Inf112246.49220.546214.85084.84434.5743
269Inf112283.9225241.671715.54585.19924.7826
270Inf112119.9025211.229414.53373.37874.4316
271Inf112235.6225216.10814.70064.73634.4926
272Inf112148.84204.896714.31423.76444.3712
273Inf112228.01208.198614.42914.65924.4123
274Inf112315.0625221.556614.88485.47694.5454
275Inf112231.04222.610314.92014.694.5615
276Inf112213.16221.665314.88844.50494.5558
277Inf112277.2225226.715915.05715.13744.6087
278Inf11265.61213.290414.60452.49934.4329

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
267 & Inf & 1 & 1 & 2 & 194.6025 & 0 & 0 & 4.3043 & 4.3043 \tabularnewline
268 & Inf & 1 & 1 & 2 & 246.49 & 220.5462 & 14.8508 & 4.8443 & 4.5743 \tabularnewline
269 & Inf & 1 & 1 & 2 & 283.9225 & 241.6717 & 15.5458 & 5.1992 & 4.7826 \tabularnewline
270 & Inf & 1 & 1 & 2 & 119.9025 & 211.2294 & 14.5337 & 3.3787 & 4.4316 \tabularnewline
271 & Inf & 1 & 1 & 2 & 235.6225 & 216.108 & 14.7006 & 4.7363 & 4.4926 \tabularnewline
272 & Inf & 1 & 1 & 2 & 148.84 & 204.8967 & 14.3142 & 3.7644 & 4.3712 \tabularnewline
273 & Inf & 1 & 1 & 2 & 228.01 & 208.1986 & 14.4291 & 4.6592 & 4.4123 \tabularnewline
274 & Inf & 1 & 1 & 2 & 315.0625 & 221.5566 & 14.8848 & 5.4769 & 4.5454 \tabularnewline
275 & Inf & 1 & 1 & 2 & 231.04 & 222.6103 & 14.9201 & 4.69 & 4.5615 \tabularnewline
276 & Inf & 1 & 1 & 2 & 213.16 & 221.6653 & 14.8884 & 4.5049 & 4.5558 \tabularnewline
277 & Inf & 1 & 1 & 2 & 277.2225 & 226.7159 & 15.0571 & 5.1374 & 4.6087 \tabularnewline
278 & Inf & 1 & 1 & 2 & 65.61 & 213.2904 & 14.6045 & 2.4993 & 4.4329 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=271048&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]267[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]194.6025[/C][C]0[/C][C]0[/C][C]4.3043[/C][C]4.3043[/C][/ROW]
[ROW][C]268[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]246.49[/C][C]220.5462[/C][C]14.8508[/C][C]4.8443[/C][C]4.5743[/C][/ROW]
[ROW][C]269[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]283.9225[/C][C]241.6717[/C][C]15.5458[/C][C]5.1992[/C][C]4.7826[/C][/ROW]
[ROW][C]270[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]119.9025[/C][C]211.2294[/C][C]14.5337[/C][C]3.3787[/C][C]4.4316[/C][/ROW]
[ROW][C]271[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]235.6225[/C][C]216.108[/C][C]14.7006[/C][C]4.7363[/C][C]4.4926[/C][/ROW]
[ROW][C]272[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]148.84[/C][C]204.8967[/C][C]14.3142[/C][C]3.7644[/C][C]4.3712[/C][/ROW]
[ROW][C]273[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]228.01[/C][C]208.1986[/C][C]14.4291[/C][C]4.6592[/C][C]4.4123[/C][/ROW]
[ROW][C]274[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]315.0625[/C][C]221.5566[/C][C]14.8848[/C][C]5.4769[/C][C]4.5454[/C][/ROW]
[ROW][C]275[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]231.04[/C][C]222.6103[/C][C]14.9201[/C][C]4.69[/C][C]4.5615[/C][/ROW]
[ROW][C]276[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]213.16[/C][C]221.6653[/C][C]14.8884[/C][C]4.5049[/C][C]4.5558[/C][/ROW]
[ROW][C]277[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]277.2225[/C][C]226.7159[/C][C]15.0571[/C][C]5.1374[/C][C]4.6087[/C][/ROW]
[ROW][C]278[/C][C]Inf[/C][C]1[/C][C]1[/C][C]2[/C][C]65.61[/C][C]213.2904[/C][C]14.6045[/C][C]2.4993[/C][C]4.4329[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=271048&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=271048&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
267Inf112194.6025004.30434.3043
268Inf112246.49220.546214.85084.84434.5743
269Inf112283.9225241.671715.54585.19924.7826
270Inf112119.9025211.229414.53373.37874.4316
271Inf112235.6225216.10814.70064.73634.4926
272Inf112148.84204.896714.31423.76444.3712
273Inf112228.01208.198614.42914.65924.4123
274Inf112315.0625221.556614.88485.47694.5454
275Inf112231.04222.610314.92014.694.5615
276Inf112213.16221.665314.88844.50494.5558
277Inf112277.2225226.715915.05715.13744.6087
278Inf11265.61213.290414.60452.49934.4329



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 1 ; par6 = 0 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 1 ; par6 = 0 ; 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,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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')