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 computationFri, 23 Dec 2016 18:06:38 +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/23/t1482513162hlq1kx3vzhlwfat.htm/, Retrieved Tue, 21 May 2024 08:44:32 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=303007, Retrieved Tue, 21 May 2024 08:44:32 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact84
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2016-12-23 17:06:38] [0ee917385e150f2e81c028b828d928ea] [Current]
Feedback Forum

Post a new message
Dataseries X:
6600
6160
6320
5820
6080
6240
5740
6980
6540
6780
6580
6020
6440
6440
7040
6620
6460
6320
6560
6080
6040
6260
5780
5120
6040
5860
5900
5160
5800
5300
5600
5620
6300
5800
5460
5420
5800
5260
5900
5840
5640
5560
5540
5540
5480
5440
5260
5420
5600
5200
5480
5300
4660
4940
4880
4980
5160
5180
4860
5220
4900
4740
4920
4780
4300
4540
4420
4660
4760
4560
4600
4800
4980
4300
4800
3980
4120
4580
4240
4540
4200
4780
4820
4320
4300
3700
3920
3740
4120
4160
4160
3960
3960
4160
3920
3460
4040
3720
4060
4140
3700
3900
3720
3760
3520
3800
3520
3640
4200
3860
4160
3920
3860
3860
3780




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=303007&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[103])
914160-------
923960-------
933960-------
944160-------
953920-------
963460-------
974040-------
983720-------
994060-------
1004140-------
1013700-------
1023900-------
1033720-------
10437603827.5083386.70574325.68350.39530.66380.30110.6638
10535203824.43033358.80784354.60090.13020.59410.30810.6503
10638003824.51723332.84184388.72670.46610.85490.12190.6417
10735203824.51473308.4454421.08380.15850.53210.37690.6343
10836403824.51483285.39274452.10510.28220.82920.87250.6279
10942003824.51483263.50564481.96360.13150.70890.26030.6223
11038603824.51483242.64134510.80210.45960.14180.61730.6173
11141603824.51483222.68414538.73640.17860.46120.25910.6129
11239203824.51483203.53834565.86190.40030.18750.20210.6088
11338603824.51483185.1244592.25860.46390.40370.62470.6052
11438603824.51483167.37364617.99430.46510.46510.4260.6019
11537803824.51483150.22924643.12680.45760.46610.59880.5988

