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, 08 Dec 2018 22:42:24 +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/2018/Dec/08/t15443053605w0y2f6tujy30k3.htm/, Retrieved Sun, 05 May 2024 08:38:38 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=315813, Retrieved Sun, 05 May 2024 08:38:38 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact105
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2018-12-08 21:42:24] [9e2b27cf675a1d7b8e7da04c0e26bb6a] [Current]
Feedback Forum

Post a new message
Dataseries X:
1954
2302
3054
2414
2226
2725
2589
3470
2400
3180
4009
3924
2072
2434
2956
2828
2687
2629
3150
4119
3030
3055
3821
4001
2529
2472
3134
2789
2758
2993
3282
3437
2804
3076
3782
3889
2271
2452
3084
2522
2769
3438
2839
3746
2632
2851
3871
3618
2389
2344
2678
2492
2858
2246
2800
3869
3007
3023
3907
4209




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time3 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 time3 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=315813&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]3 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=315813&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=315813&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 time3 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[48])
363889-------
372271-------
382452-------
393084-------
402522-------
412769-------
423438-------
432839-------
443746-------
452632-------
462851-------
473871-------
483618-------
4923892145.19491890.20732464.73140.067400.22020
5023442431.41342114.55052838.41030.33690.58090.46050
5126783003.37092552.29943608.9880.14620.98360.39710.0233
5224922629.90082261.96113112.59340.28780.42260.66940
5328582719.15782327.25573238.16360.30.80450.42533e-04
5422463022.39382554.00673658.18890.00830.69380.10010.0332
5528002937.11662486.56973546.48490.32960.98690.62380.0143
5638693929.81733207.79584979.38470.45480.98260.63430.7198
5730072788.12142368.73383351.49550.22321e-040.70650.0019
5830232919.10522465.30493535.7910.37060.390.58570.0132
5939073839.82093133.52744867.05740.4490.94040.47630.6639
6042093759.22843073.66144752.4750.18740.38530.60980.6098

