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, 09 Dec 2016 10:08:47 +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/09/t1481274863xzf95e1ki0v3h9g.htm/, Retrieved Fri, 01 Nov 2024 03:43:09 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=298459, Retrieved Fri, 01 Nov 2024 03:43:09 +0000
QR Codes:

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

Post a new message
Dataseries X:
4480
4580
5360
4960
5140
5000
5080
5160
5080
5500
5260
5160
4500
4740
5840
5340
5500
5820
5620
5920
5980
6340
6220
5900
5280
5500
6460
5920
6240
6120
5980
6380
5920
6360
5860
5320
4780
4800
5480
5220
5380
5220
5200
5260
5060
5880
5580
5020
6060
5980
6680
6560
6680
6420
6660
7000
6780
7460
6960
6560
6060
6140
7160
6920
7140
7180
7340
7480
7620
8280
7740
7700
7080
7100
8380
7840
7880
8300
8140
8320
8340
8740
8520
8260
7260
7360
8620
8220
8360
8400
8080
8400
8500
8820
8580
7740
7640
7480
8900
7920
8560
8640
8340
9100
8720
9360
8800
8060
7380
7040
8020
7800
8380
8480
8320
8780
8360
9540
8880
7960
7660
7820
8680
8560
8720
8920




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=298459&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])
1028640-------
1038340-------
1049100-------
1058719.99999999999-------
1069360-------
1078800.00000000001-------
1088060-------
1097379.99999999999-------
1107040-------
1118020-------
1127800-------
1138380-------
1148480-------
11583208446.36627846.08369092.57480.35080.45940.62650.4594
11687808876.99828109.52799717.10040.41050.90310.30140.8228
11783608721.68667856.23149682.48160.23030.45270.50140.689
11895409422.67158276.259910727.88180.43010.94470.53750.9216
11988808992.63577784.311610388.52250.43720.22110.60660.7642
12079608444.74217208.35139893.20130.25590.27790.69870.481
12176607928.77236659.71489439.6580.36370.48380.76170.2373
12278207988.62516629.04679627.04510.42010.65290.87180.2783
12386809325.21387645.727111373.62230.26850.92510.89410.7907
12485608770.81917104.227810828.37850.42040.53450.82250.6091
12587209102.92647295.649111357.90230.36960.68150.73510.7059
12689209122.6677235.485211502.06950.43370.62990.70170.7017

