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 16:51:17 +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/t1481730697561jmmbiuilj75o.htm/, Retrieved Fri, 03 May 2024 18:23:09 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=299582, Retrieved Fri, 03 May 2024 18:23:09 +0000
QR Codes:

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

Post a new message
Dataseries X:
4550
4820
4800
4760
4610
4480
3440
4420
4190
4460
4190
4150
4130
3740
4100
4130
4250
3730
3720
3960
4340
4890
4840
4570
4440
4860
4760
4850
4660
4670
4450
5000
4900
5170
4810
4130
4130
4320
4640
4390
4470
3490
4110
4550
5080
5390
5420
4340
4980
5290
5320
5020
5910
4600
4100
5020
4620
5130
5080
4750
5000
4990
5440
5560
5930
5390
5990
6340
5330
6730
5590
5510
5220
5750
6010
5590
5220
5940
5530
5630
6070
6180
6160
5970
6210
5860
6750
6410
6530
6630
6160
6590
6440
7350
6710
6690
6870
6960
7300
6940
6690
6790
6700
7180
7100
7750
7230
7730
7900
7440
7100
7200
7200
7070
6980
7000
7230
7460
7070
7590
7610
7150
6650
7100
7330
7230




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299582&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])
1026790-------
1036699.99999999999-------
1047180-------
1057100-------
1067750-------
1077230-------
1087730-------
1097900-------
1107440-------
1117100-------
1127200-------
1137200-------
1147070-------
11569806793.17515849.04547889.70260.36920.31040.56610.3104
11670007456.1266288.06138841.16950.25930.74980.6520.7076
11772307341.33345985.45899004.35150.44780.65630.6120.6254
11874608118.39786471.966510183.6720.2660.80040.63670.8401
11970707627.06265941.6329790.59020.30690.56010.64050.6931
12075907404.90835654.42929697.29480.43710.61270.39050.6127
12176107562.41035665.60910094.24580.48530.49150.39690.6485
12271507576.50775576.837810293.19320.37920.49040.53920.6426
12366507868.35735695.287810870.57370.21320.68050.6920.6989
12471007671.76075465.325510768.96740.35870.74110.61740.6483
12573307713.08045411.790710992.96190.40950.6430.62040.6496
12672307449.26885151.034310772.90540.44860.5280.58850.5885

