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 11:55:01 +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/t1482317718ihs9fx1ckzplmta.htm/, Retrieved Mon, 06 May 2024 15:29:44 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302153, Retrieved Mon, 06 May 2024 15:29:44 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact55
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecasting...] [2016-12-21 10:55:01] [fc6d28d208bad0c833791fcb11cb4db1] [Current]
Feedback Forum

Post a new message
Dataseries X:
1.894
1.757
3.582
5.321
5.561
5.907
4.944
4.966
3.258
1.964
1.743
1.262
2.086
1.793
3.548
5.672
6.084
4.914
4.990
5.139
3.218
2.179
2.238
1.442
2.205
2.025
3.531
4.977
7.998
4.880
5.231
5.202
3.303
2.683
2.202
1.376
2.422
1.997
3.163
5.964
5.657
6.415
6.208
4.500
2.939
2.702
2.090
1.504
2.549
1.931
3.013
6.204
5.788
5.611
5.594
4.647
3.490
2.487
1.992
1.507
2.306
2.002
3.075
5.331
5.589
5.813
4.876
4.665
3.601
2.192
2.111
1.580
2.288
1.993
3.228
5.000
5.480
5.770
4.962
4.685
3.607
2.222
2.467
1.594
2.228
1.910
3.157
4.809
6.249
4.607
4.975
4.784
3.028
2.461
2.218
1.351
2.070
1.887
3.024
4.596
6.398
4.459
5.382
4.359
2.687
2.249
2.154
1.169
2.429
1.762
2.846
5.627
5.749
4.502
5.720
4.403
2.867
2.635
2.059
1.511
2.359
1.741
2.917
6.249
5.760
6.250
5.134
4.831
3.695
2.462
2.146
1.579




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302153&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[120])
1192.059-------
1201.511-------
1212.3591.4310.88312.51650.04690.44260.44260.4426
1221.7411.23930.65832.70740.25150.06750.06750.3584
1232.9171.18190.50593.69920.08840.33170.33170.3989
1246.2491.1460.40455.25580.00750.19920.19920.4309
1255.761.10510.33537.2060.06740.04920.04920.4481
1266.251.10060.286210.94410.15260.17680.17680.4674
1275.1341.08560.248916.21620.30.25180.25180.478
1284.8311.08090.220425.19740.38030.37090.37090.4861
1293.6951.0790.197840.73030.44860.42640.42640.4915
1302.4621.07510.179367.75150.48370.46930.46930.4949
1312.1461.07530.164121.43580.4930.4910.4910.4972
1321.5791.07410.1511233.7640.49830.49640.49640.4985