\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 & 8640 & - & - & - & - & - & - & - \tabularnewline
103 & 8340 & - & - & - & - & - & - & - \tabularnewline
104 & 9100 & - & - & - & - & - & - & - \tabularnewline
105 & 8719.99999999999 & - & - & - & - & - & - & - \tabularnewline
106 & 9360 & - & - & - & - & - & - & - \tabularnewline
107 & 8800.00000000001 & - & - & - & - & - & - & - \tabularnewline
108 & 8060 & - & - & - & - & - & - & - \tabularnewline
109 & 7379.99999999999 & - & - & - & - & - & - & - \tabularnewline
110 & 7040 & - & - & - & - & - & - & - \tabularnewline
111 & 8020 & - & - & - & - & - & - & - \tabularnewline
112 & 7800 & - & - & - & - & - & - & - \tabularnewline
113 & 8380 & - & - & - & - & - & - & - \tabularnewline
114 & 8480 & - & - & - & - & - & - & - \tabularnewline
115 & 8320 & 8446.3662 & 7846.0836 & 9092.5748 & 0.3508 & 0.4594 & 0.6265 & 0.4594 \tabularnewline
116 & 8780 & 8876.9982 & 8109.5279 & 9717.1004 & 0.4105 & 0.9031 & 0.3014 & 0.8228 \tabularnewline
117 & 8360 & 8721.6866 & 7856.2314 & 9682.4816 & 0.2303 & 0.4527 & 0.5014 & 0.689 \tabularnewline
118 & 9540 & 9422.6715 & 8276.2599 & 10727.8818 & 0.4301 & 0.9447 & 0.5375 & 0.9216 \tabularnewline
119 & 8880 & 8992.6357 & 7784.3116 & 10388.5225 & 0.4372 & 0.2211 & 0.6066 & 0.7642 \tabularnewline
120 & 7960 & 8444.7421 & 7208.3513 & 9893.2013 & 0.2559 & 0.2779 & 0.6987 & 0.481 \tabularnewline
121 & 7660 & 7928.7723 & 6659.7148 & 9439.658 & 0.3637 & 0.4838 & 0.7617 & 0.2373 \tabularnewline
122 & 7820 & 7988.6251 & 6629.0467 & 9627.0451 & 0.4201 & 0.6529 & 0.8718 & 0.2783 \tabularnewline
123 & 8680 & 9325.2138 & 7645.7271 & 11373.6223 & 0.2685 & 0.9251 & 0.8941 & 0.7907 \tabularnewline
124 & 8560 & 8770.8191 & 7104.2278 & 10828.3785 & 0.4204 & 0.5345 & 0.8225 & 0.6091 \tabularnewline
125 & 8720 & 9102.9264 & 7295.6491 & 11357.9023 & 0.3696 & 0.6815 & 0.7351 & 0.7059 \tabularnewline
126 & 8920 & 9122.667 & 7235.4852 & 11502.0695 & 0.4337 & 0.6299 & 0.7017 & 0.7017 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=298459&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]8640[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]8340[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]9100[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]8719.99999999999[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]9360[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]8800.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]8060[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]7379.99999999999[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]7040[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]8020[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]7800[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]8380[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]8480[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]8320[/C][C]8446.3662[/C][C]7846.0836[/C][C]9092.5748[/C][C]0.3508[/C][C]0.4594[/C][C]0.6265[/C][C]0.4594[/C][/ROW]
[ROW][C]116[/C][C]8780[/C][C]8876.9982[/C][C]8109.5279[/C][C]9717.1004[/C][C]0.4105[/C][C]0.9031[/C][C]0.3014[/C][C]0.8228[/C][/ROW]
[ROW][C]117[/C][C]8360[/C][C]8721.6866[/C][C]7856.2314[/C][C]9682.4816[/C][C]0.2303[/C][C]0.4527[/C][C]0.5014[/C][C]0.689[/C][/ROW]
[ROW][C]118[/C][C]9540[/C][C]9422.6715[/C][C]8276.2599[/C][C]10727.8818[/C][C]0.4301[/C][C]0.9447[/C][C]0.5375[/C][C]0.9216[/C][/ROW]
[ROW][C]119[/C][C]8880[/C][C]8992.6357[/C][C]7784.3116[/C][C]10388.5225[/C][C]0.4372[/C][C]0.2211[/C][C]0.6066[/C][C]0.7642[/C][/ROW]
[ROW][C]120[/C][C]7960[/C][C]8444.7421[/C][C]7208.3513[/C][C]9893.2013[/C][C]0.2559[/C][C]0.2779[/C][C]0.6987[/C][C]0.481[/C][/ROW]
[ROW][C]121[/C][C]7660[/C][C]7928.7723[/C][C]6659.7148[/C][C]9439.658[/C][C]0.3637[/C][C]0.4838[/C][C]0.7617[/C][C]0.2373[/C][/ROW]
[ROW][C]122[/C][C]7820[/C][C]7988.6251[/C][C]6629.0467[/C][C]9627.0451[/C][C]0.4201[/C][C]0.6529[/C][C]0.8718[/C][C]0.2783[/C][/ROW]
[ROW][C]123[/C][C]8680[/C][C]9325.2138[/C][C]7645.7271[/C][C]11373.6223[/C][C]0.2685[/C][C]0.9251[/C][C]0.8941[/C][C]0.7907[/C][/ROW]
[ROW][C]124[/C][C]8560[/C][C]8770.8191[/C][C]7104.2278[/C][C]10828.3785[/C][C]0.4204[/C][C]0.5345[/C][C]0.8225[/C][C]0.6091[/C][/ROW]
[ROW][C]125[/C][C]8720[/C][C]9102.9264[/C][C]7295.6491[/C][C]11357.9023[/C][C]0.3696[/C][C]0.6815[/C][C]0.7351[/C][C]0.7059[/C][/ROW]
[ROW][C]126[/C][C]8920[/C][C]9122.667[/C][C]7235.4852[/C][C]11502.0695[/C][C]0.4337[/C][C]0.6299[/C][C]0.7017[/C][C]0.7017[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=298459&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=298459&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])
1028640-------
1038340-------
1049100-------
1058719.99999999999-------
1069360-------
1078800.00000000001-------
1088060-------
1097379.99999999999-------
1107040-------
1118020-------
1127800-------
1138380-------
1148480-------
11583208446.36627846.08369092.57480.35080.45940.62650.4594
11687808876.99828109.52799717.10040.41050.90310.30140.8228
11783608721.68667856.23149682.48160.23030.45270.50140.689
11895409422.67158276.259910727.88180.43010.94470.53750.9216
11988808992.63577784.311610388.52250.43720.22110.60660.7642
12079608444.74217208.35139893.20130.25590.27790.69870.481
12176607928.77236659.71489439.6580.36370.48380.76170.2373
12278207988.62516629.04679627.04510.42010.65290.87180.2783
12386809325.21387645.727111373.62230.26850.92510.89410.7907
12485608770.81917104.227810828.37850.42040.53450.82250.6091
12587209102.92647295.649111357.90230.36960.68150.73510.7059
12689209122.6677235.485211502.06950.43370.62990.70170.7017







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1150.039-0.01520.01520.015115968.417600-0.25550.2555
1160.0483-0.0110.01310.0139408.649912688.5337112.6434-0.19610.2258
1170.0562-0.04330.02320.0228130817.168952064.7455228.177-0.73140.3943
1180.07070.01230.02040.020213765.979342490.0539206.13120.23720.3551
1190.0792-0.01270.01890.018712686.794136529.4019191.1267-0.22780.3296
1200.0875-0.06090.02590.0254234974.944969603.6591263.8251-0.98020.438
1210.0972-0.03510.02720.026772238.52969980.0691264.5375-0.54350.4531
1220.1046-0.02160.02650.02628434.433664786.8647254.5326-0.3410.4391
1230.1121-0.07430.03180.0311416300.8506103843.9742322.2483-1.30470.5353
1240.1197-0.02460.03110.030444444.677697904.0445312.8962-0.42630.5244
1250.1264-0.04390.03230.0316146632.6645102333.9191319.8967-0.77430.5471
1260.1331-0.02270.03150.030841073.906597228.918311.8155-0.40980.5356

