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, 19 Dec 2018 11:18:43 +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/2018/Dec/19/t15452148029i8p5nvjb1nc9xp.htm/, Retrieved Mon, 29 Apr 2024 23:01:44 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=316086, Retrieved Mon, 29 Apr 2024 23:01:44 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact38
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2018-12-19 10:18:43] [faeb7b06c531293c72cd094586d8c91e] [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 time3 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 time3 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=316086&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]3 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=316086&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=316086&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 time3 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])
1081.169-------
1092.429-------
1101.762-------
1112.846-------
1125.627-------
1135.749-------
1144.502-------
1155.72-------
1164.403-------
1172.867-------
1182.635-------
1192.059-------
1201.511-------
1212.3592.38272.01142.84830.46020.99990.42280.9999
1221.7411.77991.52242.09690.40512e-040.54390.9517
1232.9173.23962.68813.94760.185910.8621
1246.2495.31664.22326.80830.11030.99920.34171
1255.765.93584.67767.67190.42130.36180.58351
1266.254.72323.77826.00010.00950.05570.63291
1275.1345.59544.41717.21730.28850.21450.44021
1284.8314.41253.53815.590.2430.11490.50631
1293.6952.86482.35763.52370.006800.49741
1302.4622.51622.08533.07050.42400.33720.9998
1312.1462.08951.74892.52170.39890.04560.5550.9957
1321.5791.41521.20741.67210.105700.23240.2324