\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[120]) \tabularnewline
119 & 2.059 & - & - & - & - & - & - & - \tabularnewline
120 & 1.511 & - & - & - & - & - & - & - \tabularnewline
121 & 2.359 & 1.431 & 0.8831 & 2.5165 & 0.0469 & 0.4426 & 0.4426 & 0.4426 \tabularnewline
122 & 1.741 & 1.2393 & 0.6583 & 2.7074 & 0.2515 & 0.0675 & 0.0675 & 0.3584 \tabularnewline
123 & 2.917 & 1.1819 & 0.5059 & 3.6992 & 0.0884 & 0.3317 & 0.3317 & 0.3989 \tabularnewline
124 & 6.249 & 1.146 & 0.4045 & 5.2558 & 0.0075 & 0.1992 & 0.1992 & 0.4309 \tabularnewline
125 & 5.76 & 1.1051 & 0.3353 & 7.206 & 0.0674 & 0.0492 & 0.0492 & 0.4481 \tabularnewline
126 & 6.25 & 1.1006 & 0.2862 & 10.9441 & 0.1526 & 0.1768 & 0.1768 & 0.4674 \tabularnewline
127 & 5.134 & 1.0856 & 0.2489 & 16.2162 & 0.3 & 0.2518 & 0.2518 & 0.478 \tabularnewline
128 & 4.831 & 1.0809 & 0.2204 & 25.1974 & 0.3803 & 0.3709 & 0.3709 & 0.4861 \tabularnewline
129 & 3.695 & 1.079 & 0.1978 & 40.7303 & 0.4486 & 0.4264 & 0.4264 & 0.4915 \tabularnewline
130 & 2.462 & 1.0751 & 0.1793 & 67.7515 & 0.4837 & 0.4693 & 0.4693 & 0.4949 \tabularnewline
131 & 2.146 & 1.0753 & 0.164 & 121.4358 & 0.493 & 0.491 & 0.491 & 0.4972 \tabularnewline
132 & 1.579 & 1.0741 & 0.1511 & 233.764 & 0.4983 & 0.4964 & 0.4964 & 0.4985 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302153&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[120])[/C][/ROW]
[ROW][C]119[/C][C]2.059[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]1.511[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]2.359[/C][C]1.431[/C][C]0.8831[/C][C]2.5165[/C][C]0.0469[/C][C]0.4426[/C][C]0.4426[/C][C]0.4426[/C][/ROW]
[ROW][C]122[/C][C]1.741[/C][C]1.2393[/C][C]0.6583[/C][C]2.7074[/C][C]0.2515[/C][C]0.0675[/C][C]0.0675[/C][C]0.3584[/C][/ROW]
[ROW][C]123[/C][C]2.917[/C][C]1.1819[/C][C]0.5059[/C][C]3.6992[/C][C]0.0884[/C][C]0.3317[/C][C]0.3317[/C][C]0.3989[/C][/ROW]
[ROW][C]124[/C][C]6.249[/C][C]1.146[/C][C]0.4045[/C][C]5.2558[/C][C]0.0075[/C][C]0.1992[/C][C]0.1992[/C][C]0.4309[/C][/ROW]
[ROW][C]125[/C][C]5.76[/C][C]1.1051[/C][C]0.3353[/C][C]7.206[/C][C]0.0674[/C][C]0.0492[/C][C]0.0492[/C][C]0.4481[/C][/ROW]
[ROW][C]126[/C][C]6.25[/C][C]1.1006[/C][C]0.2862[/C][C]10.9441[/C][C]0.1526[/C][C]0.1768[/C][C]0.1768[/C][C]0.4674[/C][/ROW]
[ROW][C]127[/C][C]5.134[/C][C]1.0856[/C][C]0.2489[/C][C]16.2162[/C][C]0.3[/C][C]0.2518[/C][C]0.2518[/C][C]0.478[/C][/ROW]
[ROW][C]128[/C][C]4.831[/C][C]1.0809[/C][C]0.2204[/C][C]25.1974[/C][C]0.3803[/C][C]0.3709[/C][C]0.3709[/C][C]0.4861[/C][/ROW]
[ROW][C]129[/C][C]3.695[/C][C]1.079[/C][C]0.1978[/C][C]40.7303[/C][C]0.4486[/C][C]0.4264[/C][C]0.4264[/C][C]0.4915[/C][/ROW]
[ROW][C]130[/C][C]2.462[/C][C]1.0751[/C][C]0.1793[/C][C]67.7515[/C][C]0.4837[/C][C]0.4693[/C][C]0.4693[/C][C]0.4949[/C][/ROW]
[ROW][C]131[/C][C]2.146[/C][C]1.0753[/C][C]0.164[/C][C]121.4358[/C][C]0.493[/C][C]0.491[/C][C]0.491[/C][C]0.4972[/C][/ROW]
[ROW][C]132[/C][C]1.579[/C][C]1.0741[/C][C]0.1511[/C][C]233.764[/C][C]0.4983[/C][C]0.4964[/C][C]0.4964[/C][C]0.4985[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302153&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302153&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[120])
1192.059-------
1201.511-------
1212.3591.4310.88312.51650.04690.44260.44260.4426
1221.7411.23930.65832.70740.25150.06750.06750.3584
1232.9171.18190.50593.69920.08840.33170.33170.3989
1246.2491.1460.40455.25580.00750.19920.19920.4309
1255.761.10510.33537.2060.06740.04920.04920.4481
1266.251.10060.286210.94410.15260.17680.17680.4674
1275.1341.08560.248916.21620.30.25180.25180.478
1284.8311.08090.220425.19740.38030.37090.37090.4861
1293.6951.0790.197840.73030.44860.42640.42640.4915
1302.4621.07510.179367.75150.48370.46930.46930.4949
1312.1461.07530.164121.43580.4930.4910.4910.4972
1321.5791.07410.1511233.7640.49830.49640.49640.4985







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1210.3870.39340.39340.48970.8612000.94730.9473
1220.60440.28820.34080.41320.25170.55650.7460.51220.7297
1231.08670.59480.42550.55773.01061.37451.17241.77121.0769
1241.82960.81660.52330.763326.04027.54092.74615.2092.1099
1252.81670.80810.58020.881921.668110.36643.21974.75172.6383
1264.5630.82390.62080.968426.51613.0583.61365.25643.0746
1277.11080.78850.64481.01616.389413.53393.67884.13253.2258
12811.38370.77630.66121.047614.063513.60013.68783.82813.301
12918.74880.7080.66641.0536.843412.84933.58462.67043.231
13031.64080.56330.65611.02611.923411.75673.42881.41573.0494
13157.10650.49890.64180.99321.146310.79223.28511.09292.8716
132110.52950.31980.6150.94220.25499.91413.14870.51542.6752

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
121 & 0.387 & 0.3934 & 0.3934 & 0.4897 & 0.8612 & 0 & 0 & 0.9473 & 0.9473 \tabularnewline
122 & 0.6044 & 0.2882 & 0.3408 & 0.4132 & 0.2517 & 0.5565 & 0.746 & 0.5122 & 0.7297 \tabularnewline
123 & 1.0867 & 0.5948 & 0.4255 & 0.5577 & 3.0106 & 1.3745 & 1.1724 & 1.7712 & 1.0769 \tabularnewline
124 & 1.8296 & 0.8166 & 0.5233 & 0.7633 & 26.0402 & 7.5409 & 2.7461 & 5.209 & 2.1099 \tabularnewline
125 & 2.8167 & 0.8081 & 0.5802 & 0.8819 & 21.6681 & 10.3664 & 3.2197 & 4.7517 & 2.6383 \tabularnewline
126 & 4.563 & 0.8239 & 0.6208 & 0.9684 & 26.516 & 13.058 & 3.6136 & 5.2564 & 3.0746 \tabularnewline
127 & 7.1108 & 0.7885 & 0.6448 & 1.016 & 16.3894 & 13.5339 & 3.6788 & 4.1325 & 3.2258 \tabularnewline
128 & 11.3837 & 0.7763 & 0.6612 & 1.0476 & 14.0635 & 13.6001 & 3.6878 & 3.8281 & 3.301 \tabularnewline
129 & 18.7488 & 0.708 & 0.6664 & 1.053 & 6.8434 & 12.8493 & 3.5846 & 2.6704 & 3.231 \tabularnewline
130 & 31.6408 & 0.5633 & 0.6561 & 1.0261 & 1.9234 & 11.7567 & 3.4288 & 1.4157 & 3.0494 \tabularnewline
131 & 57.1065 & 0.4989 & 0.6418 & 0.9932 & 1.1463 & 10.7922 & 3.2851 & 1.0929 & 2.8716 \tabularnewline
132 & 110.5295 & 0.3198 & 0.615 & 0.9422 & 0.2549 & 9.9141 & 3.1487 & 0.5154 & 2.6752 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302153&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]121[/C][C]0.387[/C][C]0.3934[/C][C]0.3934[/C][C]0.4897[/C][C]0.8612[/C][C]0[/C][C]0[/C][C]0.9473[/C][C]0.9473[/C][/ROW]
[ROW][C]122[/C][C]0.6044[/C][C]0.2882[/C][C]0.3408[/C][C]0.4132[/C][C]0.2517[/C][C]0.5565[/C][C]0.746[/C][C]0.5122[/C][C]0.7297[/C][/ROW]
[ROW][C]123[/C][C]1.0867[/C][C]0.5948[/C][C]0.4255[/C][C]0.5577[/C][C]3.0106[/C][C]1.3745[/C][C]1.1724[/C][C]1.7712[/C][C]1.0769[/C][/ROW]
[ROW][C]124[/C][C]1.8296[/C][C]0.8166[/C][C]0.5233[/C][C]0.7633[/C][C]26.0402[/C][C]7.5409[/C][C]2.7461[/C][C]5.209[/C][C]2.1099[/C][/ROW]
[ROW][C]125[/C][C]2.8167[/C][C]0.8081[/C][C]0.5802[/C][C]0.8819[/C][C]21.6681[/C][C]10.3664[/C][C]3.2197[/C][C]4.7517[/C][C]2.6383[/C][/ROW]
[ROW][C]126[/C][C]4.563[/C][C]0.8239[/C][C]0.6208[/C][C]0.9684[/C][C]26.516[/C][C]13.058[/C][C]3.6136[/C][C]5.2564[/C][C]3.0746[/C][/ROW]
[ROW][C]127[/C][C]7.1108[/C][C]0.7885[/C][C]0.6448[/C][C]1.016[/C][C]16.3894[/C][C]13.5339[/C][C]3.6788[/C][C]4.1325[/C][C]3.2258[/C][/ROW]
[ROW][C]128[/C][C]11.3837[/C][C]0.7763[/C][C]0.6612[/C][C]1.0476[/C][C]14.0635[/C][C]13.6001[/C][C]3.6878[/C][C]3.8281[/C][C]3.301[/C][/ROW]
[ROW][C]129[/C][C]18.7488[/C][C]0.708[/C][C]0.6664[/C][C]1.053[/C][C]6.8434[/C][C]12.8493[/C][C]3.5846[/C][C]2.6704[/C][C]3.231[/C][/ROW]
[ROW][C]130[/C][C]31.6408[/C][C]0.5633[/C][C]0.6561[/C][C]1.0261[/C][C]1.9234[/C][C]11.7567[/C][C]3.4288[/C][C]1.4157[/C][C]3.0494[/C][/ROW]
[ROW][C]131[/C][C]57.1065[/C][C]0.4989[/C][C]0.6418[/C][C]0.9932[/C][C]1.1463[/C][C]10.7922[/C][C]3.2851[/C][C]1.0929[/C][C]2.8716[/C][/ROW]
[ROW][C]132[/C][C]110.5295[/C][C]0.3198[/C][C]0.615[/C][C]0.9422[/C][C]0.2549[/C][C]9.9141[/C][C]3.1487[/C][C]0.5154[/C][C]2.6752[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302153&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302153&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
1210.3870.39340.39340.48970.8612000.94730.9473
1220.60440.28820.34080.41320.25170.55650.7460.51220.7297
1231.08670.59480.42550.55773.01061.37451.17241.77121.0769
1241.82960.81660.52330.763326.04027.54092.74615.2092.1099
1252.81670.80810.58020.881921.668110.36643.21974.75172.6383
1264.5630.82390.62080.968426.51613.0583.61365.25643.0746
1277.11080.78850.64481.01616.389413.53393.67884.13253.2258
12811.38370.77630.66121.047614.063513.60013.68783.82813.301
12918.74880.7080.66641.0536.843412.84933.58462.67043.231
13031.64080.56330.65611.02611.923411.75673.42881.41573.0494
13157.10650.49890.64180.99321.146310.79223.28511.09292.8716
132110.52950.31980.6150.94220.25499.91413.14870.51542.6752



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