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

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

Post a new message
Dataseries X:
5033
4509.5
3970
3378
2866
2315.5
1895
8401.5
8040
7534
7135.5
6466.5
5661.5
4896
4064.5
3296
2593.5
2007
1513.5
6645
6221.5
5474
5135.5
4630.5
4164
3600.5
2969
2503.5
2054.5
1608.5
1297.5
8485
8163.5
7814
7453.5
6888.5
6283.5
5712
5030
4488
4058.5
3585
3199.5
8181
8219.5
7865.5
7516.5
7116
6615.5
6216.5
5699.5
5179
4727.5
4224.5
3780.5
7023.5
6558
6257.5
5862.5
5343
4756
4173.5
3451.5
2849
2351
1887.5
1416.5
7399
7013
6644.5
6238.5
5721
5137.5
4357
3750.5
3324
2861
2455.5
2027.5
8388.5
7910
7686
7163
6841.5
6448.5
6060.5
5739
5362.5
5081
4764
4522.5
9056.5
8352
7683
7319.5
6708
6204.5
5576.5
4776.5
4279.5
3918
3288.5
2393.5
8131.5
8121
7790.5
7411.5
6861
6197
5622.5
4855.5
4303.5
3853.5
3283.5
2861.5
9486.5
9061
8877.5
8557.5
8031
7404.5
6852.5
6174.5
5341.5
4975.5
4290




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299470&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])
1023288.5-------
1032393.5-------
1048131.5-------
1058121-------
1067790.5-------
1077411.5-------
1086861-------
1096197-------
1105622.5-------
1114855.5-------
1124303.5-------
1133853.5-------
1143283.5-------
1152861.52648.30481676.95593619.65370.33350.10.69640.1
1169486.57899.82386475.40859324.23910.014510.37491
11790617608.91035844.14439373.67630.05340.01850.28481
1188877.57141.6385092.28719190.9890.04840.03320.26740.9999
1198557.56768.90094469.92739067.87440.06360.03610.29190.9985
12080316193.75363669.72518717.7820.07680.03320.30220.9881
1217404.55594.60422864.00738325.20120.09690.04020.33270.9514
1226852.54998.48742075.88587921.08890.10690.05330.33780.875
1236174.54218.15361115.40647320.90080.10830.0480.34360.7225
1245341.53688.3765415.3846961.36910.16110.06830.35630.5958
1254975.53274.1353-160.67486708.94540.16580.11910.37050.4979
12642902680.0941-909.24586269.4340.18970.1050.37090.3709

