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 computationSat, 26 Aug 2023 10:54:18 +0200
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2023/Aug/26/t1693040286ac76ojr7dgghvuq.htm/, Retrieved Sat, 12 Sep 2026 22:39:12 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=319939, Retrieved Sat, 12 Sep 2026 22:39:12 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact16
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Vraag 3] [2023-08-26 08:54:18] [be7b2b75e23a5e4204aac38a719ba7c9] [Current]
Feedback Forum

Post a new message
Dataseries X:
5160
4220
5840
5140
5480
6720
4840
5220
6260
6020
5340
4940
4300
4420
5340
4960
5380
5840
4680
5580
5820
5180
5220
4400
4580
3940
5100
4320
5220
5980
4220
6180
5720
5440
5420
4480
4880
4520
4920
4340
5340
5700
4100
5520
5220
5640
4600
4440
4240
3600
4280
4280
5180
5320
4500
5720
5780
5680
5180
4560
4400
3820
4400
4960
5400
5460
5240
4880
5260
5160
4200
5000
4340
4120
4520
4160
4600
5620
3960
4220
4900
4820
4060
4200
2900
3700
4280
3760
4320
5020
3460
4480
4740
4160
4000
3780
3280
3280
4180
3480
4820
4920
3160
4400
4160
4040
4020
3560
3180
3140
3780
3440
4100
4440
3280
4220
3900
3820
4200
3160
3040
2900
3260
3500
3380
4380
3400
4120
3860
3860
3820
3140
2780
3120
3620
3240
3300
4340
3360
3700
3880
3560
3800
3440




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=319939&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[132])
1203160-------
1213040-------
1222900-------
1233260-------
1243500-------
1253380-------
1264380-------
1273400-------
1284120-------
1293860-------
1303860-------
1313820-------
1323140-------
13327802920.66772107.82623669.80190.35640.2830.37740.283
13431202723.41121884.80443489.62770.15520.44250.32570.1433
13536203368.79672575.0174109.51930.25310.74480.61330.7275
13632403222.60072396.62033988.74310.48220.15470.2390.5837
13733003630.79882822.20014388.19290.1960.84410.74180.898
13843404332.87283556.78645069.09320.49240.9970.45010.9993
13933603116.59772227.44183934.39410.27980.00170.24850.4776
14037003945.97333113.97054727.98270.26880.9290.33140.9783
14138803940.08413093.03994735.27430.44110.7230.57820.9757
14235603835.93332966.5324649.3460.25310.45770.47690.9532
14338003611.20812708.59224449.98710.32960.54760.31280.8646
14434403124.54942157.58334007.64430.24190.06690.48630.4863

