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, 12 Dec 2009 08:21:32 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2009/Dec/12/t1260631345iphvb2s85rho4iz.htm/, Retrieved Mon, 29 Apr 2024 09:22:22 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=67013, Retrieved Mon, 29 Apr 2024 09:22:22 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact157
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-06 12:06:08] [8b1aef4e7013bd33fbc2a5833375c5f5]
- R  D    [ARIMA Forecasting] [Workshop10 Foreca...] [2009-12-12 15:21:32] [5ed0eef5d4509bbfdac0ae6d87f3b4bf] [Current]
Feedback Forum

Post a new message
Dataseries X:
87.09
86.92
87.59
90.72
90.69
90.3
89.55
88.94
88.41
87.82
87.07
86.82
86.4
86.02
85.66
85.32
85
84.67
83.94
82.83
81.95
81.19
80.48
78.86
69.47
68.77
70.06
73.95
75.8
77.79
81.57
83.07
84.34
85.1
85.25
84.26
83.63
86.44
85.3
84.1
83.36
82.48
81.58
80.47
79.34
82.13
81.69
80.7
79.88
79.16
78.38
77.42
76.47
75.46
74.48
78.27
80.7
79.91
78.75
77.78
81.14
81.08
80.03
78.91
78.01
76.9
75.97
81.93
80.27
78.67
77.42
76.16
74.7
76.39
76.04
74.65
73.29
71.79
74.39
74.91
74.54
73.08
72.75
71.32
70.38
70.35
70.01
69.36
67.77
69.26
69.8
68.38
67.62
68.39
66.95
65.21
66.64
63.45
60.66
62.34
60.32
58.64
60.46
58.59
61.87
61.85
67.44
77.06
91.74
93.15
94.15
93.11
91.51
89.96
88.16
86.98
88.03
86.24
84.65
83.23
81.7
80.25
78.8
77.51
76.2
75.04
74
75.49
77.14
76.15
76.27
78.19
76.49
77.31
76.65
74.99
73.51
72.07
70.59
71.96
76.29
74.86
74.93
71.9
71.01
77.47
75.78
76.6
76.07
74.57
73.02
72.65
73.16
71.53
69.78
67.98
69.96
72.16
70.47
68.86
67.37
65.87
72.16
71.34
69.93
68.44
67.16
66.01
67.25
70.91
69.75
68.59
67.48
66.31
64.81
66.58
65.97
64.7
64.7
60.94
59.08
58.42
57.77
57.11
53.31
49.96
49.4
48.84
48.3
47.74
47.24
46.76
46.29
48.9
49.23
48.53
48.03
54.34
53.79
53.24
52.96
52.17
51.7
58.55
78.2
77.03
76.19
77.15
75.87
95.47
109.67
112.28
112.01
107.93
105.96
105.06
102.98
102.2
105.23
101.85
99.89
96.23
94.76
91.51
91.63
91.54
85.23
87.83
87.38
84.44
85.19
84.03
86.73
102.52
104.45
106.98
107.02
99.26
94.45
113.44
157.33
147.38
171.89
171.95
132.71
126.02
121.18
115.45
110.48
117.85
117.63
124.65
109.59
111.27
99.78
98.21
99.2
97.97
89.55
87.91
93.34
94.42
93.2
90.29
91.46
89.98
88.35
88.41
82.44
79.89
75.69
75.66
84.5
96.73
87.48
82.39
83.48
79.31
78.16
72.77
72.45
68.46
67.62
68.76
70.07
68.55
65.3
58.96
59.17
62.37
66.28
55.62
55.23
55.85
56.75
50.89
53.88
52.95
55.08
53.61
58.78
61.85
55.91
53.32
46.41
44.57
50
50
53.36
46.23
50.45
49.07
45.85
48.45
49.96
46.53
50.51
47.58
48.05
46.84
47.67
49.16
55.54
55.82
58.22
56.19
57.77
63.19
54.76
55.74
62.54
61.39
69.6
79.23
80
93.68
107.63
100.18
97.3
90.45
80.64
80.58
75.82
85.59
89.35
89.42
104.73
95.32
89.27
90.44
86.97
79.98
81.22
87.35
83.64
82.22
94.4
102.18




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67013&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67013&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67013&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 Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135







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[346])
33479.23-------
33580-------
33693.68-------
337107.63-------
338100.18-------
33997.3-------
34090.45-------
34180.64-------
34280.58-------
34375.82-------
34485.59-------
34589.35-------
34689.42-------
347104.7388.737878.25299.22360.00140.44930.94880.4493
34895.3289.523573.7394105.30750.23580.02950.30290.5051
34989.2791.998572.2067111.79030.39350.37110.06080.6008
35090.4491.82268.703114.9410.45340.58560.23930.5807
35186.9791.840665.8156117.86570.35690.5420.34050.5723
35279.9890.7162.0722119.34770.23140.6010.50710.5352
35381.2287.795556.7642118.82680.3390.68920.67430.4591
35487.3587.976954.724121.22980.48530.65480.66860.4661
35583.6488.234252.899123.56940.39940.51960.75450.4738
35682.2288.371451.07125.67280.37330.59820.55810.478
35794.489.612950.4438128.78190.40530.64430.50520.5038
358102.1889.59648.6444130.54760.27350.40910.50340.5034

