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, 16 Dec 2016 09:40:57 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Dec/16/t1481877686cymxfbm8zj4c523.htm/, Retrieved Fri, 03 May 2024 00:19:20 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300122, Retrieved Fri, 03 May 2024 00:19:20 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact76
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Forecast arima] [2016-12-16 08:40:57] [f07fac15bca656f595926f3a45d3c842] [Current]
Feedback Forum

Post a new message
Dataseries X:
8450
7050
7700
7650
6900
6600
7400
7550
7450
8850
6100
5850
6800
7800
4950
7200
7450
6200
8450
7900
6600
7900
6200
8400
7600
5200
7450
9550
7800
7650
9750
8700
7150
10550
10150
12300
7850
8450
10000
11150
7750
11100
8650
9050
7200
8600
7500
8200
10050
9900
9500




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300122&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=300122&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300122&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center







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[39])
388450-------
3910000-------
401115010808.33777533.179917146.07880.45790.59870.59870.5987
41775011114.65217694.227517830.37440.16310.49590.49590.6275
421110011435.09647846.106918617.97560.46360.84270.84270.6523
43865011770.58257982.095219549.230.21580.56710.56710.6723
44905012122.09868095.723320673.78120.24070.78690.78690.6866
45720012490.7178181.416422053.55670.13910.75970.75970.6951
46860012877.60338235.068823767.73180.22070.84660.84660.6977
47750013284.02568254.391425921.03640.18480.76620.76620.6947
48820013711.36668238.956828657.63390.23490.79230.79230.6868
491005014161.13588189.97232184.54780.32740.74160.74160.6746
50990014634.98418109.887636812.36430.33780.65730.65730.659
51950015134.72058001.961743029.35970.34610.64350.64350.6409

