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, 07 Dec 2016 16:02:06 +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/07/t148112299500vipftu4xmyowm.htm/, Retrieved Wed, 08 May 2024 01:33:13 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=298184, Retrieved Wed, 08 May 2024 01:33:13 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact61
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [N1895] [2016-12-07 15:02:06] [85f5800284aab30c091766186b093bb4] [Current]
Feedback Forum

Post a new message
Dataseries X:
5550
5530
6070
6120
5840
6360
6300
6400
5490
5630
5580
5780
5670
6030
6760
6050
5910
6510
6360
6460
5710
5910
5680
5690
5360
5380
6000
5950
5960
6440
6190
6550
5780
5800
5720
5730
5530
5650
6750
6370
6500
7050
6570
6710
5570
5610
5430
5910
5510
5790
6420
6020
5870
6210
6430
6920
5710
5800
5690
5880
5560
5860
6510
6460
6360
6530
6840
7110
5860
5960
5770
5810
5580
5750
6440
6260
6250
6660
6820
7090
6030
6190
5980
5830
5620
5690
6500
6200
6250
6970
6950
7240
6050
6190
6050
5990
5730
5920
6350
6190
6080
6710
6780
7120
6010
6020
5890
5960
5690
5620
5980
6320
6340
6670
6790
7120
6120
6160
5840
6260
5650
5730
6250
6000
6160
6910




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=298184&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])
1026710-------
1036780-------
1047120-------
1056010-------
1066020-------
1075890-------
1085960-------
1095690-------
1105620-------
1115980-------
1126320-------
1136340-------
1146670-------
11567906768.54516302.4437356.16280.47150.62880.48480.6288
11671207130.33466491.88668003.84990.49070.77750.50930.8492
11761206025.86675599.25816567.66930.366700.52290.0099
11861606042.5345600.58266608.89810.34220.39430.53110.0149
11958405915.28165493.33916452.2560.39170.18590.53680.0029
12062605989.13325549.50986553.08720.17330.69790.54030.009
12156505717.06095329.68256203.39270.39350.01430.54341e-04
12257305647.19545272.26096115.48930.36450.49530.54530
12362506013.71415566.31016589.86110.21070.83280.54570.0128
12460006360.57265837.63867055.04990.15440.62250.54560.1913
12561606381.46375853.5917083.91940.26830.85640.54610.2104
12669106718.72826110.47787554.34710.32680.9050.54550.5455