\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[346]) \tabularnewline
334 & 79.23 & - & - & - & - & - & - & - \tabularnewline
335 & 80 & - & - & - & - & - & - & - \tabularnewline
336 & 93.68 & - & - & - & - & - & - & - \tabularnewline
337 & 107.63 & - & - & - & - & - & - & - \tabularnewline
338 & 100.18 & - & - & - & - & - & - & - \tabularnewline
339 & 97.3 & - & - & - & - & - & - & - \tabularnewline
340 & 90.45 & - & - & - & - & - & - & - \tabularnewline
341 & 80.64 & - & - & - & - & - & - & - \tabularnewline
342 & 80.58 & - & - & - & - & - & - & - \tabularnewline
343 & 75.82 & - & - & - & - & - & - & - \tabularnewline
344 & 85.59 & - & - & - & - & - & - & - \tabularnewline
345 & 89.35 & - & - & - & - & - & - & - \tabularnewline
346 & 89.42 & - & - & - & - & - & - & - \tabularnewline
347 & 104.73 & 88.7378 & 78.252 & 99.2236 & 0.0014 & 0.4493 & 0.9488 & 0.4493 \tabularnewline
348 & 95.32 & 89.5235 & 73.7394 & 105.3075 & 0.2358 & 0.0295 & 0.3029 & 0.5051 \tabularnewline
349 & 89.27 & 91.9985 & 72.2067 & 111.7903 & 0.3935 & 0.3711 & 0.0608 & 0.6008 \tabularnewline
350 & 90.44 & 91.822 & 68.703 & 114.941 & 0.4534 & 0.5856 & 0.2393 & 0.5807 \tabularnewline
351 & 86.97 & 91.8406 & 65.8156 & 117.8657 & 0.3569 & 0.542 & 0.3405 & 0.5723 \tabularnewline
352 & 79.98 & 90.71 & 62.0722 & 119.3477 & 0.2314 & 0.601 & 0.5071 & 0.5352 \tabularnewline
353 & 81.22 & 87.7955 & 56.7642 & 118.8268 & 0.339 & 0.6892 & 0.6743 & 0.4591 \tabularnewline
354 & 87.35 & 87.9769 & 54.724 & 121.2298 & 0.4853 & 0.6548 & 0.6686 & 0.4661 \tabularnewline
355 & 83.64 & 88.2342 & 52.899 & 123.5694 & 0.3994 & 0.5196 & 0.7545 & 0.4738 \tabularnewline
356 & 82.22 & 88.3714 & 51.07 & 125.6728 & 0.3733 & 0.5982 & 0.5581 & 0.478 \tabularnewline
357 & 94.4 & 89.6129 & 50.4438 & 128.7819 & 0.4053 & 0.6443 & 0.5052 & 0.5038 \tabularnewline
358 & 102.18 & 89.596 & 48.6444 & 130.5476 & 0.2735 & 0.4091 & 0.5034 & 0.5034 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67013&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[346])[/C][/ROW]
[ROW][C]334[/C][C]79.23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]335[/C][C]80[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]336[/C][C]93.68[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]337[/C][C]107.63[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]338[/C][C]100.18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]339[/C][C]97.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]340[/C][C]90.45[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]341[/C][C]80.64[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]342[/C][C]80.58[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]343[/C][C]75.82[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]344[/C][C]85.59[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]345[/C][C]89.35[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]346[/C][C]89.42[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]347[/C][C]104.73[/C][C]88.7378[/C][C]78.252[/C][C]99.2236[/C][C]0.0014[/C][C]0.4493[/C][C]0.9488[/C][C]0.4493[/C][/ROW]
[ROW][C]348[/C][C]95.32[/C][C]89.5235[/C][C]73.7394[/C][C]105.3075[/C][C]0.2358[/C][C]0.0295[/C][C]0.3029[/C][C]0.5051[/C][/ROW]
[ROW][C]349[/C][C]89.27[/C][C]91.9985[/C][C]72.2067[/C][C]111.7903[/C][C]0.3935[/C][C]0.3711[/C][C]0.0608[/C][C]0.6008[/C][/ROW]
[ROW][C]350[/C][C]90.44[/C][C]91.822[/C][C]68.703[/C][C]114.941[/C][C]0.4534[/C][C]0.5856[/C][C]0.2393[/C][C]0.5807[/C][/ROW]
[ROW][C]351[/C][C]86.97[/C][C]91.8406[/C][C]65.8156[/C][C]117.8657[/C][C]0.3569[/C][C]0.542[/C][C]0.3405[/C][C]0.5723[/C][/ROW]
[ROW][C]352[/C][C]79.98[/C][C]90.71[/C][C]62.0722[/C][C]119.3477[/C][C]0.2314[/C][C]0.601[/C][C]0.5071[/C][C]0.5352[/C][/ROW]
[ROW][C]353[/C][C]81.22[/C][C]87.7955[/C][C]56.7642[/C][C]118.8268[/C][C]0.339[/C][C]0.6892[/C][C]0.6743[/C][C]0.4591[/C][/ROW]
[ROW][C]354[/C][C]87.35[/C][C]87.9769[/C][C]54.724[/C][C]121.2298[/C][C]0.4853[/C][C]0.6548[/C][C]0.6686[/C][C]0.4661[/C][/ROW]
[ROW][C]355[/C][C]83.64[/C][C]88.2342[/C][C]52.899[/C][C]123.5694[/C][C]0.3994[/C][C]0.5196[/C][C]0.7545[/C][C]0.4738[/C][/ROW]
[ROW][C]356[/C][C]82.22[/C][C]88.3714[/C][C]51.07[/C][C]125.6728[/C][C]0.3733[/C][C]0.5982[/C][C]0.5581[/C][C]0.478[/C][/ROW]
[ROW][C]357[/C][C]94.4[/C][C]89.6129[/C][C]50.4438[/C][C]128.7819[/C][C]0.4053[/C][C]0.6443[/C][C]0.5052[/C][C]0.5038[/C][/ROW]
[ROW][C]358[/C][C]102.18[/C][C]89.596[/C][C]48.6444[/C][C]130.5476[/C][C]0.2735[/C][C]0.4091[/C][C]0.5034[/C][C]0.5034[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67013&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67013&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[346])
33479.23-------
33580-------
33693.68-------
337107.63-------
338100.18-------
33997.3-------
34090.45-------
34180.64-------
34280.58-------
34375.82-------
34485.59-------
34589.35-------
34689.42-------
347104.7388.737878.25299.22360.00140.44930.94880.4493
34895.3289.523573.7394105.30750.23580.02950.30290.5051
34989.2791.998572.2067111.79030.39350.37110.06080.6008
35090.4491.82268.703114.9410.45340.58560.23930.5807
35186.9791.840665.8156117.86570.35690.5420.34050.5723
35279.9890.7162.0722119.34770.23140.6010.50710.5352
35381.2287.795556.7642118.82680.3390.68920.67430.4591
35487.3587.976954.724121.22980.48530.65480.66860.4661
35583.6488.234252.899123.56940.39940.51960.75450.4738
35682.2288.371451.07125.67280.37330.59820.55810.478
35794.489.612950.4438128.78190.40530.64430.50520.5038
358102.1889.59648.6444130.54760.27350.40910.50340.5034







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
3470.06030.18020.015255.749321.31244.6165
3480.090.06470.005433.62.81.6733
3490.1098-0.02970.00257.44490.62040.7877
3500.1285-0.01510.00131.90990.15920.3989
3510.1446-0.0530.004423.72311.97691.406
3520.1611-0.11830.0099115.13219.59433.0975
3530.1803-0.07490.006243.23723.60311.8982
3540.1928-0.00716e-040.3930.03280.181
3550.2043-0.05210.004321.10641.75891.3262
3560.2154-0.06960.005837.84023.15341.7758
3570.2230.05340.004522.91681.90971.3819
3580.23320.14050.0117158.357213.19643.6327

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
347 & 0.0603 & 0.1802 & 0.015 & 255.7493 & 21.3124 & 4.6165 \tabularnewline
348 & 0.09 & 0.0647 & 0.0054 & 33.6 & 2.8 & 1.6733 \tabularnewline
349 & 0.1098 & -0.0297 & 0.0025 & 7.4449 & 0.6204 & 0.7877 \tabularnewline
350 & 0.1285 & -0.0151 & 0.0013 & 1.9099 & 0.1592 & 0.3989 \tabularnewline
351 & 0.1446 & -0.053 & 0.0044 & 23.7231 & 1.9769 & 1.406 \tabularnewline
352 & 0.1611 & -0.1183 & 0.0099 & 115.1321 & 9.5943 & 3.0975 \tabularnewline
353 & 0.1803 & -0.0749 & 0.0062 & 43.2372 & 3.6031 & 1.8982 \tabularnewline
354 & 0.1928 & -0.0071 & 6e-04 & 0.393 & 0.0328 & 0.181 \tabularnewline
355 & 0.2043 & -0.0521 & 0.0043 & 21.1064 & 1.7589 & 1.3262 \tabularnewline
356 & 0.2154 & -0.0696 & 0.0058 & 37.8402 & 3.1534 & 1.7758 \tabularnewline
357 & 0.223 & 0.0534 & 0.0045 & 22.9168 & 1.9097 & 1.3819 \tabularnewline
358 & 0.2332 & 0.1405 & 0.0117 & 158.3572 & 13.1964 & 3.6327 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67013&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]Sq.E[/C][C]MSE[/C][C]RMSE[/C][/ROW]
[ROW][C]347[/C][C]0.0603[/C][C]0.1802[/C][C]0.015[/C][C]255.7493[/C][C]21.3124[/C][C]4.6165[/C][/ROW]
[ROW][C]348[/C][C]0.09[/C][C]0.0647[/C][C]0.0054[/C][C]33.6[/C][C]2.8[/C][C]1.6733[/C][/ROW]
[ROW][C]349[/C][C]0.1098[/C][C]-0.0297[/C][C]0.0025[/C][C]7.4449[/C][C]0.6204[/C][C]0.7877[/C][/ROW]
[ROW][C]350[/C][C]0.1285[/C][C]-0.0151[/C][C]0.0013[/C][C]1.9099[/C][C]0.1592[/C][C]0.3989[/C][/ROW]
[ROW][C]351[/C][C]0.1446[/C][C]-0.053[/C][C]0.0044[/C][C]23.7231[/C][C]1.9769[/C][C]1.406[/C][/ROW]
[ROW][C]352[/C][C]0.1611[/C][C]-0.1183[/C][C]0.0099[/C][C]115.1321[/C][C]9.5943[/C][C]3.0975[/C][/ROW]
[ROW][C]353[/C][C]0.1803[/C][C]-0.0749[/C][C]0.0062[/C][C]43.2372[/C][C]3.6031[/C][C]1.8982[/C][/ROW]
[ROW][C]354[/C][C]0.1928[/C][C]-0.0071[/C][C]6e-04[/C][C]0.393[/C][C]0.0328[/C][C]0.181[/C][/ROW]
[ROW][C]355[/C][C]0.2043[/C][C]-0.0521[/C][C]0.0043[/C][C]21.1064[/C][C]1.7589[/C][C]1.3262[/C][/ROW]
[ROW][C]356[/C][C]0.2154[/C][C]-0.0696[/C][C]0.0058[/C][C]37.8402[/C][C]3.1534[/C][C]1.7758[/C][/ROW]
[ROW][C]357[/C][C]0.223[/C][C]0.0534[/C][C]0.0045[/C][C]22.9168[/C][C]1.9097[/C][C]1.3819[/C][/ROW]
[ROW][C]358[/C][C]0.2332[/C][C]0.1405[/C][C]0.0117[/C][C]158.3572[/C][C]13.1964[/C][C]3.6327[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67013&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67013&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.PEMAPESq.EMSERMSE
3470.06030.18020.015255.749321.31244.6165
3480.090.06470.005433.62.81.6733
3490.1098-0.02970.00257.44490.62040.7877
3500.1285-0.01510.00131.90990.15920.3989
3510.1446-0.0530.004423.72311.97691.406
3520.1611-0.11830.0099115.13219.59433.0975
3530.1803-0.07490.006243.23723.60311.8982
3540.1928-0.00716e-040.3930.03280.181
3550.2043-0.05210.004321.10641.75891.3262
3560.2154-0.06960.005837.84023.15341.7758
3570.2230.05340.004522.91681.90971.3819
3580.23320.14050.0117158.357213.19643.6327



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 2 ; par7 = 0 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 2 ; 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
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.mape <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- array(0, dim=fx)
perf.rmse <- array(0, dim=fx)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / forecast$pred[i]
perf.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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',7,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,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')