\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 & 6790 & - & - & - & - & - & - & - \tabularnewline
103 & 6699.99999999999 & - & - & - & - & - & - & - \tabularnewline
104 & 7180 & - & - & - & - & - & - & - \tabularnewline
105 & 7100 & - & - & - & - & - & - & - \tabularnewline
106 & 7750 & - & - & - & - & - & - & - \tabularnewline
107 & 7230 & - & - & - & - & - & - & - \tabularnewline
108 & 7730 & - & - & - & - & - & - & - \tabularnewline
109 & 7900 & - & - & - & - & - & - & - \tabularnewline
110 & 7440 & - & - & - & - & - & - & - \tabularnewline
111 & 7100 & - & - & - & - & - & - & - \tabularnewline
112 & 7200 & - & - & - & - & - & - & - \tabularnewline
113 & 7200 & - & - & - & - & - & - & - \tabularnewline
114 & 7070 & - & - & - & - & - & - & - \tabularnewline
115 & 6980 & 6793.1751 & 5849.0454 & 7889.7026 & 0.3692 & 0.3104 & 0.5661 & 0.3104 \tabularnewline
116 & 7000 & 7456.126 & 6288.0613 & 8841.1695 & 0.2593 & 0.7498 & 0.652 & 0.7076 \tabularnewline
117 & 7230 & 7341.3334 & 5985.4589 & 9004.3515 & 0.4478 & 0.6563 & 0.612 & 0.6254 \tabularnewline
118 & 7460 & 8118.3978 & 6471.9665 & 10183.672 & 0.266 & 0.8004 & 0.6367 & 0.8401 \tabularnewline
119 & 7070 & 7627.0626 & 5941.632 & 9790.5902 & 0.3069 & 0.5601 & 0.6405 & 0.6931 \tabularnewline
120 & 7590 & 7404.9083 & 5654.4292 & 9697.2948 & 0.4371 & 0.6127 & 0.3905 & 0.6127 \tabularnewline
121 & 7610 & 7562.4103 & 5665.609 & 10094.2458 & 0.4853 & 0.4915 & 0.3969 & 0.6485 \tabularnewline
122 & 7150 & 7576.5077 & 5576.8378 & 10293.1932 & 0.3792 & 0.4904 & 0.5392 & 0.6426 \tabularnewline
123 & 6650 & 7868.3573 & 5695.2878 & 10870.5737 & 0.2132 & 0.6805 & 0.692 & 0.6989 \tabularnewline
124 & 7100 & 7671.7607 & 5465.3255 & 10768.9674 & 0.3587 & 0.7411 & 0.6174 & 0.6483 \tabularnewline
125 & 7330 & 7713.0804 & 5411.7907 & 10992.9619 & 0.4095 & 0.643 & 0.6204 & 0.6496 \tabularnewline
126 & 7230 & 7449.2688 & 5151.0343 & 10772.9054 & 0.4486 & 0.528 & 0.5885 & 0.5885 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299582&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]6790[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]6699.99999999999[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]7180[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]7100[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]7750[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]7230[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]7730[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]7900[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]7440[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]7100[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]7200[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]7200[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]7070[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]6980[/C][C]6793.1751[/C][C]5849.0454[/C][C]7889.7026[/C][C]0.3692[/C][C]0.3104[/C][C]0.5661[/C][C]0.3104[/C][/ROW]
[ROW][C]116[/C][C]7000[/C][C]7456.126[/C][C]6288.0613[/C][C]8841.1695[/C][C]0.2593[/C][C]0.7498[/C][C]0.652[/C][C]0.7076[/C][/ROW]
[ROW][C]117[/C][C]7230[/C][C]7341.3334[/C][C]5985.4589[/C][C]9004.3515[/C][C]0.4478[/C][C]0.6563[/C][C]0.612[/C][C]0.6254[/C][/ROW]
[ROW][C]118[/C][C]7460[/C][C]8118.3978[/C][C]6471.9665[/C][C]10183.672[/C][C]0.266[/C][C]0.8004[/C][C]0.6367[/C][C]0.8401[/C][/ROW]
[ROW][C]119[/C][C]7070[/C][C]7627.0626[/C][C]5941.632[/C][C]9790.5902[/C][C]0.3069[/C][C]0.5601[/C][C]0.6405[/C][C]0.6931[/C][/ROW]
[ROW][C]120[/C][C]7590[/C][C]7404.9083[/C][C]5654.4292[/C][C]9697.2948[/C][C]0.4371[/C][C]0.6127[/C][C]0.3905[/C][C]0.6127[/C][/ROW]
[ROW][C]121[/C][C]7610[/C][C]7562.4103[/C][C]5665.609[/C][C]10094.2458[/C][C]0.4853[/C][C]0.4915[/C][C]0.3969[/C][C]0.6485[/C][/ROW]
[ROW][C]122[/C][C]7150[/C][C]7576.5077[/C][C]5576.8378[/C][C]10293.1932[/C][C]0.3792[/C][C]0.4904[/C][C]0.5392[/C][C]0.6426[/C][/ROW]
[ROW][C]123[/C][C]6650[/C][C]7868.3573[/C][C]5695.2878[/C][C]10870.5737[/C][C]0.2132[/C][C]0.6805[/C][C]0.692[/C][C]0.6989[/C][/ROW]
[ROW][C]124[/C][C]7100[/C][C]7671.7607[/C][C]5465.3255[/C][C]10768.9674[/C][C]0.3587[/C][C]0.7411[/C][C]0.6174[/C][C]0.6483[/C][/ROW]
[ROW][C]125[/C][C]7330[/C][C]7713.0804[/C][C]5411.7907[/C][C]10992.9619[/C][C]0.4095[/C][C]0.643[/C][C]0.6204[/C][C]0.6496[/C][/ROW]
[ROW][C]126[/C][C]7230[/C][C]7449.2688[/C][C]5151.0343[/C][C]10772.9054[/C][C]0.4486[/C][C]0.528[/C][C]0.5885[/C][C]0.5885[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=299582&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299582&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])
1026790-------
1036699.99999999999-------
1047180-------
1057100-------
1067750-------
1077230-------
1087730-------
1097900-------
1107440-------
1117100-------
1127200-------
1137200-------
1147070-------
11569806793.17515849.04547889.70260.36920.31040.56610.3104
11670007456.1266288.06138841.16950.25930.74980.6520.7076
11772307341.33345985.45899004.35150.44780.65630.6120.6254
11874608118.39786471.966510183.6720.2660.80040.63670.8401
11970707627.06265941.6329790.59020.30690.56010.64050.6931
12075907404.90835654.42929697.29480.43710.61270.39050.6127
12176107562.41035665.60910094.24580.48530.49150.39690.6485
12271507576.50775576.837810293.19320.37920.49040.53920.6426
12366507868.35735695.287810870.57370.21320.68050.6920.6989
12471007671.76075465.325510768.96740.35870.74110.61740.6483
12573307713.08045411.790710992.96190.40950.6430.62040.6496
12672307449.26885151.034310772.90540.44860.5280.58850.5885







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.08240.02680.02680.027134903.5292000.65240.6524
1160.0948-0.06520.0460.0451208050.9601121477.2446348.5359-1.59281.1226
1170.1156-0.01540.03580.035212395.12185116.5368291.7474-0.38880.878
1180.1298-0.08830.04890.0475433487.717172209.3318414.9811-2.29921.2333
1190.1447-0.07880.05490.0532310318.728199831.211447.0248-1.94531.3757
1200.15790.02440.04980.048434258.9245172235.8299415.0130.64641.2541
1210.17080.00630.04360.04242264.7797147954.2513384.64820.16621.0987
1220.1829-0.05970.04560.0443181908.807152198.5708390.1264-1.48941.1476
1230.1947-0.18320.06090.05811484394.4103300220.3307547.9237-4.25461.4928
1240.206-0.08050.06280.06326910.2664302889.3243550.3538-1.99661.5432
1250.217-0.05230.06190.0592146750.5991288694.8948537.3034-1.33771.5245
1260.2276-0.03030.05920.056748078.7957268643.5532518.3084-0.76571.4613