\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
108 & 1.169 & - & - & - & - & - & - & - \tabularnewline
109 & 2.429 & - & - & - & - & - & - & - \tabularnewline
110 & 1.762 & - & - & - & - & - & - & - \tabularnewline
111 & 2.846 & - & - & - & - & - & - & - \tabularnewline
112 & 5.627 & - & - & - & - & - & - & - \tabularnewline
113 & 5.749 & - & - & - & - & - & - & - \tabularnewline
114 & 4.502 & - & - & - & - & - & - & - \tabularnewline
115 & 5.72 & - & - & - & - & - & - & - \tabularnewline
116 & 4.403 & - & - & - & - & - & - & - \tabularnewline
117 & 2.867 & - & - & - & - & - & - & - \tabularnewline
118 & 2.635 & - & - & - & - & - & - & - \tabularnewline
119 & 2.059 & - & - & - & - & - & - & - \tabularnewline
120 & 1.511 & - & - & - & - & - & - & - \tabularnewline
121 & 2.359 & 2.3827 & 2.0114 & 2.8483 & 0.4602 & 0.9999 & 0.4228 & 0.9999 \tabularnewline
122 & 1.741 & 1.7799 & 1.5224 & 2.0969 & 0.4051 & 2e-04 & 0.5439 & 0.9517 \tabularnewline
123 & 2.917 & 3.2396 & 2.6881 & 3.9476 & 0.1859 & 1 & 0.862 & 1 \tabularnewline
124 & 6.249 & 5.3166 & 4.2232 & 6.8083 & 0.1103 & 0.9992 & 0.3417 & 1 \tabularnewline
125 & 5.76 & 5.9358 & 4.6776 & 7.6719 & 0.4213 & 0.3618 & 0.5835 & 1 \tabularnewline
126 & 6.25 & 4.7232 & 3.7782 & 6.0001 & 0.0095 & 0.0557 & 0.6329 & 1 \tabularnewline
127 & 5.134 & 5.5954 & 4.4171 & 7.2173 & 0.2885 & 0.2145 & 0.4402 & 1 \tabularnewline
128 & 4.831 & 4.4125 & 3.5381 & 5.59 & 0.243 & 0.1149 & 0.5063 & 1 \tabularnewline
129 & 3.695 & 2.8648 & 2.3576 & 3.5237 & 0.0068 & 0 & 0.4974 & 1 \tabularnewline
130 & 2.462 & 2.5162 & 2.0853 & 3.0705 & 0.424 & 0 & 0.3372 & 0.9998 \tabularnewline
131 & 2.146 & 2.0895 & 1.7489 & 2.5217 & 0.3989 & 0.0456 & 0.555 & 0.9957 \tabularnewline
132 & 1.579 & 1.4152 & 1.2074 & 1.6721 & 0.1057 & 0 & 0.2324 & 0.2324 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=316086&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]108[/C][C]1.169[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]2.429[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]1.762[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]2.846[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]5.627[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]5.749[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]4.502[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]5.72[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]4.403[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]2.867[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]2.635[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/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]2.3827[/C][C]2.0114[/C][C]2.8483[/C][C]0.4602[/C][C]0.9999[/C][C]0.4228[/C][C]0.9999[/C][/ROW]
[ROW][C]122[/C][C]1.741[/C][C]1.7799[/C][C]1.5224[/C][C]2.0969[/C][C]0.4051[/C][C]2e-04[/C][C]0.5439[/C][C]0.9517[/C][/ROW]
[ROW][C]123[/C][C]2.917[/C][C]3.2396[/C][C]2.6881[/C][C]3.9476[/C][C]0.1859[/C][C]1[/C][C]0.862[/C][C]1[/C][/ROW]
[ROW][C]124[/C][C]6.249[/C][C]5.3166[/C][C]4.2232[/C][C]6.8083[/C][C]0.1103[/C][C]0.9992[/C][C]0.3417[/C][C]1[/C][/ROW]
[ROW][C]125[/C][C]5.76[/C][C]5.9358[/C][C]4.6776[/C][C]7.6719[/C][C]0.4213[/C][C]0.3618[/C][C]0.5835[/C][C]1[/C][/ROW]
[ROW][C]126[/C][C]6.25[/C][C]4.7232[/C][C]3.7782[/C][C]6.0001[/C][C]0.0095[/C][C]0.0557[/C][C]0.6329[/C][C]1[/C][/ROW]
[ROW][C]127[/C][C]5.134[/C][C]5.5954[/C][C]4.4171[/C][C]7.2173[/C][C]0.2885[/C][C]0.2145[/C][C]0.4402[/C][C]1[/C][/ROW]
[ROW][C]128[/C][C]4.831[/C][C]4.4125[/C][C]3.5381[/C][C]5.59[/C][C]0.243[/C][C]0.1149[/C][C]0.5063[/C][C]1[/C][/ROW]
[ROW][C]129[/C][C]3.695[/C][C]2.8648[/C][C]2.3576[/C][C]3.5237[/C][C]0.0068[/C][C]0[/C][C]0.4974[/C][C]1[/C][/ROW]
[ROW][C]130[/C][C]2.462[/C][C]2.5162[/C][C]2.0853[/C][C]3.0705[/C][C]0.424[/C][C]0[/C][C]0.3372[/C][C]0.9998[/C][/ROW]
[ROW][C]131[/C][C]2.146[/C][C]2.0895[/C][C]1.7489[/C][C]2.5217[/C][C]0.3989[/C][C]0.0456[/C][C]0.555[/C][C]0.9957[/C][/ROW]
[ROW][C]132[/C][C]1.579[/C][C]1.4152[/C][C]1.2074[/C][C]1.6721[/C][C]0.1057[/C][C]0[/C][C]0.2324[/C][C]0.2324[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=316086&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=316086&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])
1081.169-------
1092.429-------
1101.762-------
1112.846-------
1125.627-------
1135.749-------
1144.502-------
1155.72-------
1164.403-------
1172.867-------
1182.635-------
1192.059-------
1201.511-------
1212.3592.38272.01142.84830.46020.99990.42280.9999
1221.7411.77991.52242.09690.40512e-040.54390.9517
1232.9173.23962.68813.94760.185910.8621
1246.2495.31664.22326.80830.11030.99920.34171
1255.765.93584.67767.67190.42130.36180.58351
1266.254.72323.77826.00010.00950.05570.63291
1275.1345.59544.41717.21730.28850.21450.44021
1284.8314.41253.53815.590.2430.11490.50631
1293.6952.86482.35763.52370.006800.49741
1302.4622.51622.08533.07050.42400.33720.9998
1312.1462.08951.74892.52170.39890.04560.5550.9957
1321.5791.41521.20741.67210.105700.23240.2324







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1210.0997-0.01010.01010.016e-0400-0.02420.0242
1220.0909-0.02230.01620.0160.00150.0010.0322-0.03970.0319
1230.1115-0.11060.04770.04560.1040.03540.1881-0.32930.131
1240.14320.14920.0730.07450.86940.24390.49390.95180.3362
1250.1492-0.03050.06450.06560.03090.20130.4487-0.17950.3049
1260.13790.24430.09450.10112.33110.55630.74581.55850.5138
1270.1479-0.08990.09380.09890.21290.50720.7122-0.4710.5077
1280.13620.08660.09290.09790.17510.46570.68240.42720.4977
1290.11730.22470.10760.11510.68920.49050.70040.84740.5365
1300.1124-0.0220.0990.10580.00290.44180.6647-0.05540.4884
1310.10550.02630.09240.09860.00320.40190.6340.05770.4492
1320.09260.10370.09340.09950.02680.37060.60880.16720.4257