\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[48]) \tabularnewline
36 & 3889 & - & - & - & - & - & - & - \tabularnewline
37 & 2271 & - & - & - & - & - & - & - \tabularnewline
38 & 2452 & - & - & - & - & - & - & - \tabularnewline
39 & 3084 & - & - & - & - & - & - & - \tabularnewline
40 & 2522 & - & - & - & - & - & - & - \tabularnewline
41 & 2769 & - & - & - & - & - & - & - \tabularnewline
42 & 3438 & - & - & - & - & - & - & - \tabularnewline
43 & 2839 & - & - & - & - & - & - & - \tabularnewline
44 & 3746 & - & - & - & - & - & - & - \tabularnewline
45 & 2632 & - & - & - & - & - & - & - \tabularnewline
46 & 2851 & - & - & - & - & - & - & - \tabularnewline
47 & 3871 & - & - & - & - & - & - & - \tabularnewline
48 & 3618 & - & - & - & - & - & - & - \tabularnewline
49 & 2389 & 2145.1949 & 1890.2073 & 2464.7314 & 0.0674 & 0 & 0.2202 & 0 \tabularnewline
50 & 2344 & 2431.4134 & 2114.5505 & 2838.4103 & 0.3369 & 0.5809 & 0.4605 & 0 \tabularnewline
51 & 2678 & 3003.3709 & 2552.2994 & 3608.988 & 0.1462 & 0.9836 & 0.3971 & 0.0233 \tabularnewline
52 & 2492 & 2629.9008 & 2261.9611 & 3112.5934 & 0.2878 & 0.4226 & 0.6694 & 0 \tabularnewline
53 & 2858 & 2719.1578 & 2327.2557 & 3238.1636 & 0.3 & 0.8045 & 0.4253 & 3e-04 \tabularnewline
54 & 2246 & 3022.3938 & 2554.0067 & 3658.1889 & 0.0083 & 0.6938 & 0.1001 & 0.0332 \tabularnewline
55 & 2800 & 2937.1166 & 2486.5697 & 3546.4849 & 0.3296 & 0.9869 & 0.6238 & 0.0143 \tabularnewline
56 & 3869 & 3929.8173 & 3207.7958 & 4979.3847 & 0.4548 & 0.9826 & 0.6343 & 0.7198 \tabularnewline
57 & 3007 & 2788.1214 & 2368.7338 & 3351.4955 & 0.2232 & 1e-04 & 0.7065 & 0.0019 \tabularnewline
58 & 3023 & 2919.1052 & 2465.3049 & 3535.791 & 0.3706 & 0.39 & 0.5857 & 0.0132 \tabularnewline
59 & 3907 & 3839.8209 & 3133.5274 & 4867.0574 & 0.449 & 0.9404 & 0.4763 & 0.6639 \tabularnewline
60 & 4209 & 3759.2284 & 3073.6614 & 4752.475 & 0.1874 & 0.3853 & 0.6098 & 0.6098 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=315813&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[48])[/C][/ROW]
[ROW][C]36[/C][C]3889[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]2271[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]2452[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]3084[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]2522[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]2769[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]3438[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]2839[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]3746[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]2632[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]2851[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]3871[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]3618[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]2389[/C][C]2145.1949[/C][C]1890.2073[/C][C]2464.7314[/C][C]0.0674[/C][C]0[/C][C]0.2202[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]2344[/C][C]2431.4134[/C][C]2114.5505[/C][C]2838.4103[/C][C]0.3369[/C][C]0.5809[/C][C]0.4605[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]2678[/C][C]3003.3709[/C][C]2552.2994[/C][C]3608.988[/C][C]0.1462[/C][C]0.9836[/C][C]0.3971[/C][C]0.0233[/C][/ROW]
[ROW][C]52[/C][C]2492[/C][C]2629.9008[/C][C]2261.9611[/C][C]3112.5934[/C][C]0.2878[/C][C]0.4226[/C][C]0.6694[/C][C]0[/C][/ROW]
[ROW][C]53[/C][C]2858[/C][C]2719.1578[/C][C]2327.2557[/C][C]3238.1636[/C][C]0.3[/C][C]0.8045[/C][C]0.4253[/C][C]3e-04[/C][/ROW]
[ROW][C]54[/C][C]2246[/C][C]3022.3938[/C][C]2554.0067[/C][C]3658.1889[/C][C]0.0083[/C][C]0.6938[/C][C]0.1001[/C][C]0.0332[/C][/ROW]
[ROW][C]55[/C][C]2800[/C][C]2937.1166[/C][C]2486.5697[/C][C]3546.4849[/C][C]0.3296[/C][C]0.9869[/C][C]0.6238[/C][C]0.0143[/C][/ROW]
[ROW][C]56[/C][C]3869[/C][C]3929.8173[/C][C]3207.7958[/C][C]4979.3847[/C][C]0.4548[/C][C]0.9826[/C][C]0.6343[/C][C]0.7198[/C][/ROW]
[ROW][C]57[/C][C]3007[/C][C]2788.1214[/C][C]2368.7338[/C][C]3351.4955[/C][C]0.2232[/C][C]1e-04[/C][C]0.7065[/C][C]0.0019[/C][/ROW]
[ROW][C]58[/C][C]3023[/C][C]2919.1052[/C][C]2465.3049[/C][C]3535.791[/C][C]0.3706[/C][C]0.39[/C][C]0.5857[/C][C]0.0132[/C][/ROW]
[ROW][C]59[/C][C]3907[/C][C]3839.8209[/C][C]3133.5274[/C][C]4867.0574[/C][C]0.449[/C][C]0.9404[/C][C]0.4763[/C][C]0.6639[/C][/ROW]
[ROW][C]60[/C][C]4209[/C][C]3759.2284[/C][C]3073.6614[/C][C]4752.475[/C][C]0.1874[/C][C]0.3853[/C][C]0.6098[/C][C]0.6098[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=315813&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=315813&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[48])
363889-------
372271-------
382452-------
393084-------
402522-------
412769-------
423438-------
432839-------
443746-------
452632-------
462851-------
473871-------
483618-------
4923892145.19491890.20732464.73140.067400.22020
5023442431.41342114.55052838.41030.33690.58090.46050
5126783003.37092552.29943608.9880.14620.98360.39710.0233
5224922629.90082261.96113112.59340.28780.42260.66940
5328582719.15782327.25573238.16360.30.80450.42533e-04
5422463022.39382554.00673658.18890.00830.69380.10010.0332
5528002937.11662486.56973546.48490.32960.98690.62380.0143
5638693929.81733207.79584979.38470.45480.98260.63430.7198
5730072788.12142368.73383351.49550.22321e-040.70650.0019
5830232919.10522465.30493535.7910.37060.390.58570.0132
5939073839.82093133.52744867.05740.4490.94040.47630.6639
6042093759.22843073.66144752.4750.18740.38530.60980.6098







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
490.0760.10210.10210.107559440.918000.51280.5128
500.0854-0.03730.06970.07217641.109733541.0139183.1421-0.18390.3483
510.1029-0.12150.08690.0862105866.237957649.4219240.1029-0.68430.4603
520.0936-0.05530.0790.078119016.623847991.2224219.069-0.290.4178
530.09740.04860.0730.072519277.14842248.4075205.54420.2920.3926
540.1073-0.34570.11840.1095602787.4025135671.5733368.3362-1.6330.5993
550.1059-0.0490.10850.100718800.9589118975.7713344.9286-0.28840.5549
560.1363-0.01570.09690.09013698.7393104566.1423323.3669-0.12790.5015
570.10310.07280.09420.088447907.838898270.7752313.48170.46040.497
580.10780.03440.08820.083110794.1289523.1097299.20410.21850.4691
590.13650.01720.08180.07714513.030381794.9207285.99810.14130.4393
600.13480.10690.08390.0801202294.520991836.554303.04550.9460.4815

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
49 & 0.076 & 0.1021 & 0.1021 & 0.1075 & 59440.918 & 0 & 0 & 0.5128 & 0.5128 \tabularnewline
50 & 0.0854 & -0.0373 & 0.0697 & 0.0721 & 7641.1097 & 33541.0139 & 183.1421 & -0.1839 & 0.3483 \tabularnewline
51 & 0.1029 & -0.1215 & 0.0869 & 0.0862 & 105866.2379 & 57649.4219 & 240.1029 & -0.6843 & 0.4603 \tabularnewline
52 & 0.0936 & -0.0553 & 0.079 & 0.0781 & 19016.6238 & 47991.2224 & 219.069 & -0.29 & 0.4178 \tabularnewline
53 & 0.0974 & 0.0486 & 0.073 & 0.0725 & 19277.148 & 42248.4075 & 205.5442 & 0.292 & 0.3926 \tabularnewline
54 & 0.1073 & -0.3457 & 0.1184 & 0.1095 & 602787.4025 & 135671.5733 & 368.3362 & -1.633 & 0.5993 \tabularnewline
55 & 0.1059 & -0.049 & 0.1085 & 0.1007 & 18800.9589 & 118975.7713 & 344.9286 & -0.2884 & 0.5549 \tabularnewline
56 & 0.1363 & -0.0157 & 0.0969 & 0.0901 & 3698.7393 & 104566.1423 & 323.3669 & -0.1279 & 0.5015 \tabularnewline
57 & 0.1031 & 0.0728 & 0.0942 & 0.0884 & 47907.8388 & 98270.7752 & 313.4817 & 0.4604 & 0.497 \tabularnewline
58 & 0.1078 & 0.0344 & 0.0882 & 0.0831 & 10794.12 & 89523.1097 & 299.2041 & 0.2185 & 0.4691 \tabularnewline
59 & 0.1365 & 0.0172 & 0.0818 & 0.0771 & 4513.0303 & 81794.9207 & 285.9981 & 0.1413 & 0.4393 \tabularnewline
60 & 0.1348 & 0.1069 & 0.0839 & 0.0801 & 202294.5209 & 91836.554 & 303.0455 & 0.946 & 0.4815 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=315813&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]49[/C][C]0.076[/C][C]0.1021[/C][C]0.1021[/C][C]0.1075[/C][C]59440.918[/C][C]0[/C][C]0[/C][C]0.5128[/C][C]0.5128[/C][/ROW]
[ROW][C]50[/C][C]0.0854[/C][C]-0.0373[/C][C]0.0697[/C][C]0.0721[/C][C]7641.1097[/C][C]33541.0139[/C][C]183.1421[/C][C]-0.1839[/C][C]0.3483[/C][/ROW]
[ROW][C]51[/C][C]0.1029[/C][C]-0.1215[/C][C]0.0869[/C][C]0.0862[/C][C]105866.2379[/C][C]57649.4219[/C][C]240.1029[/C][C]-0.6843[/C][C]0.4603[/C][/ROW]
[ROW][C]52[/C][C]0.0936[/C][C]-0.0553[/C][C]0.079[/C][C]0.0781[/C][C]19016.6238[/C][C]47991.2224[/C][C]219.069[/C][C]-0.29[/C][C]0.4178[/C][/ROW]
[ROW][C]53[/C][C]0.0974[/C][C]0.0486[/C][C]0.073[/C][C]0.0725[/C][C]19277.148[/C][C]42248.4075[/C][C]205.5442[/C][C]0.292[/C][C]0.3926[/C][/ROW]
[ROW][C]54[/C][C]0.1073[/C][C]-0.3457[/C][C]0.1184[/C][C]0.1095[/C][C]602787.4025[/C][C]135671.5733[/C][C]368.3362[/C][C]-1.633[/C][C]0.5993[/C][/ROW]
[ROW][C]55[/C][C]0.1059[/C][C]-0.049[/C][C]0.1085[/C][C]0.1007[/C][C]18800.9589[/C][C]118975.7713[/C][C]344.9286[/C][C]-0.2884[/C][C]0.5549[/C][/ROW]
[ROW][C]56[/C][C]0.1363[/C][C]-0.0157[/C][C]0.0969[/C][C]0.0901[/C][C]3698.7393[/C][C]104566.1423[/C][C]323.3669[/C][C]-0.1279[/C][C]0.5015[/C][/ROW]
[ROW][C]57[/C][C]0.1031[/C][C]0.0728[/C][C]0.0942[/C][C]0.0884[/C][C]47907.8388[/C][C]98270.7752[/C][C]313.4817[/C][C]0.4604[/C][C]0.497[/C][/ROW]
[ROW][C]58[/C][C]0.1078[/C][C]0.0344[/C][C]0.0882[/C][C]0.0831[/C][C]10794.12[/C][C]89523.1097[/C][C]299.2041[/C][C]0.2185[/C][C]0.4691[/C][/ROW]
[ROW][C]59[/C][C]0.1365[/C][C]0.0172[/C][C]0.0818[/C][C]0.0771[/C][C]4513.0303[/C][C]81794.9207[/C][C]285.9981[/C][C]0.1413[/C][C]0.4393[/C][/ROW]
[ROW][C]60[/C][C]0.1348[/C][C]0.1069[/C][C]0.0839[/C][C]0.0801[/C][C]202294.5209[/C][C]91836.554[/C][C]303.0455[/C][C]0.946[/C][C]0.4815[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=315813&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=315813&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
490.0760.10210.10210.107559440.918000.51280.5128
500.0854-0.03730.06970.07217641.109733541.0139183.1421-0.18390.3483
510.1029-0.12150.08690.0862105866.237957649.4219240.1029-0.68430.4603
520.0936-0.05530.0790.078119016.623847991.2224219.069-0.290.4178
530.09740.04860.0730.072519277.14842248.4075205.54420.2920.3926
540.1073-0.34570.11840.1095602787.4025135671.5733368.3362-1.6330.5993
550.1059-0.0490.10850.100718800.9589118975.7713344.9286-0.28840.5549
560.1363-0.01570.09690.09013698.7393104566.1423323.3669-0.12790.5015
570.10310.07280.09420.088447907.838898270.7752313.48170.46040.497
580.10780.03440.08820.083110794.1289523.1097299.20410.21850.4691
590.13650.01720.08180.07714513.030381794.9207285.99810.14130.4393
600.13480.10690.08390.0801202294.520991836.554303.04550.9460.4815



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