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, 15 Dec 2016 23:31:49 +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/15/t148184140138v3ygs13tap2gj.htm/, Retrieved Fri, 03 May 2024 14:40:10 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300039, Retrieved Fri, 03 May 2024 14:40:10 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact78
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [arima forecast N2142] [2016-12-15 22:31:49] [31f526a885cd288e1bc58dc4a6a7fb1f] [Current]
Feedback Forum

Post a new message
Dataseries X:
4926
5242
5650
5042
4738
4178
3688
3870
3822
3872
3216
3366
4034
4514
5286
4940
5112
5188
4588
4754
4898
5422
5458
5088
5676
6518
6768
6306
6296
5728
5604
4956
4744
5160
3782
4114
5488
5874
6812
6658
6236
5542
5468
5738
5828
6168
5324
5038
5662
5868
6008
6206
5880
5594
5216
5522
5748
5966
5600
5546
5798
6218
7020
6684
6386
6680
6332
7128
7592
8468
7892
7866
8270
7536
7990
7638
8040
7564
7234
7718
7722
7966
7412
6792
7316
7424
7910
7574
7414
7292
6432
6630
6594
7318
6634
6032
6460
6446
6890
6638
6872
7516
6474
6812
6532
6908
6502
5656
5948
5608
7062
6074
5998
5944
5914
6286
6340
6666
6090
6264
7052
6666
5060
6818
6830
6986




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=300039&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=300039&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300039&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[114])
1135998-------
1145944-------
11559146021.65175052.10416991.19930.41390.56240.56240.5624
11662866078.12534810.92737345.32340.37390.60020.60020.5822
11763406119.19684669.45877568.93480.38270.41080.41080.5936
11866666149.06674571.13697726.99650.26040.40630.40630.6005
11960906170.79014495.12437846.45590.46240.28120.28120.6046
12062646186.58894431.81467941.36320.46550.5430.5430.6068
12170526198.07884376.25938019.89830.17910.47170.47170.6077
12266666206.43514325.72328087.1470.3160.18910.18910.6078
12350606212.51234278.61368146.41110.12140.32290.32290.6072
12468186216.93214233.9638199.90120.27620.87360.87360.6063
12568306220.14654191.16168249.13130.27790.28180.28180.6052
12669866222.48424149.81238295.1560.23510.28280.28280.6039