\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 & 6710 & - & - & - & - & - & - & - \tabularnewline
103 & 6780 & - & - & - & - & - & - & - \tabularnewline
104 & 7120 & - & - & - & - & - & - & - \tabularnewline
105 & 6010 & - & - & - & - & - & - & - \tabularnewline
106 & 6020 & - & - & - & - & - & - & - \tabularnewline
107 & 5890 & - & - & - & - & - & - & - \tabularnewline
108 & 5960 & - & - & - & - & - & - & - \tabularnewline
109 & 5690 & - & - & - & - & - & - & - \tabularnewline
110 & 5620 & - & - & - & - & - & - & - \tabularnewline
111 & 5980 & - & - & - & - & - & - & - \tabularnewline
112 & 6320 & - & - & - & - & - & - & - \tabularnewline
113 & 6340 & - & - & - & - & - & - & - \tabularnewline
114 & 6670 & - & - & - & - & - & - & - \tabularnewline
115 & 6790 & 6768.5451 & 6302.443 & 7356.1628 & 0.4715 & 0.6288 & 0.4848 & 0.6288 \tabularnewline
116 & 7120 & 7130.3346 & 6491.8866 & 8003.8499 & 0.4907 & 0.7775 & 0.5093 & 0.8492 \tabularnewline
117 & 6120 & 6025.8667 & 5599.2581 & 6567.6693 & 0.3667 & 0 & 0.5229 & 0.0099 \tabularnewline
118 & 6160 & 6042.534 & 5600.5826 & 6608.8981 & 0.3422 & 0.3943 & 0.5311 & 0.0149 \tabularnewline
119 & 5840 & 5915.2816 & 5493.3391 & 6452.256 & 0.3917 & 0.1859 & 0.5368 & 0.0029 \tabularnewline
120 & 6260 & 5989.1332 & 5549.5098 & 6553.0872 & 0.1733 & 0.6979 & 0.5403 & 0.009 \tabularnewline
121 & 5650 & 5717.0609 & 5329.6825 & 6203.3927 & 0.3935 & 0.0143 & 0.5434 & 1e-04 \tabularnewline
122 & 5730 & 5647.1954 & 5272.2609 & 6115.4893 & 0.3645 & 0.4953 & 0.5453 & 0 \tabularnewline
123 & 6250 & 6013.7141 & 5566.3101 & 6589.8611 & 0.2107 & 0.8328 & 0.5457 & 0.0128 \tabularnewline
124 & 6000 & 6360.5726 & 5837.6386 & 7055.0499 & 0.1544 & 0.6225 & 0.5456 & 0.1913 \tabularnewline
125 & 6160 & 6381.4637 & 5853.591 & 7083.9194 & 0.2683 & 0.8564 & 0.5461 & 0.2104 \tabularnewline
126 & 6910 & 6718.7282 & 6110.4778 & 7554.3471 & 0.3268 & 0.905 & 0.5455 & 0.5455 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=298184&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]6710[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]6780[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]7120[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]6010[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]6020[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]5890[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]5960[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]5690[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]5620[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]5980[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]6320[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]6340[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]6670[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]6790[/C][C]6768.5451[/C][C]6302.443[/C][C]7356.1628[/C][C]0.4715[/C][C]0.6288[/C][C]0.4848[/C][C]0.6288[/C][/ROW]
[ROW][C]116[/C][C]7120[/C][C]7130.3346[/C][C]6491.8866[/C][C]8003.8499[/C][C]0.4907[/C][C]0.7775[/C][C]0.5093[/C][C]0.8492[/C][/ROW]
[ROW][C]117[/C][C]6120[/C][C]6025.8667[/C][C]5599.2581[/C][C]6567.6693[/C][C]0.3667[/C][C]0[/C][C]0.5229[/C][C]0.0099[/C][/ROW]
[ROW][C]118[/C][C]6160[/C][C]6042.534[/C][C]5600.5826[/C][C]6608.8981[/C][C]0.3422[/C][C]0.3943[/C][C]0.5311[/C][C]0.0149[/C][/ROW]
[ROW][C]119[/C][C]5840[/C][C]5915.2816[/C][C]5493.3391[/C][C]6452.256[/C][C]0.3917[/C][C]0.1859[/C][C]0.5368[/C][C]0.0029[/C][/ROW]
[ROW][C]120[/C][C]6260[/C][C]5989.1332[/C][C]5549.5098[/C][C]6553.0872[/C][C]0.1733[/C][C]0.6979[/C][C]0.5403[/C][C]0.009[/C][/ROW]
[ROW][C]121[/C][C]5650[/C][C]5717.0609[/C][C]5329.6825[/C][C]6203.3927[/C][C]0.3935[/C][C]0.0143[/C][C]0.5434[/C][C]1e-04[/C][/ROW]
[ROW][C]122[/C][C]5730[/C][C]5647.1954[/C][C]5272.2609[/C][C]6115.4893[/C][C]0.3645[/C][C]0.4953[/C][C]0.5453[/C][C]0[/C][/ROW]
[ROW][C]123[/C][C]6250[/C][C]6013.7141[/C][C]5566.3101[/C][C]6589.8611[/C][C]0.2107[/C][C]0.8328[/C][C]0.5457[/C][C]0.0128[/C][/ROW]
[ROW][C]124[/C][C]6000[/C][C]6360.5726[/C][C]5837.6386[/C][C]7055.0499[/C][C]0.1544[/C][C]0.6225[/C][C]0.5456[/C][C]0.1913[/C][/ROW]
[ROW][C]125[/C][C]6160[/C][C]6381.4637[/C][C]5853.591[/C][C]7083.9194[/C][C]0.2683[/C][C]0.8564[/C][C]0.5461[/C][C]0.2104[/C][/ROW]
[ROW][C]126[/C][C]6910[/C][C]6718.7282[/C][C]6110.4778[/C][C]7554.3471[/C][C]0.3268[/C][C]0.905[/C][C]0.5455[/C][C]0.5455[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=298184&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=298184&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])
1026710-------
1036780-------
1047120-------
1056010-------
1066020-------
1075890-------
1085960-------
1095690-------
1105620-------
1115980-------
1126320-------
1136340-------
1146670-------
11567906768.54516302.4437356.16280.47150.62880.48480.6288
11671207130.33466491.88668003.84990.49070.77750.50930.8492
11761206025.86675599.25816567.66930.366700.52290.0099
11861606042.5345600.58266608.89810.34220.39430.53110.0149
11958405915.28165493.33916452.2560.39170.18590.53680.0029
12062605989.13325549.50986553.08720.17330.69790.54030.009
12156505717.06095329.68256203.39270.39350.01430.54341e-04
12257305647.19545272.26096115.48930.36450.49530.54530
12362506013.71415566.31016589.86110.21070.83280.54570.0128
12460006360.57265837.63867055.04990.15440.62250.54560.1913
12561606381.46375853.5917083.91940.26830.85640.54610.2104
12669106718.72826110.47787554.34710.32680.9050.54550.5455







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.04430.00320.00320.0032460.3113000.05270.0527
1160.0625-0.00150.00230.0023106.8044283.557916.8392-0.02540.039
1170.04590.01540.00670.00678861.07953142.731856.06010.23110.1031
1180.04780.01910.00980.009813798.26255806.614576.20110.28840.1494
1190.0463-0.01290.01040.01045667.32475778.756576.0181-0.18480.1565
1200.0480.04330.01590.016173368.829717043.7687130.55180.66510.2413
1210.0434-0.01190.01530.01554497.161615251.3963123.4965-0.16470.2303
1220.04230.01450.01520.01536856.607314202.0476119.17230.20330.2269
1230.04890.03780.01770.017955831.033318827.4905137.21330.58020.2662
1240.0557-0.06010.02190.022130012.632229946.0047173.0491-0.88530.3281
1250.0562-0.0360.02320.023249046.181431682.3844177.9955-0.54380.3477
1260.06350.02770.02360.023636584.882832090.9259179.13940.46960.3579

