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 computationWed, 21 Dec 2016 17:18:25 +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/21/t14823372331asu464ji1tlonk.htm/, Retrieved Mon, 06 May 2024 22:14:25 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302415, Retrieved Mon, 06 May 2024 22:14:25 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact75
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2016-12-21 16:18:25] [361c8dad91b3f1ef2e651cd04783c23b] [Current]
Feedback Forum

Post a new message
Dataseries X:
5300
3800
3900
5400
6100
4200
4000
4600
7300
4400
4000
5300
9300
4300
3400
6000
6500
3400
2900
5000
5800
3000
2300
4000
5800
2900
2200
3900
5300
3000
2000
3700
6000
2800
1800
3900
5400
2400
1700
3500
5400
3900
2900
4600
5400
2900
2700
4500
6300
2800
1900
5100
6200
3500
3500
6000
6000
3400
2800
4900




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302415&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[48])
444600-------
455400-------
462900-------
472700-------
484500-------
4963005889.0434630.25987175.51040.26560.98280.77190.9828
5028003253.79551987.78094572.33310.2500.70050.032
5119002723.62231455.79044055.64690.11280.45530.51390.0045
5251004407.62092939.91235926.77830.18580.99940.45260.4526
5362005988.64774373.55447649.00960.40150.85290.35660.9606
5435003293.94841751.96244914.50780.40162e-040.72490.0723
5535002715.57051168.73764361.42020.17510.17510.83430.0168
5660004442.512750.97936202.5780.04140.8530.2320.4745
5760006018.22764217.68817875.07540.49230.50770.42390.9455
5834003305.23851604.25995102.82490.45890.00170.41590.0963
5928002734.40021055.52914531.010.47150.23390.20180.027
6049004462.01292646.46846356.66950.32520.95720.05580.4843