\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.0824 & 0.0268 & 0.0268 & 0.0271 & 34903.5292 & 0 & 0 & 0.6524 & 0.6524 \tabularnewline
116 & 0.0948 & -0.0652 & 0.046 & 0.0451 & 208050.9601 & 121477.2446 & 348.5359 & -1.5928 & 1.1226 \tabularnewline
117 & 0.1156 & -0.0154 & 0.0358 & 0.0352 & 12395.121 & 85116.5368 & 291.7474 & -0.3888 & 0.878 \tabularnewline
118 & 0.1298 & -0.0883 & 0.0489 & 0.0475 & 433487.717 & 172209.3318 & 414.9811 & -2.2992 & 1.2333 \tabularnewline
119 & 0.1447 & -0.0788 & 0.0549 & 0.0532 & 310318.728 & 199831.211 & 447.0248 & -1.9453 & 1.3757 \tabularnewline
120 & 0.1579 & 0.0244 & 0.0498 & 0.0484 & 34258.9245 & 172235.8299 & 415.013 & 0.6464 & 1.2541 \tabularnewline
121 & 0.1708 & 0.0063 & 0.0436 & 0.0424 & 2264.7797 & 147954.2513 & 384.6482 & 0.1662 & 1.0987 \tabularnewline
122 & 0.1829 & -0.0597 & 0.0456 & 0.0443 & 181908.807 & 152198.5708 & 390.1264 & -1.4894 & 1.1476 \tabularnewline
123 & 0.1947 & -0.1832 & 0.0609 & 0.0581 & 1484394.4103 & 300220.3307 & 547.9237 & -4.2546 & 1.4928 \tabularnewline
124 & 0.206 & -0.0805 & 0.0628 & 0.06 & 326910.2664 & 302889.3243 & 550.3538 & -1.9966 & 1.5432 \tabularnewline
125 & 0.217 & -0.0523 & 0.0619 & 0.0592 & 146750.5991 & 288694.8948 & 537.3034 & -1.3377 & 1.5245 \tabularnewline
126 & 0.2276 & -0.0303 & 0.0592 & 0.0567 & 48078.7957 & 268643.5532 & 518.3084 & -0.7657 & 1.4613 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=299582&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.0824[/C][C]0.0268[/C][C]0.0268[/C][C]0.0271[/C][C]34903.5292[/C][C]0[/C][C]0[/C][C]0.6524[/C][C]0.6524[/C][/ROW]
[ROW][C]116[/C][C]0.0948[/C][C]-0.0652[/C][C]0.046[/C][C]0.0451[/C][C]208050.9601[/C][C]121477.2446[/C][C]348.5359[/C][C]-1.5928[/C][C]1.1226[/C][/ROW]
[ROW][C]117[/C][C]0.1156[/C][C]-0.0154[/C][C]0.0358[/C][C]0.0352[/C][C]12395.121[/C][C]85116.5368[/C][C]291.7474[/C][C]-0.3888[/C][C]0.878[/C][/ROW]
[ROW][C]118[/C][C]0.1298[/C][C]-0.0883[/C][C]0.0489[/C][C]0.0475[/C][C]433487.717[/C][C]172209.3318[/C][C]414.9811[/C][C]-2.2992[/C][C]1.2333[/C][/ROW]
[ROW][C]119[/C][C]0.1447[/C][C]-0.0788[/C][C]0.0549[/C][C]0.0532[/C][C]310318.728[/C][C]199831.211[/C][C]447.0248[/C][C]-1.9453[/C][C]1.3757[/C][/ROW]
[ROW][C]120[/C][C]0.1579[/C][C]0.0244[/C][C]0.0498[/C][C]0.0484[/C][C]34258.9245[/C][C]172235.8299[/C][C]415.013[/C][C]0.6464[/C][C]1.2541[/C][/ROW]
[ROW][C]121[/C][C]0.1708[/C][C]0.0063[/C][C]0.0436[/C][C]0.0424[/C][C]2264.7797[/C][C]147954.2513[/C][C]384.6482[/C][C]0.1662[/C][C]1.0987[/C][/ROW]
[ROW][C]122[/C][C]0.1829[/C][C]-0.0597[/C][C]0.0456[/C][C]0.0443[/C][C]181908.807[/C][C]152198.5708[/C][C]390.1264[/C][C]-1.4894[/C][C]1.1476[/C][/ROW]
[ROW][C]123[/C][C]0.1947[/C][C]-0.1832[/C][C]0.0609[/C][C]0.0581[/C][C]1484394.4103[/C][C]300220.3307[/C][C]547.9237[/C][C]-4.2546[/C][C]1.4928[/C][/ROW]
[ROW][C]124[/C][C]0.206[/C][C]-0.0805[/C][C]0.0628[/C][C]0.06[/C][C]326910.2664[/C][C]302889.3243[/C][C]550.3538[/C][C]-1.9966[/C][C]1.5432[/C][/ROW]
[ROW][C]125[/C][C]0.217[/C][C]-0.0523[/C][C]0.0619[/C][C]0.0592[/C][C]146750.5991[/C][C]288694.8948[/C][C]537.3034[/C][C]-1.3377[/C][C]1.5245[/C][/ROW]
[ROW][C]126[/C][C]0.2276[/C][C]-0.0303[/C][C]0.0592[/C][C]0.0567[/C][C]48078.7957[/C][C]268643.5532[/C][C]518.3084[/C][C]-0.7657[/C][C]1.4613[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=299582&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=299582&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.08240.02680.02680.027134903.5292000.65240.6524
1160.0948-0.06520.0460.0451208050.9601121477.2446348.5359-1.59281.1226
1170.1156-0.01540.03580.035212395.12185116.5368291.7474-0.38880.878
1180.1298-0.08830.04890.0475433487.717172209.3318414.9811-2.29921.2333
1190.1447-0.07880.05490.0532310318.728199831.211447.0248-1.94531.3757
1200.15790.02440.04980.048434258.9245172235.8299415.0130.64641.2541
1210.17080.00630.04360.04242264.7797147954.2513384.64820.16621.0987
1220.1829-0.05970.04560.0443181908.807152198.5708390.1264-1.48941.1476
1230.1947-0.18320.06090.05811484394.4103300220.3307547.9237-4.25461.4928
1240.206-0.08050.06280.06326910.2664302889.3243550.3538-1.99661.5432
1250.217-0.05230.06190.0592146750.5991288694.8948537.3034-1.33771.5245
1260.2276-0.03030.05920.056748078.7957268643.5532518.3084-0.76571.4613



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