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 computationSun, 14 Dec 2008 03:47:19 -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/2008/Dec/14/t12292516903x2morjcece0m6u.htm/, Retrieved Wed, 15 May 2024 15:02:06 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=33273, Retrieved Wed, 15 May 2024 15:02:06 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordspaper , ARIMA forecast
Estimated Impact209
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [(Partial) Autocorrelation Function] [loïqueverhasselt] [2008-12-11 14:48:43] [0e879b146665902680dd148a904a2646]
- RMP     [ARIMA Forecasting] [loïqueverhasselt] [2008-12-14 10:47:19] [6440ec5a21e5d35520cb2ae6b4b70e45] [Current]
Feedback Forum

Post a new message
Dataseries X:
77.7
78.89
90.2
77.26
80.76
84.93
66.08
71.56
80.78
83.31
85.3
73.94
78.7
81.32
86.8
80.76
84.46
84.21
73.64
70.85
83.78
89.12
78.93
80.54
81.67
82.53
88.2
89.17
83.7
89.79
77.58
70.11
88.07
92.49
83.33
90.05
82.91
88.52
96.42
90.87
86.4
97.47
85.67
79.91
95.73
94.6
91.92
90.38
82.31
87.82
101.29
89.58
87.83
99.95
82.67
84.65
97.83
97.47
97.66
99.14
90.02
100.97
112.48
91.44
108.46
98.41
89.35
92.8
100.43
104.85
108.36
101.54
105.26
101.8
112.36
99.5
104.65
101.13
89.8
87.84
96.41
103.26
100.31
92.33
96.19
96.37
103.06
101.5
101.88
100.85
95.56
87.6
101.18
110.8
101.1
104.42
103.27
100.87
107.8
104.99
100.76
104.46
100.62
87.84
107.31
115.61
103.43
109.93
104.43
106.69
123.1
109.42
101.46
124.48
101.49
100.46
115.51
113.37
115.4
118.2
106.82
110.17
119.91
112.31
110.62
120.37
97.94
103.02
116.36
108.51
122.54
121.32
112.25
109.89
129.58
107.2
118.68
118.25
102.67
104.19
117.74
123.3
122.2
112.71
118.53
115.32
127.36
110.45
122.22
123.39
116.2
109.22
116.98
132.89
125.24
115.68




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 5 seconds \tabularnewline
R Server & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33273&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]5 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33273&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33273&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 time5 seconds
R Server'George Udny Yule' @ 72.249.76.132







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[144])
132121.32-------
133112.25-------
134109.89-------
135129.58-------
136107.2-------
137118.68-------
138118.25-------
139102.67-------
140104.19-------
141117.74-------
142123.3-------
143122.2-------
144112.71-------
145118.53117.6604109.7318125.98170.41890.87820.89870.8782
146115.32115.0371107.2323123.23110.4730.20170.89090.7111
147127.36127.6625118.6857137.10410.4750.99480.34530.999
148110.45116.5656106.9271126.79650.12070.01930.96360.7699
149122.22118.3404108.5037128.78510.23330.93070.47460.8547
150123.39121.669110.9912133.04590.38340.46220.72210.9386
151116.2109.299298.9013120.43930.11230.00660.87830.2742
152109.22104.651994.3635115.70090.20890.02030.53270.0764
153116.98120.5611108.6631133.34230.29140.9590.66740.8857
154132.89127.5729114.8109141.29610.22380.93480.72920.9831
155125.24120.4345107.8848133.9720.24330.03570.39910.8683
156115.68117.5434104.8088131.32350.39550.13680.75410.7541