\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[39]) \tabularnewline
38 & 8450 & - & - & - & - & - & - & - \tabularnewline
39 & 10000 & - & - & - & - & - & - & - \tabularnewline
40 & 11150 & 10808.3377 & 7533.1799 & 17146.0788 & 0.4579 & 0.5987 & 0.5987 & 0.5987 \tabularnewline
41 & 7750 & 11114.6521 & 7694.2275 & 17830.3744 & 0.1631 & 0.4959 & 0.4959 & 0.6275 \tabularnewline
42 & 11100 & 11435.0964 & 7846.1069 & 18617.9756 & 0.4636 & 0.8427 & 0.8427 & 0.6523 \tabularnewline
43 & 8650 & 11770.5825 & 7982.0952 & 19549.23 & 0.2158 & 0.5671 & 0.5671 & 0.6723 \tabularnewline
44 & 9050 & 12122.0986 & 8095.7233 & 20673.7812 & 0.2407 & 0.7869 & 0.7869 & 0.6866 \tabularnewline
45 & 7200 & 12490.717 & 8181.4164 & 22053.5567 & 0.1391 & 0.7597 & 0.7597 & 0.6951 \tabularnewline
46 & 8600 & 12877.6033 & 8235.0688 & 23767.7318 & 0.2207 & 0.8466 & 0.8466 & 0.6977 \tabularnewline
47 & 7500 & 13284.0256 & 8254.3914 & 25921.0364 & 0.1848 & 0.7662 & 0.7662 & 0.6947 \tabularnewline
48 & 8200 & 13711.3666 & 8238.9568 & 28657.6339 & 0.2349 & 0.7923 & 0.7923 & 0.6868 \tabularnewline
49 & 10050 & 14161.1358 & 8189.972 & 32184.5478 & 0.3274 & 0.7416 & 0.7416 & 0.6746 \tabularnewline
50 & 9900 & 14634.9841 & 8109.8876 & 36812.3643 & 0.3378 & 0.6573 & 0.6573 & 0.659 \tabularnewline
51 & 9500 & 15134.7205 & 8001.9617 & 43029.3597 & 0.3461 & 0.6435 & 0.6435 & 0.6409 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300122&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[39])[/C][/ROW]
[ROW][C]38[/C][C]8450[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]10000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]11150[/C][C]10808.3377[/C][C]7533.1799[/C][C]17146.0788[/C][C]0.4579[/C][C]0.5987[/C][C]0.5987[/C][C]0.5987[/C][/ROW]
[ROW][C]41[/C][C]7750[/C][C]11114.6521[/C][C]7694.2275[/C][C]17830.3744[/C][C]0.1631[/C][C]0.4959[/C][C]0.4959[/C][C]0.6275[/C][/ROW]
[ROW][C]42[/C][C]11100[/C][C]11435.0964[/C][C]7846.1069[/C][C]18617.9756[/C][C]0.4636[/C][C]0.8427[/C][C]0.8427[/C][C]0.6523[/C][/ROW]
[ROW][C]43[/C][C]8650[/C][C]11770.5825[/C][C]7982.0952[/C][C]19549.23[/C][C]0.2158[/C][C]0.5671[/C][C]0.5671[/C][C]0.6723[/C][/ROW]
[ROW][C]44[/C][C]9050[/C][C]12122.0986[/C][C]8095.7233[/C][C]20673.7812[/C][C]0.2407[/C][C]0.7869[/C][C]0.7869[/C][C]0.6866[/C][/ROW]
[ROW][C]45[/C][C]7200[/C][C]12490.717[/C][C]8181.4164[/C][C]22053.5567[/C][C]0.1391[/C][C]0.7597[/C][C]0.7597[/C][C]0.6951[/C][/ROW]
[ROW][C]46[/C][C]8600[/C][C]12877.6033[/C][C]8235.0688[/C][C]23767.7318[/C][C]0.2207[/C][C]0.8466[/C][C]0.8466[/C][C]0.6977[/C][/ROW]
[ROW][C]47[/C][C]7500[/C][C]13284.0256[/C][C]8254.3914[/C][C]25921.0364[/C][C]0.1848[/C][C]0.7662[/C][C]0.7662[/C][C]0.6947[/C][/ROW]
[ROW][C]48[/C][C]8200[/C][C]13711.3666[/C][C]8238.9568[/C][C]28657.6339[/C][C]0.2349[/C][C]0.7923[/C][C]0.7923[/C][C]0.6868[/C][/ROW]
[ROW][C]49[/C][C]10050[/C][C]14161.1358[/C][C]8189.972[/C][C]32184.5478[/C][C]0.3274[/C][C]0.7416[/C][C]0.7416[/C][C]0.6746[/C][/ROW]
[ROW][C]50[/C][C]9900[/C][C]14634.9841[/C][C]8109.8876[/C][C]36812.3643[/C][C]0.3378[/C][C]0.6573[/C][C]0.6573[/C][C]0.659[/C][/ROW]
[ROW][C]51[/C][C]9500[/C][C]15134.7205[/C][C]8001.9617[/C][C]43029.3597[/C][C]0.3461[/C][C]0.6435[/C][C]0.6435[/C][C]0.6409[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300122&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300122&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[39])
388450-------
3910000-------
401115010808.33777533.179917146.07880.45790.59870.59870.5987
41775011114.65217694.227517830.37440.16310.49590.49590.6275
421110011435.09647846.106918617.97560.46360.84270.84270.6523
43865011770.58257982.095219549.230.21580.56710.56710.6723
44905012122.09868095.723320673.78120.24070.78690.78690.6866
45720012490.7178181.416422053.55670.13910.75970.75970.6951
46860012877.60338235.068823767.73180.22070.84660.84660.6977
47750013284.02568254.391425921.03640.18480.76620.76620.6947
48820013711.36668238.956828657.63390.23490.79230.79230.6868
491005014161.13588189.97232184.54780.32740.74160.74160.6746
50990014634.98418109.887636812.36430.33780.65730.65730.659
51950015134.72058001.961743029.35970.34610.64350.64350.6409







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
400.29920.03060.03060.0311116733.1122000.22040.2204
410.3083-0.43410.23240.193911320884.03615718808.57422391.4031-2.17071.1956
420.3205-0.03020.1650.1392112289.59633849968.91491962.1338-0.21620.8691
430.3372-0.36080.21390.18089738034.89785321985.41062306.9429-2.01331.1552
440.3599-0.33950.2390.20279437789.52566145146.23362478.9405-1.9821.3205
450.3906-0.73480.32170.258527991686.77549786236.32393128.2961-3.41341.6693
460.4315-0.49740.34680.278418297889.752111002186.81363316.9544-2.75971.8251
470.4854-0.77120.39980.313233454952.036213808782.46653716.017-3.73162.0634
480.5562-0.67210.43010.334330375161.446615649491.2423955.9438-3.55572.2292
490.6494-0.40910.4280.334816901437.191415774685.8373971.7359-2.65232.2715
500.7731-0.47830.43260.339522420074.6616378812.09364047.0745-3.05482.3428
510.9404-0.59310.44590.349331750075.037617659750.67234202.3506-3.63532.4505

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
40 & 0.2992 & 0.0306 & 0.0306 & 0.0311 & 116733.1122 & 0 & 0 & 0.2204 & 0.2204 \tabularnewline
41 & 0.3083 & -0.4341 & 0.2324 & 0.1939 & 11320884.0361 & 5718808.5742 & 2391.4031 & -2.1707 & 1.1956 \tabularnewline
42 & 0.3205 & -0.0302 & 0.165 & 0.1392 & 112289.5963 & 3849968.9149 & 1962.1338 & -0.2162 & 0.8691 \tabularnewline
43 & 0.3372 & -0.3608 & 0.2139 & 0.1808 & 9738034.8978 & 5321985.4106 & 2306.9429 & -2.0133 & 1.1552 \tabularnewline
44 & 0.3599 & -0.3395 & 0.239 & 0.2027 & 9437789.5256 & 6145146.2336 & 2478.9405 & -1.982 & 1.3205 \tabularnewline
45 & 0.3906 & -0.7348 & 0.3217 & 0.2585 & 27991686.7754 & 9786236.3239 & 3128.2961 & -3.4134 & 1.6693 \tabularnewline
46 & 0.4315 & -0.4974 & 0.3468 & 0.2784 & 18297889.7521 & 11002186.8136 & 3316.9544 & -2.7597 & 1.8251 \tabularnewline
47 & 0.4854 & -0.7712 & 0.3998 & 0.3132 & 33454952.0362 & 13808782.4665 & 3716.017 & -3.7316 & 2.0634 \tabularnewline
48 & 0.5562 & -0.6721 & 0.4301 & 0.3343 & 30375161.4466 & 15649491.242 & 3955.9438 & -3.5557 & 2.2292 \tabularnewline
49 & 0.6494 & -0.4091 & 0.428 & 0.3348 & 16901437.1914 & 15774685.837 & 3971.7359 & -2.6523 & 2.2715 \tabularnewline
50 & 0.7731 & -0.4783 & 0.4326 & 0.3395 & 22420074.66 & 16378812.0936 & 4047.0745 & -3.0548 & 2.3428 \tabularnewline
51 & 0.9404 & -0.5931 & 0.4459 & 0.3493 & 31750075.0376 & 17659750.6723 & 4202.3506 & -3.6353 & 2.4505 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300122&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]40[/C][C]0.2992[/C][C]0.0306[/C][C]0.0306[/C][C]0.0311[/C][C]116733.1122[/C][C]0[/C][C]0[/C][C]0.2204[/C][C]0.2204[/C][/ROW]
[ROW][C]41[/C][C]0.3083[/C][C]-0.4341[/C][C]0.2324[/C][C]0.1939[/C][C]11320884.0361[/C][C]5718808.5742[/C][C]2391.4031[/C][C]-2.1707[/C][C]1.1956[/C][/ROW]
[ROW][C]42[/C][C]0.3205[/C][C]-0.0302[/C][C]0.165[/C][C]0.1392[/C][C]112289.5963[/C][C]3849968.9149[/C][C]1962.1338[/C][C]-0.2162[/C][C]0.8691[/C][/ROW]
[ROW][C]43[/C][C]0.3372[/C][C]-0.3608[/C][C]0.2139[/C][C]0.1808[/C][C]9738034.8978[/C][C]5321985.4106[/C][C]2306.9429[/C][C]-2.0133[/C][C]1.1552[/C][/ROW]
[ROW][C]44[/C][C]0.3599[/C][C]-0.3395[/C][C]0.239[/C][C]0.2027[/C][C]9437789.5256[/C][C]6145146.2336[/C][C]2478.9405[/C][C]-1.982[/C][C]1.3205[/C][/ROW]
[ROW][C]45[/C][C]0.3906[/C][C]-0.7348[/C][C]0.3217[/C][C]0.2585[/C][C]27991686.7754[/C][C]9786236.3239[/C][C]3128.2961[/C][C]-3.4134[/C][C]1.6693[/C][/ROW]
[ROW][C]46[/C][C]0.4315[/C][C]-0.4974[/C][C]0.3468[/C][C]0.2784[/C][C]18297889.7521[/C][C]11002186.8136[/C][C]3316.9544[/C][C]-2.7597[/C][C]1.8251[/C][/ROW]
[ROW][C]47[/C][C]0.4854[/C][C]-0.7712[/C][C]0.3998[/C][C]0.3132[/C][C]33454952.0362[/C][C]13808782.4665[/C][C]3716.017[/C][C]-3.7316[/C][C]2.0634[/C][/ROW]
[ROW][C]48[/C][C]0.5562[/C][C]-0.6721[/C][C]0.4301[/C][C]0.3343[/C][C]30375161.4466[/C][C]15649491.242[/C][C]3955.9438[/C][C]-3.5557[/C][C]2.2292[/C][/ROW]
[ROW][C]49[/C][C]0.6494[/C][C]-0.4091[/C][C]0.428[/C][C]0.3348[/C][C]16901437.1914[/C][C]15774685.837[/C][C]3971.7359[/C][C]-2.6523[/C][C]2.2715[/C][/ROW]
[ROW][C]50[/C][C]0.7731[/C][C]-0.4783[/C][C]0.4326[/C][C]0.3395[/C][C]22420074.66[/C][C]16378812.0936[/C][C]4047.0745[/C][C]-3.0548[/C][C]2.3428[/C][/ROW]
[ROW][C]51[/C][C]0.9404[/C][C]-0.5931[/C][C]0.4459[/C][C]0.3493[/C][C]31750075.0376[/C][C]17659750.6723[/C][C]4202.3506[/C][C]-3.6353[/C][C]2.4505[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300122&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300122&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
400.29920.03060.03060.0311116733.1122000.22040.2204
410.3083-0.43410.23240.193911320884.03615718808.57422391.4031-2.17071.1956
420.3205-0.03020.1650.1392112289.59633849968.91491962.1338-0.21620.8691
430.3372-0.36080.21390.18089738034.89785321985.41062306.9429-2.01331.1552
440.3599-0.33950.2390.20279437789.52566145146.23362478.9405-1.9821.3205
450.3906-0.73480.32170.258527991686.77549786236.32393128.2961-3.41341.6693
460.4315-0.49740.34680.278418297889.752111002186.81363316.9544-2.75971.8251
470.4854-0.77120.39980.313233454952.036213808782.46653716.017-3.73162.0634
480.5562-0.67210.43010.334330375161.446615649491.2423955.9438-3.55572.2292
490.6494-0.40910.4280.334816901437.191415774685.8373971.7359-2.65232.2715
500.7731-0.47830.43260.339522420074.6616378812.09364047.0745-3.05482.3428
510.9404-0.59310.44590.349331750075.037617659750.67234202.3506-3.63532.4505



Parameters (Session):
par1 = 12 ;
Parameters (R input):
par1 = 12 ; par2 = -0.6 ; par3 = 2 ; par4 = 0 ; par5 = 1 ; par6 = 0 ; par7 = 2 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '0'
par8 <- '0'
par7 <- '2'
par6 <- '0'
par5 <- '1'
par4 <- '0'
par3 <- '0'
par2 <- '-0.6'
par1 <- '12'
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*2
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.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')