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, 20 Dec 2017 17:32:13 +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/2017/Dec/20/t15137876598pdoqls81hwdpud.htm/, Retrieved Mon, 13 May 2024 23:01:55 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310545, Retrieved Mon, 13 May 2024 23:01:55 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact110
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2017-12-20 16:32:13] [1ea4e9c673228daef4af35aa2d91fd76] [Current]
Feedback Forum

Post a new message
Dataseries X:
15.4
17.3
19.2
14.5
11.1
7.1
5.1
2.1
1.4
3
9
11.1
15.8
20.2
18.6
14.8
12.8
6.4
6.1
6.1
6.6
9.3
12.4
13.5
16.5
19.3
16.2
16.5
13.6
8.8
4.3
3.5
3.3
6.6
10.3
13.1
16.5
19
19.4
13.5
10.2
10.1
9.6
4.8
4.5
5.3
8.5
14.2
16
18.3
18.1
17.5
9.7
6.1
4.7
1.1
6.1
9.6
8.8
15.5
19.2




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310545&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[49])
3716.5-------
3819-------
3919.4-------
4013.5-------
4110.2-------
4210.1-------
439.6-------
444.8-------
454.5-------
465.3-------
478.5-------
4814.2-------
4916-------
5018.318.603714.879222.32830.43650.91470.41740.9147
5118.117.73813.65721.81890.4310.39360.21240.7981
5217.515.058210.977219.13910.12040.0720.77290.3255
539.711.96597.884916.04690.13820.00390.80180.0263
546.19.42485.343813.50580.05520.44740.37298e-04
554.76.84722.766310.92820.15120.64020.09310
561.14.12480.04388.20580.07310.39120.37290
576.13.8767-0.20427.95770.14280.90880.38230
589.65.97521.894210.05620.04080.47610.62710
598.89.43495.353913.51590.38020.46840.67338e-04
6015.513.62879.547717.70960.18440.98980.39190.1274
6119.216.259712.178720.34070.0790.64240.54960.5496