\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
102 & 3288.5 & - & - & - & - & - & - & - \tabularnewline
103 & 2393.5 & - & - & - & - & - & - & - \tabularnewline
104 & 8131.5 & - & - & - & - & - & - & - \tabularnewline
105 & 8121 & - & - & - & - & - & - & - \tabularnewline
106 & 7790.5 & - & - & - & - & - & - & - \tabularnewline
107 & 7411.5 & - & - & - & - & - & - & - \tabularnewline
108 & 6861 & - & - & - & - & - & - & - \tabularnewline
109 & 6197 & - & - & - & - & - & - & - \tabularnewline
110 & 5622.5 & - & - & - & - & - & - & - \tabularnewline
111 & 4855.5 & - & - & - & - & - & - & - \tabularnewline
112 & 4303.5 & - & - & - & - & - & - & - \tabularnewline
113 & 3853.5 & - & - & - & - & - & - & - \tabularnewline
114 & 3283.5 & - & - & - & - & - & - & - \tabularnewline
115 & 2861.5 & 2648.3048 & 1676.9559 & 3619.6537 & 0.3335 & 0.1 & 0.6964 & 0.1 \tabularnewline
116 & 9486.5 & 7899.8238 & 6475.4085 & 9324.2391 & 0.0145 & 1 & 0.3749 & 1 \tabularnewline
117 & 9061 & 7608.9103 & 5844.1443 & 9373.6763 & 0.0534 & 0.0185 & 0.2848 & 1 \tabularnewline
118 & 8877.5 & 7141.638 & 5092.2871 & 9190.989 & 0.0484 & 0.0332 & 0.2674 & 0.9999 \tabularnewline
119 & 8557.5 & 6768.9009 & 4469.9273 & 9067.8744 & 0.0636 & 0.0361 & 0.2919 & 0.9985 \tabularnewline
120 & 8031 & 6193.7536 & 3669.7251 & 8717.782 & 0.0768 & 0.0332 & 0.3022 & 0.9881 \tabularnewline
121 & 7404.5 & 5594.6042 & 2864.0073 & 8325.2012 & 0.0969 & 0.0402 & 0.3327 & 0.9514 \tabularnewline
122 & 6852.5 & 4998.4874 & 2075.8858 & 7921.0889 & 0.1069 & 0.0533 & 0.3378 & 0.875 \tabularnewline
123 & 6174.5 & 4218.1536 & 1115.4064 & 7320.9008 & 0.1083 & 0.048 & 0.3436 & 0.7225 \tabularnewline
124 & 5341.5 & 3688.3765 & 415.384 & 6961.3691 & 0.1611 & 0.0683 & 0.3563 & 0.5958 \tabularnewline
125 & 4975.5 & 3274.1353 & -160.6748 & 6708.9454 & 0.1658 & 0.1191 & 0.3705 & 0.4979 \tabularnewline
126 & 4290 & 2680.0941 & -909.2458 & 6269.434 & 0.1897 & 0.105 & 0.3709 & 0.3709 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299470&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]102[/C][C]3288.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]2393.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]8131.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]8121[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]7790.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]7411.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]6861[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]6197[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]5622.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]4855.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]4303.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]3853.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]3283.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]2861.5[/C][C]2648.3048[/C][C]1676.9559[/C][C]3619.6537[/C][C]0.3335[/C][C]0.1[/C][C]0.6964[/C][C]0.1[/C][/ROW]
[ROW][C]116[/C][C]9486.5[/C][C]7899.8238[/C][C]6475.4085[/C][C]9324.2391[/C][C]0.0145[/C][C]1[/C][C]0.3749[/C][C]1[/C][/ROW]
[ROW][C]117[/C][C]9061[/C][C]7608.9103[/C][C]5844.1443[/C][C]9373.6763[/C][C]0.0534[/C][C]0.0185[/C][C]0.2848[/C][C]1[/C][/ROW]
[ROW][C]118[/C][C]8877.5[/C][C]7141.638[/C][C]5092.2871[/C][C]9190.989[/C][C]0.0484[/C][C]0.0332[/C][C]0.2674[/C][C]0.9999[/C][/ROW]
[ROW][C]119[/C][C]8557.5[/C][C]6768.9009[/C][C]4469.9273[/C][C]9067.8744[/C][C]0.0636[/C][C]0.0361[/C][C]0.2919[/C][C]0.9985[/C][/ROW]
[ROW][C]120[/C][C]8031[/C][C]6193.7536[/C][C]3669.7251[/C][C]8717.782[/C][C]0.0768[/C][C]0.0332[/C][C]0.3022[/C][C]0.9881[/C][/ROW]
[ROW][C]121[/C][C]7404.5[/C][C]5594.6042[/C][C]2864.0073[/C][C]8325.2012[/C][C]0.0969[/C][C]0.0402[/C][C]0.3327[/C][C]0.9514[/C][/ROW]
[ROW][C]122[/C][C]6852.5[/C][C]4998.4874[/C][C]2075.8858[/C][C]7921.0889[/C][C]0.1069[/C][C]0.0533[/C][C]0.3378[/C][C]0.875[/C][/ROW]
[ROW][C]123[/C][C]6174.5[/C][C]4218.1536[/C][C]1115.4064[/C][C]7320.9008[/C][C]0.1083[/C][C]0.048[/C][C]0.3436[/C][C]0.7225[/C][/ROW]
[ROW][C]124[/C][C]5341.5[/C][C]3688.3765[/C][C]415.384[/C][C]6961.3691[/C][C]0.1611[/C][C]0.0683[/C][C]0.3563[/C][C]0.5958[/C][/ROW]
[ROW][C]125[/C][C]4975.5[/C][C]3274.1353[/C][C]-160.6748[/C][C]6708.9454[/C][C]0.1658[/C][C]0.1191[/C][C]0.3705[/C][C]0.4979[/C][/ROW]
[ROW][C]126[/C][C]4290[/C][C]2680.0941[/C][C]-909.2458[/C][C]6269.434[/C][C]0.1897[/C][C]0.105[/C][C]0.3709[/C][C]0.3709[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=299470&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299470&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])
1023288.5-------
1032393.5-------
1048131.5-------
1058121-------
1067790.5-------
1077411.5-------
1086861-------
1096197-------
1105622.5-------
1114855.5-------
1124303.5-------
1133853.5-------
1143283.5-------
1152861.52648.30481676.95593619.65370.33350.10.69640.1
1169486.57899.82386475.40859324.23910.014510.37491
11790617608.91035844.14439373.67630.05340.01850.28481
1188877.57141.6385092.28719190.9890.04840.03320.26740.9999
1198557.56768.90094469.92739067.87440.06360.03610.29190.9985
12080316193.75363669.72518717.7820.07680.03320.30220.9881
1217404.55594.60422864.00738325.20120.09690.04020.33270.9514
1226852.54998.48742075.88587921.08890.10690.05330.33780.875
1236174.54218.15361115.40647320.90080.10830.0480.34360.7225
1245341.53688.3765415.3846961.36910.16110.06830.35630.5958
1254975.53274.1353-160.67486708.94540.16580.11910.37050.4979
12642902680.0941-909.24586269.4340.18970.1050.37090.3709







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.18710.07450.07450.077445452.1761000.19840.1984
1160.0920.16730.12090.132517541.33981281496.7581132.03211.47640.8374
1170.11830.16030.1340.14472108564.43351557185.98311247.87261.35121.0087
1180.14640.19550.14940.16273013216.75081921193.6751386.07131.61521.1603
1190.17330.2090.16130.17683199086.82882176772.30581475.38891.66431.2611
1200.20790.22880.17260.19043375474.40612376555.98921541.60821.70961.3358
1210.2490.24440.18280.2033275722.62692505008.3661582.72181.68411.3856
1220.29830.27060.19380.21673437362.86942621552.67891619.1211.72521.428
1230.37530.31680.20750.23453827291.32482755523.63961659.9771.82041.4716
1240.45270.30950.21770.24772732817.14672753252.99031659.29291.53821.4783
1250.53520.34190.2290.26262894641.74542766106.51351663.16161.58311.4878
1260.68330.37530.24120.27922591796.95962751580.71731658.78891.4981.4887

