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 18:03:21 +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/t14823416652oalxmuuq4qy0tp.htm/, Retrieved Fri, 01 Nov 2024 03:36:40 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302438, Retrieved Fri, 01 Nov 2024 03:36:40 +0000
QR Codes:

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

Post a new message
Dataseries X:
3455
3585
3675
3680
3735
3860
3765
3905
4110
4170
4110
4025
4145
4285
4370
4355
4385
4525
4375
4525
4610
4595
4500
4370
4390
4530
4590
4580
4595
4685
4490
4635
4710
4655
4665
4550
4590
4675
4645
4665
4635
4720
4565
4720
4830
4830
4765
4705
4675
4900
4945
4905
4955
5120
4860
5040
5140
5240
5145
5070
5085
5215
5255
5275
5315
5450
5205
5370
5500
5490
5440
5360
5380
5460
5450
5520
5475
5600
5250
5465
5515
5425
5325
5275
5160
5360
5435
5285
5415
5575
5265
5480
5565
5500
5280
5135
5050
5100
5070
5115
5140
5330
5080
5285
5405
5385
5255
5100
5040
5235
5310
5265
5380
5465
5225
5445




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 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 time2 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302438&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]2 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=302438&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302438&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 time2 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[104])
925480-------
935565-------
945500-------
955280-------
965135-------
975050-------
985100-------
995070-------
1005115-------
1015140-------
1025330-------
1035080-------
1045285-------
10554055403.83565300.3525507.31930.49120.98780.00110.9878
10653855370.94635230.64835511.24440.42220.31710.03570.8851
10752555263.26395082.81745443.71040.46420.0930.42790.4067
10851005179.22834948.57965409.8770.25040.25980.64650.1844
10950405139.12874868.50655409.7510.23640.61160.74070.1454
11052355242.00894931.12455552.89320.48240.89860.81470.3932
11153105249.63194899.35455599.90930.36780.53260.84260.4216
11252655260.87384874.95135646.79640.49160.40150.77060.4512
11353805280.99024860.45075701.52970.32220.52970.74440.4925
11454655435.7074982.3115889.1030.44960.59520.67620.7426
11552255126.87634642.53995611.21280.34570.08560.57520.2611
11654455339.43364825.35925853.5080.34370.66870.58220.5822

