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 10:19:57 +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/t1482484833ztbqm9k5wmwy15o.htm/, Retrieved Tue, 07 May 2024 16:25:21 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302798, Retrieved Tue, 07 May 2024 16:25:21 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact80
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2016-12-23 09:19:57] [67fe698233d7575d27222b521501ef35] [Current]
Feedback Forum

Post a new message
Dataseries X:
1800
2000
2200
2250
2400
2350
2350
2250
2250
2200
2150
2150
1900
2050
2100
2100
1900
1950
1900
1950
2000
2050
1900
2050
1750
1950
2250
2150
2250
2500
2250
2300
2550
2550
2600
2900
2400
2750
3300
3200
3150
3200
3200
3250
3600
3550
3600
3600
3300
3650
4200
3900
3950
4200
4300
4350
4650
4650
4450
4750
4300
4600
5350
4750
4900
4700
4500
4700
4700
4350
4400
4450
4050
4700
5050
4750
4800
4900
5000
5050
5400
5400
5350
5600
5200
6000
6650
6050
6050
6400
6400
6100
7050
6450
6250
6600
6000
6600
7400
6650
6250
6650




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302798&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[90])
784900-------
795000-------
805050-------
815400-------
825400-------
835350-------
845600-------
855200-------
866000-------
876650-------
886050-------
896050-------
906399.99999999999-------
9164006241.97915726.57056803.7760.29070.290710.2907
9261006344.92025690.59037074.48790.25530.44120.99970.4412
9370506715.43565883.40967665.1260.24490.8980.99670.7425
9464506602.30415627.93547745.3660.3970.22130.98040.6357
9562506531.68275428.57547858.94550.33870.5480.95950.5771
9666006816.25515525.75418408.14360.3950.75720.93290.6959
9760006137.56574854.50877759.73720.4340.28820.87140.3756
9866006912.27435338.41318950.13830.3820.80990.80990.6889
9974007742.1185842.014710260.2260.3950.8130.80240.8519
10066507242.7315343.01729817.88960.32590.45240.8180.7394
10162507299.28275267.789210114.21020.23250.67440.80780.7344
10266507515.72925309.555910638.58950.29340.78650.75810.7581