\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[103]) \tabularnewline
91 & 4160 & - & - & - & - & - & - & - \tabularnewline
92 & 3960 & - & - & - & - & - & - & - \tabularnewline
93 & 3960 & - & - & - & - & - & - & - \tabularnewline
94 & 4160 & - & - & - & - & - & - & - \tabularnewline
95 & 3920 & - & - & - & - & - & - & - \tabularnewline
96 & 3460 & - & - & - & - & - & - & - \tabularnewline
97 & 4040 & - & - & - & - & - & - & - \tabularnewline
98 & 3720 & - & - & - & - & - & - & - \tabularnewline
99 & 4060 & - & - & - & - & - & - & - \tabularnewline
100 & 4140 & - & - & - & - & - & - & - \tabularnewline
101 & 3700 & - & - & - & - & - & - & - \tabularnewline
102 & 3900 & - & - & - & - & - & - & - \tabularnewline
103 & 3720 & - & - & - & - & - & - & - \tabularnewline
104 & 3760 & 3827.508 & 3386.7057 & 4325.6835 & 0.3953 & 0.6638 & 0.3011 & 0.6638 \tabularnewline
105 & 3520 & 3824.4303 & 3358.8078 & 4354.6009 & 0.1302 & 0.5941 & 0.3081 & 0.6503 \tabularnewline
106 & 3800 & 3824.5172 & 3332.8418 & 4388.7267 & 0.4661 & 0.8549 & 0.1219 & 0.6417 \tabularnewline
107 & 3520 & 3824.5147 & 3308.445 & 4421.0838 & 0.1585 & 0.5321 & 0.3769 & 0.6343 \tabularnewline
108 & 3640 & 3824.5148 & 3285.3927 & 4452.1051 & 0.2822 & 0.8292 & 0.8725 & 0.6279 \tabularnewline
109 & 4200 & 3824.5148 & 3263.5056 & 4481.9636 & 0.1315 & 0.7089 & 0.2603 & 0.6223 \tabularnewline
110 & 3860 & 3824.5148 & 3242.6413 & 4510.8021 & 0.4596 & 0.1418 & 0.6173 & 0.6173 \tabularnewline
111 & 4160 & 3824.5148 & 3222.6841 & 4538.7364 & 0.1786 & 0.4612 & 0.2591 & 0.6129 \tabularnewline
112 & 3920 & 3824.5148 & 3203.5383 & 4565.8619 & 0.4003 & 0.1875 & 0.2021 & 0.6088 \tabularnewline
113 & 3860 & 3824.5148 & 3185.124 & 4592.2586 & 0.4639 & 0.4037 & 0.6247 & 0.6052 \tabularnewline
114 & 3860 & 3824.5148 & 3167.3736 & 4617.9943 & 0.4651 & 0.4651 & 0.426 & 0.6019 \tabularnewline
115 & 3780 & 3824.5148 & 3150.2292 & 4643.1268 & 0.4576 & 0.4661 & 0.5988 & 0.5988 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=303007&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[103])[/C][/ROW]
[ROW][C]91[/C][C]4160[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]3960[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]3960[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]4160[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]3920[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]3460[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]4040[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]3720[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]4060[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]4140[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]3700[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]3900[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]3720[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]3760[/C][C]3827.508[/C][C]3386.7057[/C][C]4325.6835[/C][C]0.3953[/C][C]0.6638[/C][C]0.3011[/C][C]0.6638[/C][/ROW]
[ROW][C]105[/C][C]3520[/C][C]3824.4303[/C][C]3358.8078[/C][C]4354.6009[/C][C]0.1302[/C][C]0.5941[/C][C]0.3081[/C][C]0.6503[/C][/ROW]
[ROW][C]106[/C][C]3800[/C][C]3824.5172[/C][C]3332.8418[/C][C]4388.7267[/C][C]0.4661[/C][C]0.8549[/C][C]0.1219[/C][C]0.6417[/C][/ROW]
[ROW][C]107[/C][C]3520[/C][C]3824.5147[/C][C]3308.445[/C][C]4421.0838[/C][C]0.1585[/C][C]0.5321[/C][C]0.3769[/C][C]0.6343[/C][/ROW]
[ROW][C]108[/C][C]3640[/C][C]3824.5148[/C][C]3285.3927[/C][C]4452.1051[/C][C]0.2822[/C][C]0.8292[/C][C]0.8725[/C][C]0.6279[/C][/ROW]
[ROW][C]109[/C][C]4200[/C][C]3824.5148[/C][C]3263.5056[/C][C]4481.9636[/C][C]0.1315[/C][C]0.7089[/C][C]0.2603[/C][C]0.6223[/C][/ROW]
[ROW][C]110[/C][C]3860[/C][C]3824.5148[/C][C]3242.6413[/C][C]4510.8021[/C][C]0.4596[/C][C]0.1418[/C][C]0.6173[/C][C]0.6173[/C][/ROW]
[ROW][C]111[/C][C]4160[/C][C]3824.5148[/C][C]3222.6841[/C][C]4538.7364[/C][C]0.1786[/C][C]0.4612[/C][C]0.2591[/C][C]0.6129[/C][/ROW]
[ROW][C]112[/C][C]3920[/C][C]3824.5148[/C][C]3203.5383[/C][C]4565.8619[/C][C]0.4003[/C][C]0.1875[/C][C]0.2021[/C][C]0.6088[/C][/ROW]
[ROW][C]113[/C][C]3860[/C][C]3824.5148[/C][C]3185.124[/C][C]4592.2586[/C][C]0.4639[/C][C]0.4037[/C][C]0.6247[/C][C]0.6052[/C][/ROW]
[ROW][C]114[/C][C]3860[/C][C]3824.5148[/C][C]3167.3736[/C][C]4617.9943[/C][C]0.4651[/C][C]0.4651[/C][C]0.426[/C][C]0.6019[/C][/ROW]
[ROW][C]115[/C][C]3780[/C][C]3824.5148[/C][C]3150.2292[/C][C]4643.1268[/C][C]0.4576[/C][C]0.4661[/C][C]0.5988[/C][C]0.5988[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=303007&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=303007&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[103])
914160-------
923960-------
933960-------
944160-------
953920-------
963460-------
974040-------
983720-------
994060-------
1004140-------
1013700-------
1023900-------
1033720-------
10437603827.5083386.70574325.68350.39530.66380.30110.6638
10535203824.43033358.80784354.60090.13020.59410.30810.6503
10638003824.51723332.84184388.72670.46610.85490.12190.6417
10735203824.51473308.4454421.08380.15850.53210.37690.6343
10836403824.51483285.39274452.10510.28220.82920.87250.6279
10942003824.51483263.50564481.96360.13150.70890.26030.6223
11038603824.51483242.64134510.80210.45960.14180.61730.6173
11141603824.51483222.68414538.73640.17860.46120.25910.6129
11239203824.51483203.53834565.86190.40030.18750.20210.6088
11338603824.51483185.1244592.25860.46390.40370.62470.6052
11438603824.51483167.37364617.99430.46510.46510.4260.6019
11537803824.51483150.22924643.12680.45760.46610.59880.5988







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1040.0664-0.0180.0180.01784557.324700-0.2970.297
1050.0707-0.08650.05220.050392677.815848617.5703220.4939-1.33950.8183
1060.0753-0.00650.0370.0357601.091932612.0775180.5881-0.10790.5815
1070.0796-0.08650.04940.047592729.216547641.3622218.269-1.33990.7711
1080.0837-0.05070.04960.047934045.708644922.2315211.9487-0.81190.7792
1090.08770.08940.05620.0555140989.142760933.3834246.84691.65210.9247
1100.09160.00920.04950.04891259.200152408.5228.9290.15610.8149
1110.09530.08060.05340.0533112550.325959926.2283244.79831.47610.8976
1120.09890.02440.05020.05019117.425354280.8057232.98240.42010.8445
1130.10240.00920.04610.0461259.200148978.6452221.31120.15610.7757
1140.10590.00920.04270.04271259.200144640.5138211.2830.15610.7194
1150.1092-0.01180.04020.04011981.566641085.6015202.6958-0.19590.6757

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
104 & 0.0664 & -0.018 & 0.018 & 0.0178 & 4557.3247 & 0 & 0 & -0.297 & 0.297 \tabularnewline
105 & 0.0707 & -0.0865 & 0.0522 & 0.0503 & 92677.8158 & 48617.5703 & 220.4939 & -1.3395 & 0.8183 \tabularnewline
106 & 0.0753 & -0.0065 & 0.037 & 0.0357 & 601.0919 & 32612.0775 & 180.5881 & -0.1079 & 0.5815 \tabularnewline
107 & 0.0796 & -0.0865 & 0.0494 & 0.0475 & 92729.2165 & 47641.3622 & 218.269 & -1.3399 & 0.7711 \tabularnewline
108 & 0.0837 & -0.0507 & 0.0496 & 0.0479 & 34045.7086 & 44922.2315 & 211.9487 & -0.8119 & 0.7792 \tabularnewline
109 & 0.0877 & 0.0894 & 0.0562 & 0.0555 & 140989.1427 & 60933.3834 & 246.8469 & 1.6521 & 0.9247 \tabularnewline
110 & 0.0916 & 0.0092 & 0.0495 & 0.0489 & 1259.2001 & 52408.5 & 228.929 & 0.1561 & 0.8149 \tabularnewline
111 & 0.0953 & 0.0806 & 0.0534 & 0.0533 & 112550.3259 & 59926.2283 & 244.7983 & 1.4761 & 0.8976 \tabularnewline
112 & 0.0989 & 0.0244 & 0.0502 & 0.0501 & 9117.4253 & 54280.8057 & 232.9824 & 0.4201 & 0.8445 \tabularnewline
113 & 0.1024 & 0.0092 & 0.0461 & 0.046 & 1259.2001 & 48978.6452 & 221.3112 & 0.1561 & 0.7757 \tabularnewline
114 & 0.1059 & 0.0092 & 0.0427 & 0.0427 & 1259.2001 & 44640.5138 & 211.283 & 0.1561 & 0.7194 \tabularnewline
115 & 0.1092 & -0.0118 & 0.0402 & 0.0401 & 1981.5666 & 41085.6015 & 202.6958 & -0.1959 & 0.6757 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=303007&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]104[/C][C]0.0664[/C][C]-0.018[/C][C]0.018[/C][C]0.0178[/C][C]4557.3247[/C][C]0[/C][C]0[/C][C]-0.297[/C][C]0.297[/C][/ROW]
[ROW][C]105[/C][C]0.0707[/C][C]-0.0865[/C][C]0.0522[/C][C]0.0503[/C][C]92677.8158[/C][C]48617.5703[/C][C]220.4939[/C][C]-1.3395[/C][C]0.8183[/C][/ROW]
[ROW][C]106[/C][C]0.0753[/C][C]-0.0065[/C][C]0.037[/C][C]0.0357[/C][C]601.0919[/C][C]32612.0775[/C][C]180.5881[/C][C]-0.1079[/C][C]0.5815[/C][/ROW]
[ROW][C]107[/C][C]0.0796[/C][C]-0.0865[/C][C]0.0494[/C][C]0.0475[/C][C]92729.2165[/C][C]47641.3622[/C][C]218.269[/C][C]-1.3399[/C][C]0.7711[/C][/ROW]
[ROW][C]108[/C][C]0.0837[/C][C]-0.0507[/C][C]0.0496[/C][C]0.0479[/C][C]34045.7086[/C][C]44922.2315[/C][C]211.9487[/C][C]-0.8119[/C][C]0.7792[/C][/ROW]
[ROW][C]109[/C][C]0.0877[/C][C]0.0894[/C][C]0.0562[/C][C]0.0555[/C][C]140989.1427[/C][C]60933.3834[/C][C]246.8469[/C][C]1.6521[/C][C]0.9247[/C][/ROW]
[ROW][C]110[/C][C]0.0916[/C][C]0.0092[/C][C]0.0495[/C][C]0.0489[/C][C]1259.2001[/C][C]52408.5[/C][C]228.929[/C][C]0.1561[/C][C]0.8149[/C][/ROW]
[ROW][C]111[/C][C]0.0953[/C][C]0.0806[/C][C]0.0534[/C][C]0.0533[/C][C]112550.3259[/C][C]59926.2283[/C][C]244.7983[/C][C]1.4761[/C][C]0.8976[/C][/ROW]
[ROW][C]112[/C][C]0.0989[/C][C]0.0244[/C][C]0.0502[/C][C]0.0501[/C][C]9117.4253[/C][C]54280.8057[/C][C]232.9824[/C][C]0.4201[/C][C]0.8445[/C][/ROW]
[ROW][C]113[/C][C]0.1024[/C][C]0.0092[/C][C]0.0461[/C][C]0.046[/C][C]1259.2001[/C][C]48978.6452[/C][C]221.3112[/C][C]0.1561[/C][C]0.7757[/C][/ROW]
[ROW][C]114[/C][C]0.1059[/C][C]0.0092[/C][C]0.0427[/C][C]0.0427[/C][C]1259.2001[/C][C]44640.5138[/C][C]211.283[/C][C]0.1561[/C][C]0.7194[/C][/ROW]
[ROW][C]115[/C][C]0.1092[/C][C]-0.0118[/C][C]0.0402[/C][C]0.0401[/C][C]1981.5666[/C][C]41085.6015[/C][C]202.6958[/C][C]-0.1959[/C][C]0.6757[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=303007&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=303007&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
1040.0664-0.0180.0180.01784557.324700-0.2970.297
1050.0707-0.08650.05220.050392677.815848617.5703220.4939-1.33950.8183
1060.0753-0.00650.0370.0357601.091932612.0775180.5881-0.10790.5815
1070.0796-0.08650.04940.047592729.216547641.3622218.269-1.33990.7711
1080.0837-0.05070.04960.047934045.708644922.2315211.9487-0.81190.7792
1090.08770.08940.05620.0555140989.142760933.3834246.84691.65210.9247
1100.09160.00920.04950.04891259.200152408.5228.9290.15610.8149
1110.09530.08060.05340.0533112550.325959926.2283244.79831.47610.8976
1120.09890.02440.05020.05019117.425354280.8057232.98240.42010.8445
1130.10240.00920.04610.0461259.200148978.6452221.31120.15610.7757
1140.10590.00920.04270.04271259.200144640.5138211.2830.15610.7194
1150.1092-0.01180.04020.04011981.566641085.6015202.6958-0.19590.6757



Parameters (Session):
par1 = 0.0 ; par2 = 1 ; par3 = 0 ; par4 = 12 ;
Parameters (R input):
par1 = 12 ; par2 = 0.0 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '0'
par8 <- '0'
par7 <- '2'
par6 <- '3'
par5 <- '12'
par4 <- '0'
par3 <- '1'
par2 <- '0.0'
par1 <- '12'
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')