\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[49]) \tabularnewline
37 & 16.5 & - & - & - & - & - & - & - \tabularnewline
38 & 19 & - & - & - & - & - & - & - \tabularnewline
39 & 19.4 & - & - & - & - & - & - & - \tabularnewline
40 & 13.5 & - & - & - & - & - & - & - \tabularnewline
41 & 10.2 & - & - & - & - & - & - & - \tabularnewline
42 & 10.1 & - & - & - & - & - & - & - \tabularnewline
43 & 9.6 & - & - & - & - & - & - & - \tabularnewline
44 & 4.8 & - & - & - & - & - & - & - \tabularnewline
45 & 4.5 & - & - & - & - & - & - & - \tabularnewline
46 & 5.3 & - & - & - & - & - & - & - \tabularnewline
47 & 8.5 & - & - & - & - & - & - & - \tabularnewline
48 & 14.2 & - & - & - & - & - & - & - \tabularnewline
49 & 16 & - & - & - & - & - & - & - \tabularnewline
50 & 18.3 & 18.6037 & 14.8792 & 22.3283 & 0.4365 & 0.9147 & 0.4174 & 0.9147 \tabularnewline
51 & 18.1 & 17.738 & 13.657 & 21.8189 & 0.431 & 0.3936 & 0.2124 & 0.7981 \tabularnewline
52 & 17.5 & 15.0582 & 10.9772 & 19.1391 & 0.1204 & 0.072 & 0.7729 & 0.3255 \tabularnewline
53 & 9.7 & 11.9659 & 7.8849 & 16.0469 & 0.1382 & 0.0039 & 0.8018 & 0.0263 \tabularnewline
54 & 6.1 & 9.4248 & 5.3438 & 13.5058 & 0.0552 & 0.4474 & 0.3729 & 8e-04 \tabularnewline
55 & 4.7 & 6.8472 & 2.7663 & 10.9282 & 0.1512 & 0.6402 & 0.0931 & 0 \tabularnewline
56 & 1.1 & 4.1248 & 0.0438 & 8.2058 & 0.0731 & 0.3912 & 0.3729 & 0 \tabularnewline
57 & 6.1 & 3.8767 & -0.2042 & 7.9577 & 0.1428 & 0.9088 & 0.3823 & 0 \tabularnewline
58 & 9.6 & 5.9752 & 1.8942 & 10.0562 & 0.0408 & 0.4761 & 0.6271 & 0 \tabularnewline
59 & 8.8 & 9.4349 & 5.3539 & 13.5159 & 0.3802 & 0.4684 & 0.6733 & 8e-04 \tabularnewline
60 & 15.5 & 13.6287 & 9.5477 & 17.7096 & 0.1844 & 0.9898 & 0.3919 & 0.1274 \tabularnewline
61 & 19.2 & 16.2597 & 12.1787 & 20.3407 & 0.079 & 0.6424 & 0.5496 & 0.5496 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310545&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[49])[/C][/ROW]
[ROW][C]37[/C][C]16.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]19[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]19.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]13.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]10.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]10.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]9.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]4.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]4.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]5.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]8.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]14.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]16[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]18.3[/C][C]18.6037[/C][C]14.8792[/C][C]22.3283[/C][C]0.4365[/C][C]0.9147[/C][C]0.4174[/C][C]0.9147[/C][/ROW]
[ROW][C]51[/C][C]18.1[/C][C]17.738[/C][C]13.657[/C][C]21.8189[/C][C]0.431[/C][C]0.3936[/C][C]0.2124[/C][C]0.7981[/C][/ROW]
[ROW][C]52[/C][C]17.5[/C][C]15.0582[/C][C]10.9772[/C][C]19.1391[/C][C]0.1204[/C][C]0.072[/C][C]0.7729[/C][C]0.3255[/C][/ROW]
[ROW][C]53[/C][C]9.7[/C][C]11.9659[/C][C]7.8849[/C][C]16.0469[/C][C]0.1382[/C][C]0.0039[/C][C]0.8018[/C][C]0.0263[/C][/ROW]
[ROW][C]54[/C][C]6.1[/C][C]9.4248[/C][C]5.3438[/C][C]13.5058[/C][C]0.0552[/C][C]0.4474[/C][C]0.3729[/C][C]8e-04[/C][/ROW]
[ROW][C]55[/C][C]4.7[/C][C]6.8472[/C][C]2.7663[/C][C]10.9282[/C][C]0.1512[/C][C]0.6402[/C][C]0.0931[/C][C]0[/C][/ROW]
[ROW][C]56[/C][C]1.1[/C][C]4.1248[/C][C]0.0438[/C][C]8.2058[/C][C]0.0731[/C][C]0.3912[/C][C]0.3729[/C][C]0[/C][/ROW]
[ROW][C]57[/C][C]6.1[/C][C]3.8767[/C][C]-0.2042[/C][C]7.9577[/C][C]0.1428[/C][C]0.9088[/C][C]0.3823[/C][C]0[/C][/ROW]
[ROW][C]58[/C][C]9.6[/C][C]5.9752[/C][C]1.8942[/C][C]10.0562[/C][C]0.0408[/C][C]0.4761[/C][C]0.6271[/C][C]0[/C][/ROW]
[ROW][C]59[/C][C]8.8[/C][C]9.4349[/C][C]5.3539[/C][C]13.5159[/C][C]0.3802[/C][C]0.4684[/C][C]0.6733[/C][C]8e-04[/C][/ROW]
[ROW][C]60[/C][C]15.5[/C][C]13.6287[/C][C]9.5477[/C][C]17.7096[/C][C]0.1844[/C][C]0.9898[/C][C]0.3919[/C][C]0.1274[/C][/ROW]
[ROW][C]61[/C][C]19.2[/C][C]16.2597[/C][C]12.1787[/C][C]20.3407[/C][C]0.079[/C][C]0.6424[/C][C]0.5496[/C][C]0.5496[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310545&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310545&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[49])
3716.5-------
3819-------
3919.4-------
4013.5-------
4110.2-------
4210.1-------
439.6-------
444.8-------
454.5-------
465.3-------
478.5-------
4814.2-------
4916-------
5018.318.603714.879222.32830.43650.91470.41740.9147
5118.117.73813.65721.81890.4310.39360.21240.7981
5217.515.058210.977219.13910.12040.0720.77290.3255
539.711.96597.884916.04690.13820.00390.80180.0263
546.19.42485.343813.50580.05520.44740.37298e-04
554.76.84722.766310.92820.15120.64020.09310
561.14.12480.04388.20580.07310.39120.37290
576.13.8767-0.20427.95770.14280.90880.38230
589.65.97521.894210.05620.04080.47610.62710
598.89.43495.353913.51590.38020.46840.67338e-04
6015.513.62879.547717.70960.18440.98980.39190.1274
6119.216.259712.178720.34070.0790.64240.54960.5496







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
500.1021-0.01660.01660.01650.092300-0.09050.0905
510.11740.020.01830.01830.13110.11170.33420.10790.0992
520.13830.13950.05870.06225.96262.0621.4360.72790.3088
530.174-0.23360.10240.0995.13442.83011.6823-0.67550.4005
540.2209-0.5450.1910.164811.05434.47492.1154-0.99110.5186
550.3041-0.45690.23530.19934.61074.49752.1207-0.64010.5388
560.5048-2.74980.59450.33639.14945.16212.272-0.90170.5907
570.53710.36450.56570.354.94295.13472.2660.66280.5997
580.34850.37760.54480.362813.13916.02412.45441.08060.6531
590.2207-0.07210.49760.33350.40315.4622.3371-0.18930.6067
600.15280.12070.46330.31483.50195.28382.29860.55780.6023
610.12810.15310.43750.30248.64545.56392.35880.87650.6251

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
50 & 0.1021 & -0.0166 & 0.0166 & 0.0165 & 0.0923 & 0 & 0 & -0.0905 & 0.0905 \tabularnewline
51 & 0.1174 & 0.02 & 0.0183 & 0.0183 & 0.1311 & 0.1117 & 0.3342 & 0.1079 & 0.0992 \tabularnewline
52 & 0.1383 & 0.1395 & 0.0587 & 0.0622 & 5.9626 & 2.062 & 1.436 & 0.7279 & 0.3088 \tabularnewline
53 & 0.174 & -0.2336 & 0.1024 & 0.099 & 5.1344 & 2.8301 & 1.6823 & -0.6755 & 0.4005 \tabularnewline
54 & 0.2209 & -0.545 & 0.191 & 0.1648 & 11.0543 & 4.4749 & 2.1154 & -0.9911 & 0.5186 \tabularnewline
55 & 0.3041 & -0.4569 & 0.2353 & 0.1993 & 4.6107 & 4.4975 & 2.1207 & -0.6401 & 0.5388 \tabularnewline
56 & 0.5048 & -2.7498 & 0.5945 & 0.3363 & 9.1494 & 5.1621 & 2.272 & -0.9017 & 0.5907 \tabularnewline
57 & 0.5371 & 0.3645 & 0.5657 & 0.35 & 4.9429 & 5.1347 & 2.266 & 0.6628 & 0.5997 \tabularnewline
58 & 0.3485 & 0.3776 & 0.5448 & 0.3628 & 13.1391 & 6.0241 & 2.4544 & 1.0806 & 0.6531 \tabularnewline
59 & 0.2207 & -0.0721 & 0.4976 & 0.3335 & 0.4031 & 5.462 & 2.3371 & -0.1893 & 0.6067 \tabularnewline
60 & 0.1528 & 0.1207 & 0.4633 & 0.3148 & 3.5019 & 5.2838 & 2.2986 & 0.5578 & 0.6023 \tabularnewline
61 & 0.1281 & 0.1531 & 0.4375 & 0.3024 & 8.6454 & 5.5639 & 2.3588 & 0.8765 & 0.6251 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310545&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]50[/C][C]0.1021[/C][C]-0.0166[/C][C]0.0166[/C][C]0.0165[/C][C]0.0923[/C][C]0[/C][C]0[/C][C]-0.0905[/C][C]0.0905[/C][/ROW]
[ROW][C]51[/C][C]0.1174[/C][C]0.02[/C][C]0.0183[/C][C]0.0183[/C][C]0.1311[/C][C]0.1117[/C][C]0.3342[/C][C]0.1079[/C][C]0.0992[/C][/ROW]
[ROW][C]52[/C][C]0.1383[/C][C]0.1395[/C][C]0.0587[/C][C]0.0622[/C][C]5.9626[/C][C]2.062[/C][C]1.436[/C][C]0.7279[/C][C]0.3088[/C][/ROW]
[ROW][C]53[/C][C]0.174[/C][C]-0.2336[/C][C]0.1024[/C][C]0.099[/C][C]5.1344[/C][C]2.8301[/C][C]1.6823[/C][C]-0.6755[/C][C]0.4005[/C][/ROW]
[ROW][C]54[/C][C]0.2209[/C][C]-0.545[/C][C]0.191[/C][C]0.1648[/C][C]11.0543[/C][C]4.4749[/C][C]2.1154[/C][C]-0.9911[/C][C]0.5186[/C][/ROW]
[ROW][C]55[/C][C]0.3041[/C][C]-0.4569[/C][C]0.2353[/C][C]0.1993[/C][C]4.6107[/C][C]4.4975[/C][C]2.1207[/C][C]-0.6401[/C][C]0.5388[/C][/ROW]
[ROW][C]56[/C][C]0.5048[/C][C]-2.7498[/C][C]0.5945[/C][C]0.3363[/C][C]9.1494[/C][C]5.1621[/C][C]2.272[/C][C]-0.9017[/C][C]0.5907[/C][/ROW]
[ROW][C]57[/C][C]0.5371[/C][C]0.3645[/C][C]0.5657[/C][C]0.35[/C][C]4.9429[/C][C]5.1347[/C][C]2.266[/C][C]0.6628[/C][C]0.5997[/C][/ROW]
[ROW][C]58[/C][C]0.3485[/C][C]0.3776[/C][C]0.5448[/C][C]0.3628[/C][C]13.1391[/C][C]6.0241[/C][C]2.4544[/C][C]1.0806[/C][C]0.6531[/C][/ROW]
[ROW][C]59[/C][C]0.2207[/C][C]-0.0721[/C][C]0.4976[/C][C]0.3335[/C][C]0.4031[/C][C]5.462[/C][C]2.3371[/C][C]-0.1893[/C][C]0.6067[/C][/ROW]
[ROW][C]60[/C][C]0.1528[/C][C]0.1207[/C][C]0.4633[/C][C]0.3148[/C][C]3.5019[/C][C]5.2838[/C][C]2.2986[/C][C]0.5578[/C][C]0.6023[/C][/ROW]
[ROW][C]61[/C][C]0.1281[/C][C]0.1531[/C][C]0.4375[/C][C]0.3024[/C][C]8.6454[/C][C]5.5639[/C][C]2.3588[/C][C]0.8765[/C][C]0.6251[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310545&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310545&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
500.1021-0.01660.01660.01650.092300-0.09050.0905
510.11740.020.01830.01830.13110.11170.33420.10790.0992
520.13830.13950.05870.06225.96262.0621.4360.72790.3088
530.174-0.23360.10240.0995.13442.83011.6823-0.67550.4005
540.2209-0.5450.1910.164811.05434.47492.1154-0.99110.5186
550.3041-0.45690.23530.19934.61074.49752.1207-0.64010.5388
560.5048-2.74980.59450.33639.14945.16212.272-0.90170.5907
570.53710.36450.56570.354.94295.13472.2660.66280.5997
580.34850.37760.54480.362813.13916.02412.45441.08060.6531
590.2207-0.07210.49760.33350.40315.4622.3371-0.18930.6067
600.15280.12070.46330.31483.50195.28382.29860.55780.6023
610.12810.15310.43750.30248.64545.56392.35880.87650.6251



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