\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.0443 & 0.0032 & 0.0032 & 0.0032 & 460.3113 & 0 & 0 & 0.0527 & 0.0527 \tabularnewline
116 & 0.0625 & -0.0015 & 0.0023 & 0.0023 & 106.8044 & 283.5579 & 16.8392 & -0.0254 & 0.039 \tabularnewline
117 & 0.0459 & 0.0154 & 0.0067 & 0.0067 & 8861.0795 & 3142.7318 & 56.0601 & 0.2311 & 0.1031 \tabularnewline
118 & 0.0478 & 0.0191 & 0.0098 & 0.0098 & 13798.2625 & 5806.6145 & 76.2011 & 0.2884 & 0.1494 \tabularnewline
119 & 0.0463 & -0.0129 & 0.0104 & 0.0104 & 5667.3247 & 5778.7565 & 76.0181 & -0.1848 & 0.1565 \tabularnewline
120 & 0.048 & 0.0433 & 0.0159 & 0.0161 & 73368.8297 & 17043.7687 & 130.5518 & 0.6651 & 0.2413 \tabularnewline
121 & 0.0434 & -0.0119 & 0.0153 & 0.0155 & 4497.1616 & 15251.3963 & 123.4965 & -0.1647 & 0.2303 \tabularnewline
122 & 0.0423 & 0.0145 & 0.0152 & 0.0153 & 6856.6073 & 14202.0476 & 119.1723 & 0.2033 & 0.2269 \tabularnewline
123 & 0.0489 & 0.0378 & 0.0177 & 0.0179 & 55831.0333 & 18827.4905 & 137.2133 & 0.5802 & 0.2662 \tabularnewline
124 & 0.0557 & -0.0601 & 0.0219 & 0.022 & 130012.6322 & 29946.0047 & 173.0491 & -0.8853 & 0.3281 \tabularnewline
125 & 0.0562 & -0.036 & 0.0232 & 0.0232 & 49046.1814 & 31682.3844 & 177.9955 & -0.5438 & 0.3477 \tabularnewline
126 & 0.0635 & 0.0277 & 0.0236 & 0.0236 & 36584.8828 & 32090.9259 & 179.1394 & 0.4696 & 0.3579 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=298184&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.0443[/C][C]0.0032[/C][C]0.0032[/C][C]0.0032[/C][C]460.3113[/C][C]0[/C][C]0[/C][C]0.0527[/C][C]0.0527[/C][/ROW]
[ROW][C]116[/C][C]0.0625[/C][C]-0.0015[/C][C]0.0023[/C][C]0.0023[/C][C]106.8044[/C][C]283.5579[/C][C]16.8392[/C][C]-0.0254[/C][C]0.039[/C][/ROW]
[ROW][C]117[/C][C]0.0459[/C][C]0.0154[/C][C]0.0067[/C][C]0.0067[/C][C]8861.0795[/C][C]3142.7318[/C][C]56.0601[/C][C]0.2311[/C][C]0.1031[/C][/ROW]
[ROW][C]118[/C][C]0.0478[/C][C]0.0191[/C][C]0.0098[/C][C]0.0098[/C][C]13798.2625[/C][C]5806.6145[/C][C]76.2011[/C][C]0.2884[/C][C]0.1494[/C][/ROW]
[ROW][C]119[/C][C]0.0463[/C][C]-0.0129[/C][C]0.0104[/C][C]0.0104[/C][C]5667.3247[/C][C]5778.7565[/C][C]76.0181[/C][C]-0.1848[/C][C]0.1565[/C][/ROW]
[ROW][C]120[/C][C]0.048[/C][C]0.0433[/C][C]0.0159[/C][C]0.0161[/C][C]73368.8297[/C][C]17043.7687[/C][C]130.5518[/C][C]0.6651[/C][C]0.2413[/C][/ROW]
[ROW][C]121[/C][C]0.0434[/C][C]-0.0119[/C][C]0.0153[/C][C]0.0155[/C][C]4497.1616[/C][C]15251.3963[/C][C]123.4965[/C][C]-0.1647[/C][C]0.2303[/C][/ROW]
[ROW][C]122[/C][C]0.0423[/C][C]0.0145[/C][C]0.0152[/C][C]0.0153[/C][C]6856.6073[/C][C]14202.0476[/C][C]119.1723[/C][C]0.2033[/C][C]0.2269[/C][/ROW]
[ROW][C]123[/C][C]0.0489[/C][C]0.0378[/C][C]0.0177[/C][C]0.0179[/C][C]55831.0333[/C][C]18827.4905[/C][C]137.2133[/C][C]0.5802[/C][C]0.2662[/C][/ROW]
[ROW][C]124[/C][C]0.0557[/C][C]-0.0601[/C][C]0.0219[/C][C]0.022[/C][C]130012.6322[/C][C]29946.0047[/C][C]173.0491[/C][C]-0.8853[/C][C]0.3281[/C][/ROW]
[ROW][C]125[/C][C]0.0562[/C][C]-0.036[/C][C]0.0232[/C][C]0.0232[/C][C]49046.1814[/C][C]31682.3844[/C][C]177.9955[/C][C]-0.5438[/C][C]0.3477[/C][/ROW]
[ROW][C]126[/C][C]0.0635[/C][C]0.0277[/C][C]0.0236[/C][C]0.0236[/C][C]36584.8828[/C][C]32090.9259[/C][C]179.1394[/C][C]0.4696[/C][C]0.3579[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=298184&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=298184&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.04430.00320.00320.0032460.3113000.05270.0527
1160.0625-0.00150.00230.0023106.8044283.557916.8392-0.02540.039
1170.04590.01540.00670.00678861.07953142.731856.06010.23110.1031
1180.04780.01910.00980.009813798.26255806.614576.20110.28840.1494
1190.0463-0.01290.01040.01045667.32475778.756576.0181-0.18480.1565
1200.0480.04330.01590.016173368.829717043.7687130.55180.66510.2413
1210.0434-0.01190.01530.01554497.161615251.3963123.4965-0.16470.2303
1220.04230.01450.01520.01536856.607314202.0476119.17230.20330.2269
1230.04890.03780.01770.017955831.033318827.4905137.21330.58020.2662
1240.0557-0.06010.02190.022130012.632229946.0047173.0491-0.88530.3281
1250.0562-0.0360.02320.023249046.181431682.3844177.9955-0.54380.3477
1260.06350.02770.02360.023636584.882832090.9259179.13940.46960.3579



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