\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.1871 & 0.0745 & 0.0745 & 0.0774 & 45452.1761 & 0 & 0 & 0.1984 & 0.1984 \tabularnewline
116 & 0.092 & 0.1673 & 0.1209 & 0.13 & 2517541.3398 & 1281496.758 & 1132.0321 & 1.4764 & 0.8374 \tabularnewline
117 & 0.1183 & 0.1603 & 0.134 & 0.1447 & 2108564.4335 & 1557185.9831 & 1247.8726 & 1.3512 & 1.0087 \tabularnewline
118 & 0.1464 & 0.1955 & 0.1494 & 0.1627 & 3013216.7508 & 1921193.675 & 1386.0713 & 1.6152 & 1.1603 \tabularnewline
119 & 0.1733 & 0.209 & 0.1613 & 0.1768 & 3199086.8288 & 2176772.3058 & 1475.3889 & 1.6643 & 1.2611 \tabularnewline
120 & 0.2079 & 0.2288 & 0.1726 & 0.1904 & 3375474.4061 & 2376555.9892 & 1541.6082 & 1.7096 & 1.3358 \tabularnewline
121 & 0.249 & 0.2444 & 0.1828 & 0.203 & 3275722.6269 & 2505008.366 & 1582.7218 & 1.6841 & 1.3856 \tabularnewline
122 & 0.2983 & 0.2706 & 0.1938 & 0.2167 & 3437362.8694 & 2621552.6789 & 1619.121 & 1.7252 & 1.428 \tabularnewline
123 & 0.3753 & 0.3168 & 0.2075 & 0.2345 & 3827291.3248 & 2755523.6396 & 1659.977 & 1.8204 & 1.4716 \tabularnewline
124 & 0.4527 & 0.3095 & 0.2177 & 0.2477 & 2732817.1467 & 2753252.9903 & 1659.2929 & 1.5382 & 1.4783 \tabularnewline
125 & 0.5352 & 0.3419 & 0.229 & 0.2626 & 2894641.7454 & 2766106.5135 & 1663.1616 & 1.5831 & 1.4878 \tabularnewline
126 & 0.6833 & 0.3753 & 0.2412 & 0.2792 & 2591796.9596 & 2751580.7173 & 1658.7889 & 1.498 & 1.4887 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299470&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.1871[/C][C]0.0745[/C][C]0.0745[/C][C]0.0774[/C][C]45452.1761[/C][C]0[/C][C]0[/C][C]0.1984[/C][C]0.1984[/C][/ROW]
[ROW][C]116[/C][C]0.092[/C][C]0.1673[/C][C]0.1209[/C][C]0.13[/C][C]2517541.3398[/C][C]1281496.758[/C][C]1132.0321[/C][C]1.4764[/C][C]0.8374[/C][/ROW]
[ROW][C]117[/C][C]0.1183[/C][C]0.1603[/C][C]0.134[/C][C]0.1447[/C][C]2108564.4335[/C][C]1557185.9831[/C][C]1247.8726[/C][C]1.3512[/C][C]1.0087[/C][/ROW]
[ROW][C]118[/C][C]0.1464[/C][C]0.1955[/C][C]0.1494[/C][C]0.1627[/C][C]3013216.7508[/C][C]1921193.675[/C][C]1386.0713[/C][C]1.6152[/C][C]1.1603[/C][/ROW]
[ROW][C]119[/C][C]0.1733[/C][C]0.209[/C][C]0.1613[/C][C]0.1768[/C][C]3199086.8288[/C][C]2176772.3058[/C][C]1475.3889[/C][C]1.6643[/C][C]1.2611[/C][/ROW]
[ROW][C]120[/C][C]0.2079[/C][C]0.2288[/C][C]0.1726[/C][C]0.1904[/C][C]3375474.4061[/C][C]2376555.9892[/C][C]1541.6082[/C][C]1.7096[/C][C]1.3358[/C][/ROW]
[ROW][C]121[/C][C]0.249[/C][C]0.2444[/C][C]0.1828[/C][C]0.203[/C][C]3275722.6269[/C][C]2505008.366[/C][C]1582.7218[/C][C]1.6841[/C][C]1.3856[/C][/ROW]
[ROW][C]122[/C][C]0.2983[/C][C]0.2706[/C][C]0.1938[/C][C]0.2167[/C][C]3437362.8694[/C][C]2621552.6789[/C][C]1619.121[/C][C]1.7252[/C][C]1.428[/C][/ROW]
[ROW][C]123[/C][C]0.3753[/C][C]0.3168[/C][C]0.2075[/C][C]0.2345[/C][C]3827291.3248[/C][C]2755523.6396[/C][C]1659.977[/C][C]1.8204[/C][C]1.4716[/C][/ROW]
[ROW][C]124[/C][C]0.4527[/C][C]0.3095[/C][C]0.2177[/C][C]0.2477[/C][C]2732817.1467[/C][C]2753252.9903[/C][C]1659.2929[/C][C]1.5382[/C][C]1.4783[/C][/ROW]
[ROW][C]125[/C][C]0.5352[/C][C]0.3419[/C][C]0.229[/C][C]0.2626[/C][C]2894641.7454[/C][C]2766106.5135[/C][C]1663.1616[/C][C]1.5831[/C][C]1.4878[/C][/ROW]
[ROW][C]126[/C][C]0.6833[/C][C]0.3753[/C][C]0.2412[/C][C]0.2792[/C][C]2591796.9596[/C][C]2751580.7173[/C][C]1658.7889[/C][C]1.498[/C][C]1.4887[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=299470&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299470&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.18710.07450.07450.077445452.1761000.19840.1984
1160.0920.16730.12090.132517541.33981281496.7581132.03211.47640.8374
1170.11830.16030.1340.14472108564.43351557185.98311247.87261.35121.0087
1180.14640.19550.14940.16273013216.75081921193.6751386.07131.61521.1603
1190.17330.2090.16130.17683199086.82882176772.30581475.38891.66431.2611
1200.20790.22880.17260.19043375474.40612376555.98921541.60821.70961.3358
1210.2490.24440.18280.2033275722.62692505008.3661582.72181.68411.3856
1220.29830.27060.19380.21673437362.86942621552.67891619.1211.72521.428
1230.37530.31680.20750.23453827291.32482755523.63961659.9771.82041.4716
1240.45270.30950.21770.24772732817.14672753252.99031659.29291.53821.4783
1250.53520.34190.2290.26262894641.74542766106.51351663.16161.58311.4878
1260.68330.37530.24120.27922591796.95962751580.71731658.78891.4981.4887



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