\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.039 & -0.0152 & 0.0152 & 0.0151 & 15968.4176 & 0 & 0 & -0.2555 & 0.2555 \tabularnewline
116 & 0.0483 & -0.011 & 0.0131 & 0.013 & 9408.6499 & 12688.5337 & 112.6434 & -0.1961 & 0.2258 \tabularnewline
117 & 0.0562 & -0.0433 & 0.0232 & 0.0228 & 130817.1689 & 52064.7455 & 228.177 & -0.7314 & 0.3943 \tabularnewline
118 & 0.0707 & 0.0123 & 0.0204 & 0.0202 & 13765.9793 & 42490.0539 & 206.1312 & 0.2372 & 0.3551 \tabularnewline
119 & 0.0792 & -0.0127 & 0.0189 & 0.0187 & 12686.7941 & 36529.4019 & 191.1267 & -0.2278 & 0.3296 \tabularnewline
120 & 0.0875 & -0.0609 & 0.0259 & 0.0254 & 234974.9449 & 69603.6591 & 263.8251 & -0.9802 & 0.438 \tabularnewline
121 & 0.0972 & -0.0351 & 0.0272 & 0.0267 & 72238.529 & 69980.0691 & 264.5375 & -0.5435 & 0.4531 \tabularnewline
122 & 0.1046 & -0.0216 & 0.0265 & 0.026 & 28434.4336 & 64786.8647 & 254.5326 & -0.341 & 0.4391 \tabularnewline
123 & 0.1121 & -0.0743 & 0.0318 & 0.0311 & 416300.8506 & 103843.9742 & 322.2483 & -1.3047 & 0.5353 \tabularnewline
124 & 0.1197 & -0.0246 & 0.0311 & 0.0304 & 44444.6776 & 97904.0445 & 312.8962 & -0.4263 & 0.5244 \tabularnewline
125 & 0.1264 & -0.0439 & 0.0323 & 0.0316 & 146632.6645 & 102333.9191 & 319.8967 & -0.7743 & 0.5471 \tabularnewline
126 & 0.1331 & -0.0227 & 0.0315 & 0.0308 & 41073.9065 & 97228.918 & 311.8155 & -0.4098 & 0.5356 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=298459&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.039[/C][C]-0.0152[/C][C]0.0152[/C][C]0.0151[/C][C]15968.4176[/C][C]0[/C][C]0[/C][C]-0.2555[/C][C]0.2555[/C][/ROW]
[ROW][C]116[/C][C]0.0483[/C][C]-0.011[/C][C]0.0131[/C][C]0.013[/C][C]9408.6499[/C][C]12688.5337[/C][C]112.6434[/C][C]-0.1961[/C][C]0.2258[/C][/ROW]
[ROW][C]117[/C][C]0.0562[/C][C]-0.0433[/C][C]0.0232[/C][C]0.0228[/C][C]130817.1689[/C][C]52064.7455[/C][C]228.177[/C][C]-0.7314[/C][C]0.3943[/C][/ROW]
[ROW][C]118[/C][C]0.0707[/C][C]0.0123[/C][C]0.0204[/C][C]0.0202[/C][C]13765.9793[/C][C]42490.0539[/C][C]206.1312[/C][C]0.2372[/C][C]0.3551[/C][/ROW]
[ROW][C]119[/C][C]0.0792[/C][C]-0.0127[/C][C]0.0189[/C][C]0.0187[/C][C]12686.7941[/C][C]36529.4019[/C][C]191.1267[/C][C]-0.2278[/C][C]0.3296[/C][/ROW]
[ROW][C]120[/C][C]0.0875[/C][C]-0.0609[/C][C]0.0259[/C][C]0.0254[/C][C]234974.9449[/C][C]69603.6591[/C][C]263.8251[/C][C]-0.9802[/C][C]0.438[/C][/ROW]
[ROW][C]121[/C][C]0.0972[/C][C]-0.0351[/C][C]0.0272[/C][C]0.0267[/C][C]72238.529[/C][C]69980.0691[/C][C]264.5375[/C][C]-0.5435[/C][C]0.4531[/C][/ROW]
[ROW][C]122[/C][C]0.1046[/C][C]-0.0216[/C][C]0.0265[/C][C]0.026[/C][C]28434.4336[/C][C]64786.8647[/C][C]254.5326[/C][C]-0.341[/C][C]0.4391[/C][/ROW]
[ROW][C]123[/C][C]0.1121[/C][C]-0.0743[/C][C]0.0318[/C][C]0.0311[/C][C]416300.8506[/C][C]103843.9742[/C][C]322.2483[/C][C]-1.3047[/C][C]0.5353[/C][/ROW]
[ROW][C]124[/C][C]0.1197[/C][C]-0.0246[/C][C]0.0311[/C][C]0.0304[/C][C]44444.6776[/C][C]97904.0445[/C][C]312.8962[/C][C]-0.4263[/C][C]0.5244[/C][/ROW]
[ROW][C]125[/C][C]0.1264[/C][C]-0.0439[/C][C]0.0323[/C][C]0.0316[/C][C]146632.6645[/C][C]102333.9191[/C][C]319.8967[/C][C]-0.7743[/C][C]0.5471[/C][/ROW]
[ROW][C]126[/C][C]0.1331[/C][C]-0.0227[/C][C]0.0315[/C][C]0.0308[/C][C]41073.9065[/C][C]97228.918[/C][C]311.8155[/C][C]-0.4098[/C][C]0.5356[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=298459&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=298459&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.039-0.01520.01520.015115968.417600-0.25550.2555
1160.0483-0.0110.01310.0139408.649912688.5337112.6434-0.19610.2258
1170.0562-0.04330.02320.0228130817.168952064.7455228.177-0.73140.3943
1180.07070.01230.02040.020213765.979342490.0539206.13120.23720.3551
1190.0792-0.01270.01890.018712686.794136529.4019191.1267-0.22780.3296
1200.0875-0.06090.02590.0254234974.944969603.6591263.8251-0.98020.438
1210.0972-0.03510.02720.026772238.52969980.0691264.5375-0.54350.4531
1220.1046-0.02160.02650.02628434.433664786.8647254.5326-0.3410.4391
1230.1121-0.07430.03180.0311416300.8506103843.9742322.2483-1.30470.5353
1240.1197-0.02460.03110.030444444.677697904.0445312.8962-0.42630.5244
1250.1264-0.04390.03230.0316146632.6645102333.9191319.8967-0.77430.5471
1260.1331-0.02270.03150.030841073.906597228.918311.8155-0.40980.5356



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