\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
44 & 4600 & - & - & - & - & - & - & - \tabularnewline
45 & 5400 & - & - & - & - & - & - & - \tabularnewline
46 & 2900 & - & - & - & - & - & - & - \tabularnewline
47 & 2700 & - & - & - & - & - & - & - \tabularnewline
48 & 4500 & - & - & - & - & - & - & - \tabularnewline
49 & 6300 & 5889.043 & 4630.2598 & 7175.5104 & 0.2656 & 0.9828 & 0.7719 & 0.9828 \tabularnewline
50 & 2800 & 3253.7955 & 1987.7809 & 4572.3331 & 0.25 & 0 & 0.7005 & 0.032 \tabularnewline
51 & 1900 & 2723.6223 & 1455.7904 & 4055.6469 & 0.1128 & 0.4553 & 0.5139 & 0.0045 \tabularnewline
52 & 5100 & 4407.6209 & 2939.9123 & 5926.7783 & 0.1858 & 0.9994 & 0.4526 & 0.4526 \tabularnewline
53 & 6200 & 5988.6477 & 4373.5544 & 7649.0096 & 0.4015 & 0.8529 & 0.3566 & 0.9606 \tabularnewline
54 & 3500 & 3293.9484 & 1751.9624 & 4914.5078 & 0.4016 & 2e-04 & 0.7249 & 0.0723 \tabularnewline
55 & 3500 & 2715.5705 & 1168.7376 & 4361.4202 & 0.1751 & 0.1751 & 0.8343 & 0.0168 \tabularnewline
56 & 6000 & 4442.51 & 2750.9793 & 6202.578 & 0.0414 & 0.853 & 0.232 & 0.4745 \tabularnewline
57 & 6000 & 6018.2276 & 4217.6881 & 7875.0754 & 0.4923 & 0.5077 & 0.4239 & 0.9455 \tabularnewline
58 & 3400 & 3305.2385 & 1604.2599 & 5102.8249 & 0.4589 & 0.0017 & 0.4159 & 0.0963 \tabularnewline
59 & 2800 & 2734.4002 & 1055.5291 & 4531.01 & 0.4715 & 0.2339 & 0.2018 & 0.027 \tabularnewline
60 & 4900 & 4462.0129 & 2646.4684 & 6356.6695 & 0.3252 & 0.9572 & 0.0558 & 0.4843 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302415&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]44[/C][C]4600[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]5400[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]2900[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]2700[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]4500[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]6300[/C][C]5889.043[/C][C]4630.2598[/C][C]7175.5104[/C][C]0.2656[/C][C]0.9828[/C][C]0.7719[/C][C]0.9828[/C][/ROW]
[ROW][C]50[/C][C]2800[/C][C]3253.7955[/C][C]1987.7809[/C][C]4572.3331[/C][C]0.25[/C][C]0[/C][C]0.7005[/C][C]0.032[/C][/ROW]
[ROW][C]51[/C][C]1900[/C][C]2723.6223[/C][C]1455.7904[/C][C]4055.6469[/C][C]0.1128[/C][C]0.4553[/C][C]0.5139[/C][C]0.0045[/C][/ROW]
[ROW][C]52[/C][C]5100[/C][C]4407.6209[/C][C]2939.9123[/C][C]5926.7783[/C][C]0.1858[/C][C]0.9994[/C][C]0.4526[/C][C]0.4526[/C][/ROW]
[ROW][C]53[/C][C]6200[/C][C]5988.6477[/C][C]4373.5544[/C][C]7649.0096[/C][C]0.4015[/C][C]0.8529[/C][C]0.3566[/C][C]0.9606[/C][/ROW]
[ROW][C]54[/C][C]3500[/C][C]3293.9484[/C][C]1751.9624[/C][C]4914.5078[/C][C]0.4016[/C][C]2e-04[/C][C]0.7249[/C][C]0.0723[/C][/ROW]
[ROW][C]55[/C][C]3500[/C][C]2715.5705[/C][C]1168.7376[/C][C]4361.4202[/C][C]0.1751[/C][C]0.1751[/C][C]0.8343[/C][C]0.0168[/C][/ROW]
[ROW][C]56[/C][C]6000[/C][C]4442.51[/C][C]2750.9793[/C][C]6202.578[/C][C]0.0414[/C][C]0.853[/C][C]0.232[/C][C]0.4745[/C][/ROW]
[ROW][C]57[/C][C]6000[/C][C]6018.2276[/C][C]4217.6881[/C][C]7875.0754[/C][C]0.4923[/C][C]0.5077[/C][C]0.4239[/C][C]0.9455[/C][/ROW]
[ROW][C]58[/C][C]3400[/C][C]3305.2385[/C][C]1604.2599[/C][C]5102.8249[/C][C]0.4589[/C][C]0.0017[/C][C]0.4159[/C][C]0.0963[/C][/ROW]
[ROW][C]59[/C][C]2800[/C][C]2734.4002[/C][C]1055.5291[/C][C]4531.01[/C][C]0.4715[/C][C]0.2339[/C][C]0.2018[/C][C]0.027[/C][/ROW]
[ROW][C]60[/C][C]4900[/C][C]4462.0129[/C][C]2646.4684[/C][C]6356.6695[/C][C]0.3252[/C][C]0.9572[/C][C]0.0558[/C][C]0.4843[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302415&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302415&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])
444600-------
455400-------
462900-------
472700-------
484500-------
4963005889.0434630.25987175.51040.26560.98280.77190.9828
5028003253.79551987.78094572.33310.2500.70050.032
5119002723.62231455.79044055.64690.11280.45530.51390.0045
5251004407.62092939.91235926.77830.18580.99940.45260.4526
5362005988.64774373.55447649.00960.40150.85290.35660.9606
5435003293.94841751.96244914.50780.40162e-040.72490.0723
5535002715.57051168.73764361.42020.17510.17510.83430.0168
5660004442.512750.97936202.5780.04140.8530.2320.4745
5760006018.22764217.68817875.07540.49230.50770.42390.9455
5834003305.23851604.25995102.82490.45890.00170.41590.0963
5928002734.40021055.52914531.010.47150.23390.20180.027
6049004462.01292646.46846356.66950.32520.95720.05580.4843







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
490.11150.06520.06520.0674168885.6642000.23540.2354
500.2068-0.16210.11370.1087205930.3999187408.032432.9065-0.260.2477
510.2495-0.43350.22030.1912678353.6513351056.5718592.5003-0.47190.3224
520.17590.13580.19910.1798479388.8001383139.6289618.98270.39670.341
530.14150.03410.16610.150844669.7828315445.6597561.64550.12110.297
540.2510.05890.14830.135842457.2639269947.5937519.56480.11810.2672
550.30920.22410.15910.1524615329.6461319287.8869565.05560.44940.2932
560.20210.25960.17170.17072425775.121582598.7911763.28160.89230.3681
570.1574-0.0030.15290.152332.2444517902.5082719.6544-0.01040.3284
580.27750.02790.14040.13978979.7507467010.2324683.38150.05430.301
590.33520.02340.12980.12914303.3339424945.9689651.87880.03760.277
600.21660.08940.12640.1262191832.6994405519.8631636.80440.25090.2748

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
49 & 0.1115 & 0.0652 & 0.0652 & 0.0674 & 168885.6642 & 0 & 0 & 0.2354 & 0.2354 \tabularnewline
50 & 0.2068 & -0.1621 & 0.1137 & 0.1087 & 205930.3999 & 187408.032 & 432.9065 & -0.26 & 0.2477 \tabularnewline
51 & 0.2495 & -0.4335 & 0.2203 & 0.1912 & 678353.6513 & 351056.5718 & 592.5003 & -0.4719 & 0.3224 \tabularnewline
52 & 0.1759 & 0.1358 & 0.1991 & 0.1798 & 479388.8001 & 383139.6289 & 618.9827 & 0.3967 & 0.341 \tabularnewline
53 & 0.1415 & 0.0341 & 0.1661 & 0.1508 & 44669.7828 & 315445.6597 & 561.6455 & 0.1211 & 0.297 \tabularnewline
54 & 0.251 & 0.0589 & 0.1483 & 0.1358 & 42457.2639 & 269947.5937 & 519.5648 & 0.1181 & 0.2672 \tabularnewline
55 & 0.3092 & 0.2241 & 0.1591 & 0.1524 & 615329.6461 & 319287.8869 & 565.0556 & 0.4494 & 0.2932 \tabularnewline
56 & 0.2021 & 0.2596 & 0.1717 & 0.1707 & 2425775.121 & 582598.7911 & 763.2816 & 0.8923 & 0.3681 \tabularnewline
57 & 0.1574 & -0.003 & 0.1529 & 0.152 & 332.2444 & 517902.5082 & 719.6544 & -0.0104 & 0.3284 \tabularnewline
58 & 0.2775 & 0.0279 & 0.1404 & 0.1397 & 8979.7507 & 467010.2324 & 683.3815 & 0.0543 & 0.301 \tabularnewline
59 & 0.3352 & 0.0234 & 0.1298 & 0.1291 & 4303.3339 & 424945.9689 & 651.8788 & 0.0376 & 0.277 \tabularnewline
60 & 0.2166 & 0.0894 & 0.1264 & 0.1262 & 191832.6994 & 405519.8631 & 636.8044 & 0.2509 & 0.2748 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302415&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]49[/C][C]0.1115[/C][C]0.0652[/C][C]0.0652[/C][C]0.0674[/C][C]168885.6642[/C][C]0[/C][C]0[/C][C]0.2354[/C][C]0.2354[/C][/ROW]
[ROW][C]50[/C][C]0.2068[/C][C]-0.1621[/C][C]0.1137[/C][C]0.1087[/C][C]205930.3999[/C][C]187408.032[/C][C]432.9065[/C][C]-0.26[/C][C]0.2477[/C][/ROW]
[ROW][C]51[/C][C]0.2495[/C][C]-0.4335[/C][C]0.2203[/C][C]0.1912[/C][C]678353.6513[/C][C]351056.5718[/C][C]592.5003[/C][C]-0.4719[/C][C]0.3224[/C][/ROW]
[ROW][C]52[/C][C]0.1759[/C][C]0.1358[/C][C]0.1991[/C][C]0.1798[/C][C]479388.8001[/C][C]383139.6289[/C][C]618.9827[/C][C]0.3967[/C][C]0.341[/C][/ROW]
[ROW][C]53[/C][C]0.1415[/C][C]0.0341[/C][C]0.1661[/C][C]0.1508[/C][C]44669.7828[/C][C]315445.6597[/C][C]561.6455[/C][C]0.1211[/C][C]0.297[/C][/ROW]
[ROW][C]54[/C][C]0.251[/C][C]0.0589[/C][C]0.1483[/C][C]0.1358[/C][C]42457.2639[/C][C]269947.5937[/C][C]519.5648[/C][C]0.1181[/C][C]0.2672[/C][/ROW]
[ROW][C]55[/C][C]0.3092[/C][C]0.2241[/C][C]0.1591[/C][C]0.1524[/C][C]615329.6461[/C][C]319287.8869[/C][C]565.0556[/C][C]0.4494[/C][C]0.2932[/C][/ROW]
[ROW][C]56[/C][C]0.2021[/C][C]0.2596[/C][C]0.1717[/C][C]0.1707[/C][C]2425775.121[/C][C]582598.7911[/C][C]763.2816[/C][C]0.8923[/C][C]0.3681[/C][/ROW]
[ROW][C]57[/C][C]0.1574[/C][C]-0.003[/C][C]0.1529[/C][C]0.152[/C][C]332.2444[/C][C]517902.5082[/C][C]719.6544[/C][C]-0.0104[/C][C]0.3284[/C][/ROW]
[ROW][C]58[/C][C]0.2775[/C][C]0.0279[/C][C]0.1404[/C][C]0.1397[/C][C]8979.7507[/C][C]467010.2324[/C][C]683.3815[/C][C]0.0543[/C][C]0.301[/C][/ROW]
[ROW][C]59[/C][C]0.3352[/C][C]0.0234[/C][C]0.1298[/C][C]0.1291[/C][C]4303.3339[/C][C]424945.9689[/C][C]651.8788[/C][C]0.0376[/C][C]0.277[/C][/ROW]
[ROW][C]60[/C][C]0.2166[/C][C]0.0894[/C][C]0.1264[/C][C]0.1262[/C][C]191832.6994[/C][C]405519.8631[/C][C]636.8044[/C][C]0.2509[/C][C]0.2748[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302415&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302415&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
490.11150.06520.06520.0674168885.6642000.23540.2354
500.2068-0.16210.11370.1087205930.3999187408.032432.9065-0.260.2477
510.2495-0.43350.22030.1912678353.6513351056.5718592.5003-0.47190.3224
520.17590.13580.19910.1798479388.8001383139.6289618.98270.39670.341
530.14150.03410.16610.150844669.7828315445.6597561.64550.12110.297
540.2510.05890.14830.135842457.2639269947.5937519.56480.11810.2672
550.30920.22410.15910.1524615329.6461319287.8869565.05560.44940.2932
560.20210.25960.17170.17072425775.121582598.7911763.28160.89230.3681
570.1574-0.0030.15290.152332.2444517902.5082719.6544-0.01040.3284
580.27750.02790.14040.13978979.7507467010.2324683.38150.05430.301
590.33520.02340.12980.12914303.3339424945.9689651.87880.03760.277
600.21660.08940.12640.1262191832.6994405519.8631636.80440.25090.2748



Parameters (Session):
par1 = Default ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = White Noise ; par7 = 0.95 ;
Parameters (R input):
par1 = 12 ; par2 = 0.9 ; par3 = 0 ; par4 = 1 ; par5 = 4 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 1 ; 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')