\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[132]) \tabularnewline
120 & 3160 & - & - & - & - & - & - & - \tabularnewline
121 & 3040 & - & - & - & - & - & - & - \tabularnewline
122 & 2900 & - & - & - & - & - & - & - \tabularnewline
123 & 3260 & - & - & - & - & - & - & - \tabularnewline
124 & 3500 & - & - & - & - & - & - & - \tabularnewline
125 & 3380 & - & - & - & - & - & - & - \tabularnewline
126 & 4380 & - & - & - & - & - & - & - \tabularnewline
127 & 3400 & - & - & - & - & - & - & - \tabularnewline
128 & 4120 & - & - & - & - & - & - & - \tabularnewline
129 & 3860 & - & - & - & - & - & - & - \tabularnewline
130 & 3860 & - & - & - & - & - & - & - \tabularnewline
131 & 3820 & - & - & - & - & - & - & - \tabularnewline
132 & 3140 & - & - & - & - & - & - & - \tabularnewline
133 & 2780 & 2920.6677 & 2107.8262 & 3669.8019 & 0.3564 & 0.283 & 0.3774 & 0.283 \tabularnewline
134 & 3120 & 2723.4112 & 1884.8044 & 3489.6277 & 0.1552 & 0.4425 & 0.3257 & 0.1433 \tabularnewline
135 & 3620 & 3368.7967 & 2575.017 & 4109.5193 & 0.2531 & 0.7448 & 0.6133 & 0.7275 \tabularnewline
136 & 3240 & 3222.6007 & 2396.6203 & 3988.7431 & 0.4822 & 0.1547 & 0.239 & 0.5837 \tabularnewline
137 & 3300 & 3630.7988 & 2822.2001 & 4388.1929 & 0.196 & 0.8441 & 0.7418 & 0.898 \tabularnewline
138 & 4340 & 4332.8728 & 3556.7864 & 5069.0932 & 0.4924 & 0.997 & 0.4501 & 0.9993 \tabularnewline
139 & 3360 & 3116.5977 & 2227.4418 & 3934.3941 & 0.2798 & 0.0017 & 0.2485 & 0.4776 \tabularnewline
140 & 3700 & 3945.9733 & 3113.9705 & 4727.9827 & 0.2688 & 0.929 & 0.3314 & 0.9783 \tabularnewline
141 & 3880 & 3940.0841 & 3093.0399 & 4735.2743 & 0.4411 & 0.723 & 0.5782 & 0.9757 \tabularnewline
142 & 3560 & 3835.9333 & 2966.532 & 4649.346 & 0.2531 & 0.4577 & 0.4769 & 0.9532 \tabularnewline
143 & 3800 & 3611.2081 & 2708.5922 & 4449.9871 & 0.3296 & 0.5476 & 0.3128 & 0.8646 \tabularnewline
144 & 3440 & 3124.5494 & 2157.5833 & 4007.6443 & 0.2419 & 0.0669 & 0.4863 & 0.4863 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=319939&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[132])[/C][/ROW]
[ROW][C]120[/C][C]3160[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]3040[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]122[/C][C]2900[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]123[/C][C]3260[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]124[/C][C]3500[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]125[/C][C]3380[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]126[/C][C]4380[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]127[/C][C]3400[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]128[/C][C]4120[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]129[/C][C]3860[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]130[/C][C]3860[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]131[/C][C]3820[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]132[/C][C]3140[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]133[/C][C]2780[/C][C]2920.6677[/C][C]2107.8262[/C][C]3669.8019[/C][C]0.3564[/C][C]0.283[/C][C]0.3774[/C][C]0.283[/C][/ROW]
[ROW][C]134[/C][C]3120[/C][C]2723.4112[/C][C]1884.8044[/C][C]3489.6277[/C][C]0.1552[/C][C]0.4425[/C][C]0.3257[/C][C]0.1433[/C][/ROW]
[ROW][C]135[/C][C]3620[/C][C]3368.7967[/C][C]2575.017[/C][C]4109.5193[/C][C]0.2531[/C][C]0.7448[/C][C]0.6133[/C][C]0.7275[/C][/ROW]
[ROW][C]136[/C][C]3240[/C][C]3222.6007[/C][C]2396.6203[/C][C]3988.7431[/C][C]0.4822[/C][C]0.1547[/C][C]0.239[/C][C]0.5837[/C][/ROW]
[ROW][C]137[/C][C]3300[/C][C]3630.7988[/C][C]2822.2001[/C][C]4388.1929[/C][C]0.196[/C][C]0.8441[/C][C]0.7418[/C][C]0.898[/C][/ROW]
[ROW][C]138[/C][C]4340[/C][C]4332.8728[/C][C]3556.7864[/C][C]5069.0932[/C][C]0.4924[/C][C]0.997[/C][C]0.4501[/C][C]0.9993[/C][/ROW]
[ROW][C]139[/C][C]3360[/C][C]3116.5977[/C][C]2227.4418[/C][C]3934.3941[/C][C]0.2798[/C][C]0.0017[/C][C]0.2485[/C][C]0.4776[/C][/ROW]
[ROW][C]140[/C][C]3700[/C][C]3945.9733[/C][C]3113.9705[/C][C]4727.9827[/C][C]0.2688[/C][C]0.929[/C][C]0.3314[/C][C]0.9783[/C][/ROW]
[ROW][C]141[/C][C]3880[/C][C]3940.0841[/C][C]3093.0399[/C][C]4735.2743[/C][C]0.4411[/C][C]0.723[/C][C]0.5782[/C][C]0.9757[/C][/ROW]
[ROW][C]142[/C][C]3560[/C][C]3835.9333[/C][C]2966.532[/C][C]4649.346[/C][C]0.2531[/C][C]0.4577[/C][C]0.4769[/C][C]0.9532[/C][/ROW]
[ROW][C]143[/C][C]3800[/C][C]3611.2081[/C][C]2708.5922[/C][C]4449.9871[/C][C]0.3296[/C][C]0.5476[/C][C]0.3128[/C][C]0.8646[/C][/ROW]
[ROW][C]144[/C][C]3440[/C][C]3124.5494[/C][C]2157.5833[/C][C]4007.6443[/C][C]0.2419[/C][C]0.0669[/C][C]0.4863[/C][C]0.4863[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=319939&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=319939&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[132])
1203160-------
1213040-------
1222900-------
1233260-------
1243500-------
1253380-------
1264380-------
1273400-------
1284120-------
1293860-------
1303860-------
1313820-------
1323140-------
13327802920.66772107.82623669.80190.35640.2830.37740.283
13431202723.41121884.80443489.62770.15520.44250.32570.1433
13536203368.79672575.0174109.51930.25310.74480.61330.7275
13632403222.60072396.62033988.74310.48220.15470.2390.5837
13733003630.79882822.20014388.19290.1960.84410.74180.898
13843404332.87283556.78645069.09320.49240.9970.45010.9993
13933603116.59772227.44183934.39410.27980.00170.24850.4776
14037003945.97333113.97054727.98270.26880.9290.33140.9783
14138803940.08413093.03994735.27430.44110.7230.57820.9757
14235603835.93332966.5324649.3460.25310.45770.47690.9532
14338003611.20812708.59224449.98710.32960.54760.31280.8646
14434403124.54942157.58334007.64430.24190.06690.48630.4863







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1330.1309-0.05060.05060.049419787.411200-0.32640.3264
1340.14350.12710.08890.0925157282.671888535.0415297.54840.92040.6234
1350.11220.06940.08240.085763103.105980057.7296282.94470.5830.6099
1360.12130.00540.06310.0656302.737160118.9815245.19170.04040.4675
1370.1064-0.10020.07050.0716109427.84469980.754264.5388-0.76770.5276
1380.08670.00160.05910.059950.797258325.7612241.50730.01650.4424
1390.13390.07240.0610.062159244.682358457.0356241.77890.56490.4599
1400.1011-0.06650.06170.062460502.873658712.7654242.3072-0.57080.4738
1410.103-0.01550.05650.05713610.09652590.2466229.3256-0.13940.4366
1420.1082-0.07750.05860.058976139.159754945.1379234.4038-0.64040.457
1430.11850.04970.05780.058235642.372453190.341230.63030.43810.4553
1440.14420.09170.06060.061399509.05757050.234238.85190.73210.4783

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
133 & 0.1309 & -0.0506 & 0.0506 & 0.0494 & 19787.4112 & 0 & 0 & -0.3264 & 0.3264 \tabularnewline
134 & 0.1435 & 0.1271 & 0.0889 & 0.0925 & 157282.6718 & 88535.0415 & 297.5484 & 0.9204 & 0.6234 \tabularnewline
135 & 0.1122 & 0.0694 & 0.0824 & 0.0857 & 63103.1059 & 80057.7296 & 282.9447 & 0.583 & 0.6099 \tabularnewline
136 & 0.1213 & 0.0054 & 0.0631 & 0.0656 & 302.7371 & 60118.9815 & 245.1917 & 0.0404 & 0.4675 \tabularnewline
137 & 0.1064 & -0.1002 & 0.0705 & 0.0716 & 109427.844 & 69980.754 & 264.5388 & -0.7677 & 0.5276 \tabularnewline
138 & 0.0867 & 0.0016 & 0.0591 & 0.0599 & 50.7972 & 58325.7612 & 241.5073 & 0.0165 & 0.4424 \tabularnewline
139 & 0.1339 & 0.0724 & 0.061 & 0.0621 & 59244.6823 & 58457.0356 & 241.7789 & 0.5649 & 0.4599 \tabularnewline
140 & 0.1011 & -0.0665 & 0.0617 & 0.0624 & 60502.8736 & 58712.7654 & 242.3072 & -0.5708 & 0.4738 \tabularnewline
141 & 0.103 & -0.0155 & 0.0565 & 0.0571 & 3610.096 & 52590.2466 & 229.3256 & -0.1394 & 0.4366 \tabularnewline
142 & 0.1082 & -0.0775 & 0.0586 & 0.0589 & 76139.1597 & 54945.1379 & 234.4038 & -0.6404 & 0.457 \tabularnewline
143 & 0.1185 & 0.0497 & 0.0578 & 0.0582 & 35642.3724 & 53190.341 & 230.6303 & 0.4381 & 0.4553 \tabularnewline
144 & 0.1442 & 0.0917 & 0.0606 & 0.0613 & 99509.057 & 57050.234 & 238.8519 & 0.7321 & 0.4783 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=319939&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]133[/C][C]0.1309[/C][C]-0.0506[/C][C]0.0506[/C][C]0.0494[/C][C]19787.4112[/C][C]0[/C][C]0[/C][C]-0.3264[/C][C]0.3264[/C][/ROW]
[ROW][C]134[/C][C]0.1435[/C][C]0.1271[/C][C]0.0889[/C][C]0.0925[/C][C]157282.6718[/C][C]88535.0415[/C][C]297.5484[/C][C]0.9204[/C][C]0.6234[/C][/ROW]
[ROW][C]135[/C][C]0.1122[/C][C]0.0694[/C][C]0.0824[/C][C]0.0857[/C][C]63103.1059[/C][C]80057.7296[/C][C]282.9447[/C][C]0.583[/C][C]0.6099[/C][/ROW]
[ROW][C]136[/C][C]0.1213[/C][C]0.0054[/C][C]0.0631[/C][C]0.0656[/C][C]302.7371[/C][C]60118.9815[/C][C]245.1917[/C][C]0.0404[/C][C]0.4675[/C][/ROW]
[ROW][C]137[/C][C]0.1064[/C][C]-0.1002[/C][C]0.0705[/C][C]0.0716[/C][C]109427.844[/C][C]69980.754[/C][C]264.5388[/C][C]-0.7677[/C][C]0.5276[/C][/ROW]
[ROW][C]138[/C][C]0.0867[/C][C]0.0016[/C][C]0.0591[/C][C]0.0599[/C][C]50.7972[/C][C]58325.7612[/C][C]241.5073[/C][C]0.0165[/C][C]0.4424[/C][/ROW]
[ROW][C]139[/C][C]0.1339[/C][C]0.0724[/C][C]0.061[/C][C]0.0621[/C][C]59244.6823[/C][C]58457.0356[/C][C]241.7789[/C][C]0.5649[/C][C]0.4599[/C][/ROW]
[ROW][C]140[/C][C]0.1011[/C][C]-0.0665[/C][C]0.0617[/C][C]0.0624[/C][C]60502.8736[/C][C]58712.7654[/C][C]242.3072[/C][C]-0.5708[/C][C]0.4738[/C][/ROW]
[ROW][C]141[/C][C]0.103[/C][C]-0.0155[/C][C]0.0565[/C][C]0.0571[/C][C]3610.096[/C][C]52590.2466[/C][C]229.3256[/C][C]-0.1394[/C][C]0.4366[/C][/ROW]
[ROW][C]142[/C][C]0.1082[/C][C]-0.0775[/C][C]0.0586[/C][C]0.0589[/C][C]76139.1597[/C][C]54945.1379[/C][C]234.4038[/C][C]-0.6404[/C][C]0.457[/C][/ROW]
[ROW][C]143[/C][C]0.1185[/C][C]0.0497[/C][C]0.0578[/C][C]0.0582[/C][C]35642.3724[/C][C]53190.341[/C][C]230.6303[/C][C]0.4381[/C][C]0.4553[/C][/ROW]
[ROW][C]144[/C][C]0.1442[/C][C]0.0917[/C][C]0.0606[/C][C]0.0613[/C][C]99509.057[/C][C]57050.234[/C][C]238.8519[/C][C]0.7321[/C][C]0.4783[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=319939&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=319939&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
1330.1309-0.05060.05060.049419787.411200-0.32640.3264
1340.14350.12710.08890.0925157282.671888535.0415297.54840.92040.6234
1350.11220.06940.08240.085763103.105980057.7296282.94470.5830.6099
1360.12130.00540.06310.0656302.737160118.9815245.19170.04040.4675
1370.1064-0.10020.07050.0716109427.84469980.754264.5388-0.76770.5276
1380.08670.00160.05910.059950.797258325.7612241.50730.01650.4424
1390.13390.07240.0610.062159244.682358457.0356241.77890.56490.4599
1400.1011-0.06650.06170.062460502.873658712.7654242.3072-0.57080.4738
1410.103-0.01550.05650.05713610.09652590.2466229.3256-0.13940.4366
1420.1082-0.07750.05860.058976139.159754945.1379234.4038-0.64040.457
1430.11850.04970.05780.058235642.372453190.341230.63030.43810.4553
1440.14420.09170.06060.061399509.05757050.234238.85190.73210.4783



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