\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[90]) \tabularnewline
78 & 4900 & - & - & - & - & - & - & - \tabularnewline
79 & 5000 & - & - & - & - & - & - & - \tabularnewline
80 & 5050 & - & - & - & - & - & - & - \tabularnewline
81 & 5400 & - & - & - & - & - & - & - \tabularnewline
82 & 5400 & - & - & - & - & - & - & - \tabularnewline
83 & 5350 & - & - & - & - & - & - & - \tabularnewline
84 & 5600 & - & - & - & - & - & - & - \tabularnewline
85 & 5200 & - & - & - & - & - & - & - \tabularnewline
86 & 6000 & - & - & - & - & - & - & - \tabularnewline
87 & 6650 & - & - & - & - & - & - & - \tabularnewline
88 & 6050 & - & - & - & - & - & - & - \tabularnewline
89 & 6050 & - & - & - & - & - & - & - \tabularnewline
90 & 6399.99999999999 & - & - & - & - & - & - & - \tabularnewline
91 & 6400 & 6241.9791 & 5726.5705 & 6803.776 & 0.2907 & 0.2907 & 1 & 0.2907 \tabularnewline
92 & 6100 & 6344.9202 & 5690.5903 & 7074.4879 & 0.2553 & 0.4412 & 0.9997 & 0.4412 \tabularnewline
93 & 7050 & 6715.4356 & 5883.4096 & 7665.126 & 0.2449 & 0.898 & 0.9967 & 0.7425 \tabularnewline
94 & 6450 & 6602.3041 & 5627.9354 & 7745.366 & 0.397 & 0.2213 & 0.9804 & 0.6357 \tabularnewline
95 & 6250 & 6531.6827 & 5428.5754 & 7858.9455 & 0.3387 & 0.548 & 0.9595 & 0.5771 \tabularnewline
96 & 6600 & 6816.2551 & 5525.7541 & 8408.1436 & 0.395 & 0.7572 & 0.9329 & 0.6959 \tabularnewline
97 & 6000 & 6137.5657 & 4854.5087 & 7759.7372 & 0.434 & 0.2882 & 0.8714 & 0.3756 \tabularnewline
98 & 6600 & 6912.2743 & 5338.4131 & 8950.1383 & 0.382 & 0.8099 & 0.8099 & 0.6889 \tabularnewline
99 & 7400 & 7742.118 & 5842.0147 & 10260.226 & 0.395 & 0.813 & 0.8024 & 0.8519 \tabularnewline
100 & 6650 & 7242.731 & 5343.0172 & 9817.8896 & 0.3259 & 0.4524 & 0.818 & 0.7394 \tabularnewline
101 & 6250 & 7299.2827 & 5267.7892 & 10114.2102 & 0.2325 & 0.6744 & 0.8078 & 0.7344 \tabularnewline
102 & 6650 & 7515.7292 & 5309.5559 & 10638.5895 & 0.2934 & 0.7865 & 0.7581 & 0.7581 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302798&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[90])[/C][/ROW]
[ROW][C]78[/C][C]4900[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]5000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]5050[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]5400[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]5400[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]83[/C][C]5350[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]84[/C][C]5600[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]5200[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]6000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]6650[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]6050[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]6050[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]6399.99999999999[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]6400[/C][C]6241.9791[/C][C]5726.5705[/C][C]6803.776[/C][C]0.2907[/C][C]0.2907[/C][C]1[/C][C]0.2907[/C][/ROW]
[ROW][C]92[/C][C]6100[/C][C]6344.9202[/C][C]5690.5903[/C][C]7074.4879[/C][C]0.2553[/C][C]0.4412[/C][C]0.9997[/C][C]0.4412[/C][/ROW]
[ROW][C]93[/C][C]7050[/C][C]6715.4356[/C][C]5883.4096[/C][C]7665.126[/C][C]0.2449[/C][C]0.898[/C][C]0.9967[/C][C]0.7425[/C][/ROW]
[ROW][C]94[/C][C]6450[/C][C]6602.3041[/C][C]5627.9354[/C][C]7745.366[/C][C]0.397[/C][C]0.2213[/C][C]0.9804[/C][C]0.6357[/C][/ROW]
[ROW][C]95[/C][C]6250[/C][C]6531.6827[/C][C]5428.5754[/C][C]7858.9455[/C][C]0.3387[/C][C]0.548[/C][C]0.9595[/C][C]0.5771[/C][/ROW]
[ROW][C]96[/C][C]6600[/C][C]6816.2551[/C][C]5525.7541[/C][C]8408.1436[/C][C]0.395[/C][C]0.7572[/C][C]0.9329[/C][C]0.6959[/C][/ROW]
[ROW][C]97[/C][C]6000[/C][C]6137.5657[/C][C]4854.5087[/C][C]7759.7372[/C][C]0.434[/C][C]0.2882[/C][C]0.8714[/C][C]0.3756[/C][/ROW]
[ROW][C]98[/C][C]6600[/C][C]6912.2743[/C][C]5338.4131[/C][C]8950.1383[/C][C]0.382[/C][C]0.8099[/C][C]0.8099[/C][C]0.6889[/C][/ROW]
[ROW][C]99[/C][C]7400[/C][C]7742.118[/C][C]5842.0147[/C][C]10260.226[/C][C]0.395[/C][C]0.813[/C][C]0.8024[/C][C]0.8519[/C][/ROW]
[ROW][C]100[/C][C]6650[/C][C]7242.731[/C][C]5343.0172[/C][C]9817.8896[/C][C]0.3259[/C][C]0.4524[/C][C]0.818[/C][C]0.7394[/C][/ROW]
[ROW][C]101[/C][C]6250[/C][C]7299.2827[/C][C]5267.7892[/C][C]10114.2102[/C][C]0.2325[/C][C]0.6744[/C][C]0.8078[/C][C]0.7344[/C][/ROW]
[ROW][C]102[/C][C]6650[/C][C]7515.7292[/C][C]5309.5559[/C][C]10638.5895[/C][C]0.2934[/C][C]0.7865[/C][C]0.7581[/C][C]0.7581[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302798&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302798&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[90])
784900-------
795000-------
805050-------
815400-------
825400-------
835350-------
845600-------
855200-------
866000-------
876650-------
886050-------
896050-------
906399.99999999999-------
9164006241.97915726.57056803.7760.29070.290710.2907
9261006344.92025690.59037074.48790.25530.44120.99970.4412
9370506715.43565883.40967665.1260.24490.8980.99670.7425
9464506602.30415627.93547745.3660.3970.22130.98040.6357
9562506531.68275428.57547858.94550.33870.5480.95950.5771
9666006816.25515525.75418408.14360.3950.75720.93290.6959
9760006137.56574854.50877759.73720.4340.28820.87140.3756
9866006912.27435338.41318950.13830.3820.80990.80990.6889
9974007742.1185842.014710260.2260.3950.8130.80240.8519
10066507242.7315343.01729817.88960.32590.45240.8180.7394
10162507299.28275267.789210114.21020.23250.67440.80780.7344
10266507515.72925309.555910638.58950.29340.78650.75810.7581







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
910.04590.02470.02470.02524970.6017000.29210.2921
920.0587-0.04020.03240.032259985.900542478.2511206.1025-0.45280.3725
930.07220.04750.03740.0377111933.307865629.9367256.18340.61850.4545
940.0883-0.02360.0340.034123196.540155021.5875234.5668-0.28160.4113
950.1037-0.04510.03620.036179345.116159886.2932244.7168-0.52080.4332
960.1192-0.03280.03560.035446766.269957699.6227240.2075-0.39980.4276
970.1348-0.02290.03380.033618924.309852160.2923228.3863-0.25430.4028
980.1504-0.04730.03550.035297515.218957829.6581240.478-0.57730.4247
990.1659-0.04620.03670.0363117044.72764409.1102253.7895-0.63250.4477
1000.1814-0.08910.04190.0412351330.058393101.205305.1249-1.09580.5126
1010.1968-0.16790.05340.05151100994.1162184727.8333429.7998-1.93990.6423
1020.212-0.13020.05980.0574749487.0538231791.1017481.4469-1.60050.7222

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
91 & 0.0459 & 0.0247 & 0.0247 & 0.025 & 24970.6017 & 0 & 0 & 0.2921 & 0.2921 \tabularnewline
92 & 0.0587 & -0.0402 & 0.0324 & 0.0322 & 59985.9005 & 42478.2511 & 206.1025 & -0.4528 & 0.3725 \tabularnewline
93 & 0.0722 & 0.0475 & 0.0374 & 0.0377 & 111933.3078 & 65629.9367 & 256.1834 & 0.6185 & 0.4545 \tabularnewline
94 & 0.0883 & -0.0236 & 0.034 & 0.0341 & 23196.5401 & 55021.5875 & 234.5668 & -0.2816 & 0.4113 \tabularnewline
95 & 0.1037 & -0.0451 & 0.0362 & 0.0361 & 79345.1161 & 59886.2932 & 244.7168 & -0.5208 & 0.4332 \tabularnewline
96 & 0.1192 & -0.0328 & 0.0356 & 0.0354 & 46766.2699 & 57699.6227 & 240.2075 & -0.3998 & 0.4276 \tabularnewline
97 & 0.1348 & -0.0229 & 0.0338 & 0.0336 & 18924.3098 & 52160.2923 & 228.3863 & -0.2543 & 0.4028 \tabularnewline
98 & 0.1504 & -0.0473 & 0.0355 & 0.0352 & 97515.2189 & 57829.6581 & 240.478 & -0.5773 & 0.4247 \tabularnewline
99 & 0.1659 & -0.0462 & 0.0367 & 0.0363 & 117044.727 & 64409.1102 & 253.7895 & -0.6325 & 0.4477 \tabularnewline
100 & 0.1814 & -0.0891 & 0.0419 & 0.0412 & 351330.0583 & 93101.205 & 305.1249 & -1.0958 & 0.5126 \tabularnewline
101 & 0.1968 & -0.1679 & 0.0534 & 0.0515 & 1100994.1162 & 184727.8333 & 429.7998 & -1.9399 & 0.6423 \tabularnewline
102 & 0.212 & -0.1302 & 0.0598 & 0.0574 & 749487.0538 & 231791.1017 & 481.4469 & -1.6005 & 0.7222 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302798&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]91[/C][C]0.0459[/C][C]0.0247[/C][C]0.0247[/C][C]0.025[/C][C]24970.6017[/C][C]0[/C][C]0[/C][C]0.2921[/C][C]0.2921[/C][/ROW]
[ROW][C]92[/C][C]0.0587[/C][C]-0.0402[/C][C]0.0324[/C][C]0.0322[/C][C]59985.9005[/C][C]42478.2511[/C][C]206.1025[/C][C]-0.4528[/C][C]0.3725[/C][/ROW]
[ROW][C]93[/C][C]0.0722[/C][C]0.0475[/C][C]0.0374[/C][C]0.0377[/C][C]111933.3078[/C][C]65629.9367[/C][C]256.1834[/C][C]0.6185[/C][C]0.4545[/C][/ROW]
[ROW][C]94[/C][C]0.0883[/C][C]-0.0236[/C][C]0.034[/C][C]0.0341[/C][C]23196.5401[/C][C]55021.5875[/C][C]234.5668[/C][C]-0.2816[/C][C]0.4113[/C][/ROW]
[ROW][C]95[/C][C]0.1037[/C][C]-0.0451[/C][C]0.0362[/C][C]0.0361[/C][C]79345.1161[/C][C]59886.2932[/C][C]244.7168[/C][C]-0.5208[/C][C]0.4332[/C][/ROW]
[ROW][C]96[/C][C]0.1192[/C][C]-0.0328[/C][C]0.0356[/C][C]0.0354[/C][C]46766.2699[/C][C]57699.6227[/C][C]240.2075[/C][C]-0.3998[/C][C]0.4276[/C][/ROW]
[ROW][C]97[/C][C]0.1348[/C][C]-0.0229[/C][C]0.0338[/C][C]0.0336[/C][C]18924.3098[/C][C]52160.2923[/C][C]228.3863[/C][C]-0.2543[/C][C]0.4028[/C][/ROW]
[ROW][C]98[/C][C]0.1504[/C][C]-0.0473[/C][C]0.0355[/C][C]0.0352[/C][C]97515.2189[/C][C]57829.6581[/C][C]240.478[/C][C]-0.5773[/C][C]0.4247[/C][/ROW]
[ROW][C]99[/C][C]0.1659[/C][C]-0.0462[/C][C]0.0367[/C][C]0.0363[/C][C]117044.727[/C][C]64409.1102[/C][C]253.7895[/C][C]-0.6325[/C][C]0.4477[/C][/ROW]
[ROW][C]100[/C][C]0.1814[/C][C]-0.0891[/C][C]0.0419[/C][C]0.0412[/C][C]351330.0583[/C][C]93101.205[/C][C]305.1249[/C][C]-1.0958[/C][C]0.5126[/C][/ROW]
[ROW][C]101[/C][C]0.1968[/C][C]-0.1679[/C][C]0.0534[/C][C]0.0515[/C][C]1100994.1162[/C][C]184727.8333[/C][C]429.7998[/C][C]-1.9399[/C][C]0.6423[/C][/ROW]
[ROW][C]102[/C][C]0.212[/C][C]-0.1302[/C][C]0.0598[/C][C]0.0574[/C][C]749487.0538[/C][C]231791.1017[/C][C]481.4469[/C][C]-1.6005[/C][C]0.7222[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302798&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302798&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
910.04590.02470.02470.02524970.6017000.29210.2921
920.0587-0.04020.03240.032259985.900542478.2511206.1025-0.45280.3725
930.07220.04750.03740.0377111933.307865629.9367256.18340.61850.4545
940.0883-0.02360.0340.034123196.540155021.5875234.5668-0.28160.4113
950.1037-0.04510.03620.036179345.116159886.2932244.7168-0.52080.4332
960.1192-0.03280.03560.035446766.269957699.6227240.2075-0.39980.4276
970.1348-0.02290.03380.033618924.309852160.2923228.3863-0.25430.4028
980.1504-0.04730.03550.035297515.218957829.6581240.478-0.57730.4247
990.1659-0.04620.03670.0363117044.72764409.1102253.7895-0.63250.4477
1000.1814-0.08910.04190.0412351330.058393101.205305.1249-1.09580.5126
1010.1968-0.16790.05340.05151100994.1162184727.8333429.7998-1.93990.6423
1020.212-0.13020.05980.0574749487.0538231791.1017481.4469-1.60050.7222



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