\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[104]) \tabularnewline
92 & 5480 & - & - & - & - & - & - & - \tabularnewline
93 & 5565 & - & - & - & - & - & - & - \tabularnewline
94 & 5500 & - & - & - & - & - & - & - \tabularnewline
95 & 5280 & - & - & - & - & - & - & - \tabularnewline
96 & 5135 & - & - & - & - & - & - & - \tabularnewline
97 & 5050 & - & - & - & - & - & - & - \tabularnewline
98 & 5100 & - & - & - & - & - & - & - \tabularnewline
99 & 5070 & - & - & - & - & - & - & - \tabularnewline
100 & 5115 & - & - & - & - & - & - & - \tabularnewline
101 & 5140 & - & - & - & - & - & - & - \tabularnewline
102 & 5330 & - & - & - & - & - & - & - \tabularnewline
103 & 5080 & - & - & - & - & - & - & - \tabularnewline
104 & 5285 & - & - & - & - & - & - & - \tabularnewline
105 & 5405 & 5403.8356 & 5300.352 & 5507.3193 & 0.4912 & 0.9878 & 0.0011 & 0.9878 \tabularnewline
106 & 5385 & 5370.9463 & 5230.6483 & 5511.2444 & 0.4222 & 0.3171 & 0.0357 & 0.8851 \tabularnewline
107 & 5255 & 5263.2639 & 5082.8174 & 5443.7104 & 0.4642 & 0.093 & 0.4279 & 0.4067 \tabularnewline
108 & 5100 & 5179.2283 & 4948.5796 & 5409.877 & 0.2504 & 0.2598 & 0.6465 & 0.1844 \tabularnewline
109 & 5040 & 5139.1287 & 4868.5065 & 5409.751 & 0.2364 & 0.6116 & 0.7407 & 0.1454 \tabularnewline
110 & 5235 & 5242.0089 & 4931.1245 & 5552.8932 & 0.4824 & 0.8986 & 0.8147 & 0.3932 \tabularnewline
111 & 5310 & 5249.6319 & 4899.3545 & 5599.9093 & 0.3678 & 0.5326 & 0.8426 & 0.4216 \tabularnewline
112 & 5265 & 5260.8738 & 4874.9513 & 5646.7964 & 0.4916 & 0.4015 & 0.7706 & 0.4512 \tabularnewline
113 & 5380 & 5280.9902 & 4860.4507 & 5701.5297 & 0.3222 & 0.5297 & 0.7444 & 0.4925 \tabularnewline
114 & 5465 & 5435.707 & 4982.311 & 5889.103 & 0.4496 & 0.5952 & 0.6762 & 0.7426 \tabularnewline
115 & 5225 & 5126.8763 & 4642.5399 & 5611.2128 & 0.3457 & 0.0856 & 0.5752 & 0.2611 \tabularnewline
116 & 5445 & 5339.4336 & 4825.3592 & 5853.508 & 0.3437 & 0.6687 & 0.5822 & 0.5822 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302438&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[104])[/C][/ROW]
[ROW][C]92[/C][C]5480[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]5565[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]5500[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]5280[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]5135[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]5050[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]5100[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]5070[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]5115[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]5140[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]5330[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]5080[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]5285[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]5405[/C][C]5403.8356[/C][C]5300.352[/C][C]5507.3193[/C][C]0.4912[/C][C]0.9878[/C][C]0.0011[/C][C]0.9878[/C][/ROW]
[ROW][C]106[/C][C]5385[/C][C]5370.9463[/C][C]5230.6483[/C][C]5511.2444[/C][C]0.4222[/C][C]0.3171[/C][C]0.0357[/C][C]0.8851[/C][/ROW]
[ROW][C]107[/C][C]5255[/C][C]5263.2639[/C][C]5082.8174[/C][C]5443.7104[/C][C]0.4642[/C][C]0.093[/C][C]0.4279[/C][C]0.4067[/C][/ROW]
[ROW][C]108[/C][C]5100[/C][C]5179.2283[/C][C]4948.5796[/C][C]5409.877[/C][C]0.2504[/C][C]0.2598[/C][C]0.6465[/C][C]0.1844[/C][/ROW]
[ROW][C]109[/C][C]5040[/C][C]5139.1287[/C][C]4868.5065[/C][C]5409.751[/C][C]0.2364[/C][C]0.6116[/C][C]0.7407[/C][C]0.1454[/C][/ROW]
[ROW][C]110[/C][C]5235[/C][C]5242.0089[/C][C]4931.1245[/C][C]5552.8932[/C][C]0.4824[/C][C]0.8986[/C][C]0.8147[/C][C]0.3932[/C][/ROW]
[ROW][C]111[/C][C]5310[/C][C]5249.6319[/C][C]4899.3545[/C][C]5599.9093[/C][C]0.3678[/C][C]0.5326[/C][C]0.8426[/C][C]0.4216[/C][/ROW]
[ROW][C]112[/C][C]5265[/C][C]5260.8738[/C][C]4874.9513[/C][C]5646.7964[/C][C]0.4916[/C][C]0.4015[/C][C]0.7706[/C][C]0.4512[/C][/ROW]
[ROW][C]113[/C][C]5380[/C][C]5280.9902[/C][C]4860.4507[/C][C]5701.5297[/C][C]0.3222[/C][C]0.5297[/C][C]0.7444[/C][C]0.4925[/C][/ROW]
[ROW][C]114[/C][C]5465[/C][C]5435.707[/C][C]4982.311[/C][C]5889.103[/C][C]0.4496[/C][C]0.5952[/C][C]0.6762[/C][C]0.7426[/C][/ROW]
[ROW][C]115[/C][C]5225[/C][C]5126.8763[/C][C]4642.5399[/C][C]5611.2128[/C][C]0.3457[/C][C]0.0856[/C][C]0.5752[/C][C]0.2611[/C][/ROW]
[ROW][C]116[/C][C]5445[/C][C]5339.4336[/C][C]4825.3592[/C][C]5853.508[/C][C]0.3437[/C][C]0.6687[/C][C]0.5822[/C][C]0.5822[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302438&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302438&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[104])
925480-------
935565-------
945500-------
955280-------
965135-------
975050-------
985100-------
995070-------
1005115-------
1015140-------
1025330-------
1035080-------
1045285-------
10554055403.83565300.3525507.31930.49120.98780.00110.9878
10653855370.94635230.64835511.24440.42220.31710.03570.8851
10752555263.26395082.81745443.71040.46420.0930.42790.4067
10851005179.22834948.57965409.8770.25040.25980.64650.1844
10950405139.12874868.50655409.7510.23640.61160.74070.1454
11052355242.00894931.12455552.89320.48240.89860.81470.3932
11153105249.63194899.35455599.90930.36780.53260.84260.4216
11252655260.87384874.95135646.79640.49160.40150.77060.4512
11353805280.99024860.45075701.52970.32220.52970.74440.4925
11454655435.7074982.3115889.1030.44960.59520.67620.7426
11552255126.87634642.53995611.21280.34570.08560.57520.2611
11654455339.43364825.35925853.5080.34370.66870.58220.5822







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1050.00982e-042e-042e-041.3558000.00960.0096
1060.01330.00260.00140.0014197.505399.43069.97150.11540.0625
1070.0175-0.00160.00150.001568.292889.05139.4367-0.06780.0643
1080.0227-0.01550.0050.0056277.12411636.069540.4484-0.65040.2108
1090.0269-0.01970.00790.00799826.50833274.157357.2203-0.81370.3314
1100.0303-0.00130.00680.006849.12412736.651752.313-0.05750.2857
1110.0340.01140.00750.00743644.30722866.316853.5380.49560.3157
1120.03748e-040.00660.006617.02512510.155350.10150.03390.2805
1130.04060.01840.00790.00799802.94363320.465257.62350.81280.3396
1140.04260.00540.00770.0077858.08193074.226855.44570.24050.3297
1150.04820.01880.00870.00879628.25213670.047360.58090.80550.373
1160.04910.01940.00960.009611144.26214292.898665.52020.86660.4141

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
105 & 0.0098 & 2e-04 & 2e-04 & 2e-04 & 1.3558 & 0 & 0 & 0.0096 & 0.0096 \tabularnewline
106 & 0.0133 & 0.0026 & 0.0014 & 0.0014 & 197.5053 & 99.4306 & 9.9715 & 0.1154 & 0.0625 \tabularnewline
107 & 0.0175 & -0.0016 & 0.0015 & 0.0015 & 68.2928 & 89.0513 & 9.4367 & -0.0678 & 0.0643 \tabularnewline
108 & 0.0227 & -0.0155 & 0.005 & 0.005 & 6277.1241 & 1636.0695 & 40.4484 & -0.6504 & 0.2108 \tabularnewline
109 & 0.0269 & -0.0197 & 0.0079 & 0.0079 & 9826.5083 & 3274.1573 & 57.2203 & -0.8137 & 0.3314 \tabularnewline
110 & 0.0303 & -0.0013 & 0.0068 & 0.0068 & 49.1241 & 2736.6517 & 52.313 & -0.0575 & 0.2857 \tabularnewline
111 & 0.034 & 0.0114 & 0.0075 & 0.0074 & 3644.3072 & 2866.3168 & 53.538 & 0.4956 & 0.3157 \tabularnewline
112 & 0.0374 & 8e-04 & 0.0066 & 0.0066 & 17.0251 & 2510.1553 & 50.1015 & 0.0339 & 0.2805 \tabularnewline
113 & 0.0406 & 0.0184 & 0.0079 & 0.0079 & 9802.9436 & 3320.4652 & 57.6235 & 0.8128 & 0.3396 \tabularnewline
114 & 0.0426 & 0.0054 & 0.0077 & 0.0077 & 858.0819 & 3074.2268 & 55.4457 & 0.2405 & 0.3297 \tabularnewline
115 & 0.0482 & 0.0188 & 0.0087 & 0.0087 & 9628.2521 & 3670.0473 & 60.5809 & 0.8055 & 0.373 \tabularnewline
116 & 0.0491 & 0.0194 & 0.0096 & 0.0096 & 11144.2621 & 4292.8986 & 65.5202 & 0.8666 & 0.4141 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302438&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]105[/C][C]0.0098[/C][C]2e-04[/C][C]2e-04[/C][C]2e-04[/C][C]1.3558[/C][C]0[/C][C]0[/C][C]0.0096[/C][C]0.0096[/C][/ROW]
[ROW][C]106[/C][C]0.0133[/C][C]0.0026[/C][C]0.0014[/C][C]0.0014[/C][C]197.5053[/C][C]99.4306[/C][C]9.9715[/C][C]0.1154[/C][C]0.0625[/C][/ROW]
[ROW][C]107[/C][C]0.0175[/C][C]-0.0016[/C][C]0.0015[/C][C]0.0015[/C][C]68.2928[/C][C]89.0513[/C][C]9.4367[/C][C]-0.0678[/C][C]0.0643[/C][/ROW]
[ROW][C]108[/C][C]0.0227[/C][C]-0.0155[/C][C]0.005[/C][C]0.005[/C][C]6277.1241[/C][C]1636.0695[/C][C]40.4484[/C][C]-0.6504[/C][C]0.2108[/C][/ROW]
[ROW][C]109[/C][C]0.0269[/C][C]-0.0197[/C][C]0.0079[/C][C]0.0079[/C][C]9826.5083[/C][C]3274.1573[/C][C]57.2203[/C][C]-0.8137[/C][C]0.3314[/C][/ROW]
[ROW][C]110[/C][C]0.0303[/C][C]-0.0013[/C][C]0.0068[/C][C]0.0068[/C][C]49.1241[/C][C]2736.6517[/C][C]52.313[/C][C]-0.0575[/C][C]0.2857[/C][/ROW]
[ROW][C]111[/C][C]0.034[/C][C]0.0114[/C][C]0.0075[/C][C]0.0074[/C][C]3644.3072[/C][C]2866.3168[/C][C]53.538[/C][C]0.4956[/C][C]0.3157[/C][/ROW]
[ROW][C]112[/C][C]0.0374[/C][C]8e-04[/C][C]0.0066[/C][C]0.0066[/C][C]17.0251[/C][C]2510.1553[/C][C]50.1015[/C][C]0.0339[/C][C]0.2805[/C][/ROW]
[ROW][C]113[/C][C]0.0406[/C][C]0.0184[/C][C]0.0079[/C][C]0.0079[/C][C]9802.9436[/C][C]3320.4652[/C][C]57.6235[/C][C]0.8128[/C][C]0.3396[/C][/ROW]
[ROW][C]114[/C][C]0.0426[/C][C]0.0054[/C][C]0.0077[/C][C]0.0077[/C][C]858.0819[/C][C]3074.2268[/C][C]55.4457[/C][C]0.2405[/C][C]0.3297[/C][/ROW]
[ROW][C]115[/C][C]0.0482[/C][C]0.0188[/C][C]0.0087[/C][C]0.0087[/C][C]9628.2521[/C][C]3670.0473[/C][C]60.5809[/C][C]0.8055[/C][C]0.373[/C][/ROW]
[ROW][C]116[/C][C]0.0491[/C][C]0.0194[/C][C]0.0096[/C][C]0.0096[/C][C]11144.2621[/C][C]4292.8986[/C][C]65.5202[/C][C]0.8666[/C][C]0.4141[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302438&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302438&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
1050.00982e-042e-042e-041.3558000.00960.0096
1060.01330.00260.00140.0014197.505399.43069.97150.11540.0625
1070.0175-0.00160.00150.001568.292889.05139.4367-0.06780.0643
1080.0227-0.01550.0050.0056277.12411636.069540.4484-0.65040.2108
1090.0269-0.01970.00790.00799826.50833274.157357.2203-0.81370.3314
1100.0303-0.00130.00680.006849.12412736.651752.313-0.05750.2857
1110.0340.01140.00750.00743644.30722866.316853.5380.49560.3157
1120.03748e-040.00660.006617.02512510.155350.10150.03390.2805
1130.04060.01840.00790.00799802.94363320.465257.62350.81280.3396
1140.04260.00540.00770.0077858.08193074.226855.44570.24050.3297
1150.04820.01880.00870.00879628.25213670.047360.58090.80550.373
1160.04910.01940.00960.009611144.26214292.898665.52020.86660.4141



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