\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[114]) \tabularnewline
113 & 5998 & - & - & - & - & - & - & - \tabularnewline
114 & 5944 & - & - & - & - & - & - & - \tabularnewline
115 & 5914 & 6021.6517 & 5052.1041 & 6991.1993 & 0.4139 & 0.5624 & 0.5624 & 0.5624 \tabularnewline
116 & 6286 & 6078.1253 & 4810.9273 & 7345.3234 & 0.3739 & 0.6002 & 0.6002 & 0.5822 \tabularnewline
117 & 6340 & 6119.1968 & 4669.4587 & 7568.9348 & 0.3827 & 0.4108 & 0.4108 & 0.5936 \tabularnewline
118 & 6666 & 6149.0667 & 4571.1369 & 7726.9965 & 0.2604 & 0.4063 & 0.4063 & 0.6005 \tabularnewline
119 & 6090 & 6170.7901 & 4495.1243 & 7846.4559 & 0.4624 & 0.2812 & 0.2812 & 0.6046 \tabularnewline
120 & 6264 & 6186.5889 & 4431.8146 & 7941.3632 & 0.4655 & 0.543 & 0.543 & 0.6068 \tabularnewline
121 & 7052 & 6198.0788 & 4376.2593 & 8019.8983 & 0.1791 & 0.4717 & 0.4717 & 0.6077 \tabularnewline
122 & 6666 & 6206.4351 & 4325.7232 & 8087.147 & 0.316 & 0.1891 & 0.1891 & 0.6078 \tabularnewline
123 & 5060 & 6212.5123 & 4278.6136 & 8146.4111 & 0.1214 & 0.3229 & 0.3229 & 0.6072 \tabularnewline
124 & 6818 & 6216.9321 & 4233.963 & 8199.9012 & 0.2762 & 0.8736 & 0.8736 & 0.6063 \tabularnewline
125 & 6830 & 6220.1465 & 4191.1616 & 8249.1313 & 0.2779 & 0.2818 & 0.2818 & 0.6052 \tabularnewline
126 & 6986 & 6222.4842 & 4149.8123 & 8295.156 & 0.2351 & 0.2828 & 0.2828 & 0.6039 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300039&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[114])[/C][/ROW]
[ROW][C]113[/C][C]5998[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]5944[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]5914[/C][C]6021.6517[/C][C]5052.1041[/C][C]6991.1993[/C][C]0.4139[/C][C]0.5624[/C][C]0.5624[/C][C]0.5624[/C][/ROW]
[ROW][C]116[/C][C]6286[/C][C]6078.1253[/C][C]4810.9273[/C][C]7345.3234[/C][C]0.3739[/C][C]0.6002[/C][C]0.6002[/C][C]0.5822[/C][/ROW]
[ROW][C]117[/C][C]6340[/C][C]6119.1968[/C][C]4669.4587[/C][C]7568.9348[/C][C]0.3827[/C][C]0.4108[/C][C]0.4108[/C][C]0.5936[/C][/ROW]
[ROW][C]118[/C][C]6666[/C][C]6149.0667[/C][C]4571.1369[/C][C]7726.9965[/C][C]0.2604[/C][C]0.4063[/C][C]0.4063[/C][C]0.6005[/C][/ROW]
[ROW][C]119[/C][C]6090[/C][C]6170.7901[/C][C]4495.1243[/C][C]7846.4559[/C][C]0.4624[/C][C]0.2812[/C][C]0.2812[/C][C]0.6046[/C][/ROW]
[ROW][C]120[/C][C]6264[/C][C]6186.5889[/C][C]4431.8146[/C][C]7941.3632[/C][C]0.4655[/C][C]0.543[/C][C]0.543[/C][C]0.6068[/C][/ROW]
[ROW][C]121[/C][C]7052[/C][C]6198.0788[/C][C]4376.2593[/C][C]8019.8983[/C][C]0.1791[/C][C]0.4717[/C][C]0.4717[/C][C]0.6077[/C][/ROW]
[ROW][C]122[/C][C]6666[/C][C]6206.4351[/C][C]4325.7232[/C][C]8087.147[/C][C]0.316[/C][C]0.1891[/C][C]0.1891[/C][C]0.6078[/C][/ROW]
[ROW][C]123[/C][C]5060[/C][C]6212.5123[/C][C]4278.6136[/C][C]8146.4111[/C][C]0.1214[/C][C]0.3229[/C][C]0.3229[/C][C]0.6072[/C][/ROW]
[ROW][C]124[/C][C]6818[/C][C]6216.9321[/C][C]4233.963[/C][C]8199.9012[/C][C]0.2762[/C][C]0.8736[/C][C]0.8736[/C][C]0.6063[/C][/ROW]
[ROW][C]125[/C][C]6830[/C][C]6220.1465[/C][C]4191.1616[/C][C]8249.1313[/C][C]0.2779[/C][C]0.2818[/C][C]0.2818[/C][C]0.6052[/C][/ROW]
[ROW][C]126[/C][C]6986[/C][C]6222.4842[/C][C]4149.8123[/C][C]8295.156[/C][C]0.2351[/C][C]0.2828[/C][C]0.2828[/C][C]0.6039[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300039&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300039&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[114])
1135998-------
1145944-------
11559146021.65175052.10416991.19930.41390.56240.56240.5624
11662866078.12534810.92737345.32340.37390.60020.60020.5822
11763406119.19684669.45877568.93480.38270.41080.41080.5936
11866666149.06674571.13697726.99650.26040.40630.40630.6005
11960906170.79014495.12437846.45590.46240.28120.28120.6046
12062646186.58894431.81467941.36320.46550.5430.5430.6068
12170526198.07884376.25938019.89830.17910.47170.47170.6077
12266666206.43514325.72328087.1470.3160.18910.18910.6078
12350606212.51234278.61368146.41110.12140.32290.32290.6072
12468186216.93214233.9638199.90120.27620.87360.87360.6063
12568306220.14654191.16168249.13130.27790.28180.28180.6052
12669866222.48424149.81238295.1560.23510.28280.28280.6039







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.0821-0.01820.01820.01811588.895600-0.19070.1907
1160.10640.03310.02560.025843211.875327400.3855165.53060.36830.2795
1170.12090.03480.02870.02948754.06634518.279185.7910.39120.3168
1180.13090.07750.04090.0419267220.03592693.718304.45640.9160.4666
1190.1385-0.01330.03540.03626527.046775460.3837274.7005-0.14320.4019
1200.14470.01240.03150.03225992.478863882.3996252.74970.13720.3578
1210.150.12110.04430.046729181.3743158925.1103398.65411.51310.5228
1220.15460.06890.04740.0492211199.9173165459.4611406.76710.81430.5592
1230.1588-0.22780.06750.06651328284.6308294662.2578542.828-2.04210.724
1240.16270.08820.06950.069361282.6331301324.2953548.93011.0650.7581
1250.16640.08930.07130.0713371921.3515307742.2095554.74521.08060.7874
1260.16990.10930.07450.075582956.4498330676.7295575.0451.35290.8346

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
115 & 0.0821 & -0.0182 & 0.0182 & 0.018 & 11588.8956 & 0 & 0 & -0.1907 & 0.1907 \tabularnewline
116 & 0.1064 & 0.0331 & 0.0256 & 0.0258 & 43211.8753 & 27400.3855 & 165.5306 & 0.3683 & 0.2795 \tabularnewline
117 & 0.1209 & 0.0348 & 0.0287 & 0.029 & 48754.066 & 34518.279 & 185.791 & 0.3912 & 0.3168 \tabularnewline
118 & 0.1309 & 0.0775 & 0.0409 & 0.0419 & 267220.035 & 92693.718 & 304.4564 & 0.916 & 0.4666 \tabularnewline
119 & 0.1385 & -0.0133 & 0.0354 & 0.0362 & 6527.0467 & 75460.3837 & 274.7005 & -0.1432 & 0.4019 \tabularnewline
120 & 0.1447 & 0.0124 & 0.0315 & 0.0322 & 5992.4788 & 63882.3996 & 252.7497 & 0.1372 & 0.3578 \tabularnewline
121 & 0.15 & 0.1211 & 0.0443 & 0.046 & 729181.3743 & 158925.1103 & 398.6541 & 1.5131 & 0.5228 \tabularnewline
122 & 0.1546 & 0.0689 & 0.0474 & 0.0492 & 211199.9173 & 165459.4611 & 406.7671 & 0.8143 & 0.5592 \tabularnewline
123 & 0.1588 & -0.2278 & 0.0675 & 0.0665 & 1328284.6308 & 294662.2578 & 542.828 & -2.0421 & 0.724 \tabularnewline
124 & 0.1627 & 0.0882 & 0.0695 & 0.069 & 361282.6331 & 301324.2953 & 548.9301 & 1.065 & 0.7581 \tabularnewline
125 & 0.1664 & 0.0893 & 0.0713 & 0.0713 & 371921.3515 & 307742.2095 & 554.7452 & 1.0806 & 0.7874 \tabularnewline
126 & 0.1699 & 0.1093 & 0.0745 & 0.075 & 582956.4498 & 330676.7295 & 575.045 & 1.3529 & 0.8346 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300039&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]115[/C][C]0.0821[/C][C]-0.0182[/C][C]0.0182[/C][C]0.018[/C][C]11588.8956[/C][C]0[/C][C]0[/C][C]-0.1907[/C][C]0.1907[/C][/ROW]
[ROW][C]116[/C][C]0.1064[/C][C]0.0331[/C][C]0.0256[/C][C]0.0258[/C][C]43211.8753[/C][C]27400.3855[/C][C]165.5306[/C][C]0.3683[/C][C]0.2795[/C][/ROW]
[ROW][C]117[/C][C]0.1209[/C][C]0.0348[/C][C]0.0287[/C][C]0.029[/C][C]48754.066[/C][C]34518.279[/C][C]185.791[/C][C]0.3912[/C][C]0.3168[/C][/ROW]
[ROW][C]118[/C][C]0.1309[/C][C]0.0775[/C][C]0.0409[/C][C]0.0419[/C][C]267220.035[/C][C]92693.718[/C][C]304.4564[/C][C]0.916[/C][C]0.4666[/C][/ROW]
[ROW][C]119[/C][C]0.1385[/C][C]-0.0133[/C][C]0.0354[/C][C]0.0362[/C][C]6527.0467[/C][C]75460.3837[/C][C]274.7005[/C][C]-0.1432[/C][C]0.4019[/C][/ROW]
[ROW][C]120[/C][C]0.1447[/C][C]0.0124[/C][C]0.0315[/C][C]0.0322[/C][C]5992.4788[/C][C]63882.3996[/C][C]252.7497[/C][C]0.1372[/C][C]0.3578[/C][/ROW]
[ROW][C]121[/C][C]0.15[/C][C]0.1211[/C][C]0.0443[/C][C]0.046[/C][C]729181.3743[/C][C]158925.1103[/C][C]398.6541[/C][C]1.5131[/C][C]0.5228[/C][/ROW]
[ROW][C]122[/C][C]0.1546[/C][C]0.0689[/C][C]0.0474[/C][C]0.0492[/C][C]211199.9173[/C][C]165459.4611[/C][C]406.7671[/C][C]0.8143[/C][C]0.5592[/C][/ROW]
[ROW][C]123[/C][C]0.1588[/C][C]-0.2278[/C][C]0.0675[/C][C]0.0665[/C][C]1328284.6308[/C][C]294662.2578[/C][C]542.828[/C][C]-2.0421[/C][C]0.724[/C][/ROW]
[ROW][C]124[/C][C]0.1627[/C][C]0.0882[/C][C]0.0695[/C][C]0.069[/C][C]361282.6331[/C][C]301324.2953[/C][C]548.9301[/C][C]1.065[/C][C]0.7581[/C][/ROW]
[ROW][C]125[/C][C]0.1664[/C][C]0.0893[/C][C]0.0713[/C][C]0.0713[/C][C]371921.3515[/C][C]307742.2095[/C][C]554.7452[/C][C]1.0806[/C][C]0.7874[/C][/ROW]
[ROW][C]126[/C][C]0.1699[/C][C]0.1093[/C][C]0.0745[/C][C]0.075[/C][C]582956.4498[/C][C]330676.7295[/C][C]575.045[/C][C]1.3529[/C][C]0.8346[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300039&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300039&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
1150.0821-0.01820.01820.01811588.895600-0.19070.1907
1160.10640.03310.02560.025843211.875327400.3855165.53060.36830.2795
1170.12090.03480.02870.02948754.06634518.279185.7910.39120.3168
1180.13090.07750.04090.0419267220.03592693.718304.45640.9160.4666
1190.1385-0.01330.03540.03626527.046775460.3837274.7005-0.14320.4019
1200.14470.01240.03150.03225992.478863882.3996252.74970.13720.3578
1210.150.12110.04430.046729181.3743158925.1103398.65411.51310.5228
1220.15460.06890.04740.0492211199.9173165459.4611406.76710.81430.5592
1230.1588-0.22780.06750.06651328284.6308294662.2578542.828-2.04210.724
1240.16270.08820.06950.069361282.6331301324.2953548.93011.0650.7581
1250.16640.08930.07130.0713371921.3515307742.2095554.74521.08060.7874
1260.16990.10930.07450.075582956.4498330676.7295575.0451.35290.8346



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