\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[144]) \tabularnewline
132 & 121.32 & - & - & - & - & - & - & - \tabularnewline
133 & 112.25 & - & - & - & - & - & - & - \tabularnewline
134 & 109.89 & - & - & - & - & - & - & - \tabularnewline
135 & 129.58 & - & - & - & - & - & - & - \tabularnewline
136 & 107.2 & - & - & - & - & - & - & - \tabularnewline
137 & 118.68 & - & - & - & - & - & - & - \tabularnewline
138 & 118.25 & - & - & - & - & - & - & - \tabularnewline
139 & 102.67 & - & - & - & - & - & - & - \tabularnewline
140 & 104.19 & - & - & - & - & - & - & - \tabularnewline
141 & 117.74 & - & - & - & - & - & - & - \tabularnewline
142 & 123.3 & - & - & - & - & - & - & - \tabularnewline
143 & 122.2 & - & - & - & - & - & - & - \tabularnewline
144 & 112.71 & - & - & - & - & - & - & - \tabularnewline
145 & 118.53 & 117.6604 & 109.7318 & 125.9817 & 0.4189 & 0.8782 & 0.8987 & 0.8782 \tabularnewline
146 & 115.32 & 115.0371 & 107.2323 & 123.2311 & 0.473 & 0.2017 & 0.8909 & 0.7111 \tabularnewline
147 & 127.36 & 127.6625 & 118.6857 & 137.1041 & 0.475 & 0.9948 & 0.3453 & 0.999 \tabularnewline
148 & 110.45 & 116.5656 & 106.9271 & 126.7965 & 0.1207 & 0.0193 & 0.9636 & 0.7699 \tabularnewline
149 & 122.22 & 118.3404 & 108.5037 & 128.7851 & 0.2333 & 0.9307 & 0.4746 & 0.8547 \tabularnewline
150 & 123.39 & 121.669 & 110.9912 & 133.0459 & 0.3834 & 0.4622 & 0.7221 & 0.9386 \tabularnewline
151 & 116.2 & 109.2992 & 98.9013 & 120.4393 & 0.1123 & 0.0066 & 0.8783 & 0.2742 \tabularnewline
152 & 109.22 & 104.6519 & 94.3635 & 115.7009 & 0.2089 & 0.0203 & 0.5327 & 0.0764 \tabularnewline
153 & 116.98 & 120.5611 & 108.6631 & 133.3423 & 0.2914 & 0.959 & 0.6674 & 0.8857 \tabularnewline
154 & 132.89 & 127.5729 & 114.8109 & 141.2961 & 0.2238 & 0.9348 & 0.7292 & 0.9831 \tabularnewline
155 & 125.24 & 120.4345 & 107.8848 & 133.972 & 0.2433 & 0.0357 & 0.3991 & 0.8683 \tabularnewline
156 & 115.68 & 117.5434 & 104.8088 & 131.3235 & 0.3955 & 0.1368 & 0.7541 & 0.7541 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33273&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[144])[/C][/ROW]
[ROW][C]132[/C][C]121.32[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]133[/C][C]112.25[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]134[/C][C]109.89[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]135[/C][C]129.58[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]136[/C][C]107.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]137[/C][C]118.68[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]138[/C][C]118.25[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]139[/C][C]102.67[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]140[/C][C]104.19[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]141[/C][C]117.74[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]142[/C][C]123.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]143[/C][C]122.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]144[/C][C]112.71[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]145[/C][C]118.53[/C][C]117.6604[/C][C]109.7318[/C][C]125.9817[/C][C]0.4189[/C][C]0.8782[/C][C]0.8987[/C][C]0.8782[/C][/ROW]
[ROW][C]146[/C][C]115.32[/C][C]115.0371[/C][C]107.2323[/C][C]123.2311[/C][C]0.473[/C][C]0.2017[/C][C]0.8909[/C][C]0.7111[/C][/ROW]
[ROW][C]147[/C][C]127.36[/C][C]127.6625[/C][C]118.6857[/C][C]137.1041[/C][C]0.475[/C][C]0.9948[/C][C]0.3453[/C][C]0.999[/C][/ROW]
[ROW][C]148[/C][C]110.45[/C][C]116.5656[/C][C]106.9271[/C][C]126.7965[/C][C]0.1207[/C][C]0.0193[/C][C]0.9636[/C][C]0.7699[/C][/ROW]
[ROW][C]149[/C][C]122.22[/C][C]118.3404[/C][C]108.5037[/C][C]128.7851[/C][C]0.2333[/C][C]0.9307[/C][C]0.4746[/C][C]0.8547[/C][/ROW]
[ROW][C]150[/C][C]123.39[/C][C]121.669[/C][C]110.9912[/C][C]133.0459[/C][C]0.3834[/C][C]0.4622[/C][C]0.7221[/C][C]0.9386[/C][/ROW]
[ROW][C]151[/C][C]116.2[/C][C]109.2992[/C][C]98.9013[/C][C]120.4393[/C][C]0.1123[/C][C]0.0066[/C][C]0.8783[/C][C]0.2742[/C][/ROW]
[ROW][C]152[/C][C]109.22[/C][C]104.6519[/C][C]94.3635[/C][C]115.7009[/C][C]0.2089[/C][C]0.0203[/C][C]0.5327[/C][C]0.0764[/C][/ROW]
[ROW][C]153[/C][C]116.98[/C][C]120.5611[/C][C]108.6631[/C][C]133.3423[/C][C]0.2914[/C][C]0.959[/C][C]0.6674[/C][C]0.8857[/C][/ROW]
[ROW][C]154[/C][C]132.89[/C][C]127.5729[/C][C]114.8109[/C][C]141.2961[/C][C]0.2238[/C][C]0.9348[/C][C]0.7292[/C][C]0.9831[/C][/ROW]
[ROW][C]155[/C][C]125.24[/C][C]120.4345[/C][C]107.8848[/C][C]133.972[/C][C]0.2433[/C][C]0.0357[/C][C]0.3991[/C][C]0.8683[/C][/ROW]
[ROW][C]156[/C][C]115.68[/C][C]117.5434[/C][C]104.8088[/C][C]131.3235[/C][C]0.3955[/C][C]0.1368[/C][C]0.7541[/C][C]0.7541[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33273&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33273&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[144])
132121.32-------
133112.25-------
134109.89-------
135129.58-------
136107.2-------
137118.68-------
138118.25-------
139102.67-------
140104.19-------
141117.74-------
142123.3-------
143122.2-------
144112.71-------
145118.53117.6604109.7318125.98170.41890.87820.89870.8782
146115.32115.0371107.2323123.23110.4730.20170.89090.7111
147127.36127.6625118.6857137.10410.4750.99480.34530.999
148110.45116.5656106.9271126.79650.12070.01930.96360.7699
149122.22118.3404108.5037128.78510.23330.93070.47460.8547
150123.39121.669110.9912133.04590.38340.46220.72210.9386
151116.2109.299298.9013120.43930.11230.00660.87830.2742
152109.22104.651994.3635115.70090.20890.02030.53270.0764
153116.98120.5611108.6631133.34230.29140.9590.66740.8857
154132.89127.5729114.8109141.29610.22380.93480.72920.9831
155125.24120.4345107.8848133.9720.24330.03570.39910.8683
156115.68117.5434104.8088131.32350.39550.13680.75410.7541







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1450.03610.00746e-040.75610.0630.251
1460.03630.00252e-040.080.00670.0817
1470.0377-0.00242e-040.09150.00760.0873
1480.0448-0.05250.004437.40093.11671.7654
1490.0450.03280.002715.05091.25421.1199
1500.04770.01410.00122.96190.24680.4968
1510.0520.06310.005347.62083.96841.9921
1520.05390.04370.003620.86761.7391.3187
1530.0541-0.02970.002512.82411.06871.0338
1540.05490.04170.003528.27192.3561.5349
1550.05730.03990.003323.09331.92441.3872
1560.0598-0.01590.00133.47220.28940.5379

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
145 & 0.0361 & 0.0074 & 6e-04 & 0.7561 & 0.063 & 0.251 \tabularnewline
146 & 0.0363 & 0.0025 & 2e-04 & 0.08 & 0.0067 & 0.0817 \tabularnewline
147 & 0.0377 & -0.0024 & 2e-04 & 0.0915 & 0.0076 & 0.0873 \tabularnewline
148 & 0.0448 & -0.0525 & 0.0044 & 37.4009 & 3.1167 & 1.7654 \tabularnewline
149 & 0.045 & 0.0328 & 0.0027 & 15.0509 & 1.2542 & 1.1199 \tabularnewline
150 & 0.0477 & 0.0141 & 0.0012 & 2.9619 & 0.2468 & 0.4968 \tabularnewline
151 & 0.052 & 0.0631 & 0.0053 & 47.6208 & 3.9684 & 1.9921 \tabularnewline
152 & 0.0539 & 0.0437 & 0.0036 & 20.8676 & 1.739 & 1.3187 \tabularnewline
153 & 0.0541 & -0.0297 & 0.0025 & 12.8241 & 1.0687 & 1.0338 \tabularnewline
154 & 0.0549 & 0.0417 & 0.0035 & 28.2719 & 2.356 & 1.5349 \tabularnewline
155 & 0.0573 & 0.0399 & 0.0033 & 23.0933 & 1.9244 & 1.3872 \tabularnewline
156 & 0.0598 & -0.0159 & 0.0013 & 3.4722 & 0.2894 & 0.5379 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33273&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]145[/C][C]0.0361[/C][C]0.0074[/C][C]6e-04[/C][C]0.7561[/C][C]0.063[/C][C]0.251[/C][/ROW]
[ROW][C]146[/C][C]0.0363[/C][C]0.0025[/C][C]2e-04[/C][C]0.08[/C][C]0.0067[/C][C]0.0817[/C][/ROW]
[ROW][C]147[/C][C]0.0377[/C][C]-0.0024[/C][C]2e-04[/C][C]0.0915[/C][C]0.0076[/C][C]0.0873[/C][/ROW]
[ROW][C]148[/C][C]0.0448[/C][C]-0.0525[/C][C]0.0044[/C][C]37.4009[/C][C]3.1167[/C][C]1.7654[/C][/ROW]
[ROW][C]149[/C][C]0.045[/C][C]0.0328[/C][C]0.0027[/C][C]15.0509[/C][C]1.2542[/C][C]1.1199[/C][/ROW]
[ROW][C]150[/C][C]0.0477[/C][C]0.0141[/C][C]0.0012[/C][C]2.9619[/C][C]0.2468[/C][C]0.4968[/C][/ROW]
[ROW][C]151[/C][C]0.052[/C][C]0.0631[/C][C]0.0053[/C][C]47.6208[/C][C]3.9684[/C][C]1.9921[/C][/ROW]
[ROW][C]152[/C][C]0.0539[/C][C]0.0437[/C][C]0.0036[/C][C]20.8676[/C][C]1.739[/C][C]1.3187[/C][/ROW]
[ROW][C]153[/C][C]0.0541[/C][C]-0.0297[/C][C]0.0025[/C][C]12.8241[/C][C]1.0687[/C][C]1.0338[/C][/ROW]
[ROW][C]154[/C][C]0.0549[/C][C]0.0417[/C][C]0.0035[/C][C]28.2719[/C][C]2.356[/C][C]1.5349[/C][/ROW]
[ROW][C]155[/C][C]0.0573[/C][C]0.0399[/C][C]0.0033[/C][C]23.0933[/C][C]1.9244[/C][C]1.3872[/C][/ROW]
[ROW][C]156[/C][C]0.0598[/C][C]-0.0159[/C][C]0.0013[/C][C]3.4722[/C][C]0.2894[/C][C]0.5379[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33273&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33273&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
1450.03610.00746e-040.75610.0630.251
1460.03630.00252e-040.080.00670.0817
1470.0377-0.00242e-040.09150.00760.0873
1480.0448-0.05250.004437.40093.11671.7654
1490.0450.03280.002715.05091.25421.1199
1500.04770.01410.00122.96190.24680.4968
1510.0520.06310.005347.62083.96841.9921
1520.05390.04370.003620.86761.7391.3187
1530.0541-0.02970.002512.82411.06871.0338
1540.05490.04170.003528.27192.3561.5349
1550.05730.03990.003323.09331.92441.3872
1560.0598-0.01590.00133.47220.28940.5379



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