\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.0997 & -0.0101 & 0.0101 & 0.01 & 6e-04 & 0 & 0 & -0.0242 & 0.0242 \tabularnewline
122 & 0.0909 & -0.0223 & 0.0162 & 0.016 & 0.0015 & 0.001 & 0.0322 & -0.0397 & 0.0319 \tabularnewline
123 & 0.1115 & -0.1106 & 0.0477 & 0.0456 & 0.104 & 0.0354 & 0.1881 & -0.3293 & 0.131 \tabularnewline
124 & 0.1432 & 0.1492 & 0.073 & 0.0745 & 0.8694 & 0.2439 & 0.4939 & 0.9518 & 0.3362 \tabularnewline
125 & 0.1492 & -0.0305 & 0.0645 & 0.0656 & 0.0309 & 0.2013 & 0.4487 & -0.1795 & 0.3049 \tabularnewline
126 & 0.1379 & 0.2443 & 0.0945 & 0.1011 & 2.3311 & 0.5563 & 0.7458 & 1.5585 & 0.5138 \tabularnewline
127 & 0.1479 & -0.0899 & 0.0938 & 0.0989 & 0.2129 & 0.5072 & 0.7122 & -0.471 & 0.5077 \tabularnewline
128 & 0.1362 & 0.0866 & 0.0929 & 0.0979 & 0.1751 & 0.4657 & 0.6824 & 0.4272 & 0.4977 \tabularnewline
129 & 0.1173 & 0.2247 & 0.1076 & 0.1151 & 0.6892 & 0.4905 & 0.7004 & 0.8474 & 0.5365 \tabularnewline
130 & 0.1124 & -0.022 & 0.099 & 0.1058 & 0.0029 & 0.4418 & 0.6647 & -0.0554 & 0.4884 \tabularnewline
131 & 0.1055 & 0.0263 & 0.0924 & 0.0986 & 0.0032 & 0.4019 & 0.634 & 0.0577 & 0.4492 \tabularnewline
132 & 0.0926 & 0.1037 & 0.0934 & 0.0995 & 0.0268 & 0.3706 & 0.6088 & 0.1672 & 0.4257 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=316086&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.0997[/C][C]-0.0101[/C][C]0.0101[/C][C]0.01[/C][C]6e-04[/C][C]0[/C][C]0[/C][C]-0.0242[/C][C]0.0242[/C][/ROW]
[ROW][C]122[/C][C]0.0909[/C][C]-0.0223[/C][C]0.0162[/C][C]0.016[/C][C]0.0015[/C][C]0.001[/C][C]0.0322[/C][C]-0.0397[/C][C]0.0319[/C][/ROW]
[ROW][C]123[/C][C]0.1115[/C][C]-0.1106[/C][C]0.0477[/C][C]0.0456[/C][C]0.104[/C][C]0.0354[/C][C]0.1881[/C][C]-0.3293[/C][C]0.131[/C][/ROW]
[ROW][C]124[/C][C]0.1432[/C][C]0.1492[/C][C]0.073[/C][C]0.0745[/C][C]0.8694[/C][C]0.2439[/C][C]0.4939[/C][C]0.9518[/C][C]0.3362[/C][/ROW]
[ROW][C]125[/C][C]0.1492[/C][C]-0.0305[/C][C]0.0645[/C][C]0.0656[/C][C]0.0309[/C][C]0.2013[/C][C]0.4487[/C][C]-0.1795[/C][C]0.3049[/C][/ROW]
[ROW][C]126[/C][C]0.1379[/C][C]0.2443[/C][C]0.0945[/C][C]0.1011[/C][C]2.3311[/C][C]0.5563[/C][C]0.7458[/C][C]1.5585[/C][C]0.5138[/C][/ROW]
[ROW][C]127[/C][C]0.1479[/C][C]-0.0899[/C][C]0.0938[/C][C]0.0989[/C][C]0.2129[/C][C]0.5072[/C][C]0.7122[/C][C]-0.471[/C][C]0.5077[/C][/ROW]
[ROW][C]128[/C][C]0.1362[/C][C]0.0866[/C][C]0.0929[/C][C]0.0979[/C][C]0.1751[/C][C]0.4657[/C][C]0.6824[/C][C]0.4272[/C][C]0.4977[/C][/ROW]
[ROW][C]129[/C][C]0.1173[/C][C]0.2247[/C][C]0.1076[/C][C]0.1151[/C][C]0.6892[/C][C]0.4905[/C][C]0.7004[/C][C]0.8474[/C][C]0.5365[/C][/ROW]
[ROW][C]130[/C][C]0.1124[/C][C]-0.022[/C][C]0.099[/C][C]0.1058[/C][C]0.0029[/C][C]0.4418[/C][C]0.6647[/C][C]-0.0554[/C][C]0.4884[/C][/ROW]
[ROW][C]131[/C][C]0.1055[/C][C]0.0263[/C][C]0.0924[/C][C]0.0986[/C][C]0.0032[/C][C]0.4019[/C][C]0.634[/C][C]0.0577[/C][C]0.4492[/C][/ROW]
[ROW][C]132[/C][C]0.0926[/C][C]0.1037[/C][C]0.0934[/C][C]0.0995[/C][C]0.0268[/C][C]0.3706[/C][C]0.6088[/C][C]0.1672[/C][C]0.4257[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=316086&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=316086&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.0997-0.01010.01010.016e-0400-0.02420.0242
1220.0909-0.02230.01620.0160.00150.0010.0322-0.03970.0319
1230.1115-0.11060.04770.04560.1040.03540.1881-0.32930.131
1240.14320.14920.0730.07450.86940.24390.49390.95180.3362
1250.1492-0.03050.06450.06560.03090.20130.4487-0.17950.3049
1260.13790.24430.09450.10112.33110.55630.74581.55850.5138
1270.1479-0.08990.09380.09890.21290.50720.7122-0.4710.5077
1280.13620.08660.09290.09790.17510.46570.68240.42720.4977
1290.11730.22470.10760.11510.68920.49050.70040.84740.5365
1300.1124-0.0220.0990.10580.00290.44180.6647-0.05540.4884
1310.10550.02630.09240.09860.00320.40190.6340.05770.4492
1320.09260.10370.09340.09950.02680.37060.60880.16720.4257



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