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 computationFri, 11 Dec 2009 04:25:10 -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/11/t12605307554y080rh3cctzxbx.htm/, Retrieved Mon, 29 Apr 2024 05:19:42 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=65999, Retrieved Mon, 29 Apr 2024 05:19:42 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact231
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-12 13:32:37] [76963dc1903f0f612b6153510a3818cf]
- R  D  [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-17 12:14:40] [76963dc1903f0f612b6153510a3818cf]
-         [Univariate Explorative Data Analysis] [Run Sequence Plot...] [2008-12-22 18:19:51] [1ce0d16c8f4225c977b42c8fa93bc163]
- RMP       [Univariate Data Series] [Identifying Integ...] [2009-11-22 12:08:06] [b98453cac15ba1066b407e146608df68]
-   PD        [Univariate Data Series] [Totaal Werkzoeken...] [2009-11-24 16:54:07] [ee7c2e7343f5b1451e62c5c16ec521f1]
-   P           [Univariate Data Series] [Totaal Werkzoeken...] [2009-11-24 17:23:40] [ee7c2e7343f5b1451e62c5c16ec521f1]
-   PD            [Univariate Data Series] [] [2009-12-04 16:45:53] [b7349fb284cae6f1172638396d27b11f]
-   PD              [Univariate Data Series] [] [2009-12-06 12:40:12] [f57b281e621ed7dff28b90886f5aa97c]
- RMP                   [ARIMA Forecasting] [] [2009-12-11 11:25:10] [4d89445a8ea4b299af2ee123046cffa6] [Current]
-                         [ARIMA Forecasting] [] [2009-12-11 11:37:19] [1eac2882020791f6c49a90a91c34285a]
Feedback Forum

Post a new message
Dataseries X:
97.4
97
105.4
102.7
98.1
104.5
87.4
89.9
109.8
111.7
98.6
96.9
95.1
97
112.7
102.9
97.4
111.4
87.4
96.8
114.1
110.3
103.9
101.6
94.6
95.9
104.7
102.8
98.1
113.9
80.9
95.7
113.2
105.9
108.8
102.3
99
100.7
115.5
100.7
109.9
114.6
85.4
100.5
114.8
116.5
112.9
102
106
105.3
118.8
106.1
109.3
117.2
92.5
104.2
112.5
122.4
113.3




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65999&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[47])
35108.8-------
36102.3-------
3799-------
38100.7-------
39115.5-------
40100.7-------
41109.9-------
42114.6-------
4385.4-------
44100.5-------
45114.8-------
46116.5-------
47112.9-------
48102106.784798.4193115.150.13110.0760.85330.076
49106103.825795.46112.19140.30520.66560.87090.0168
50105.3103.637294.6886112.58580.35790.30240.740.0212
51118.8118.7052109.3996128.01070.4920.99760.75020.8893
52106.1103.292293.9151112.66930.27866e-040.7060.0223
53109.3112.0097102.4318121.58750.28960.88670.6670.4277
54117.2116.5653106.9104126.22030.44870.92990.6550.7716
5592.586.99277.275796.70830.133300.62590
56104.2101.8992.1159111.66410.32160.97010.60980.0136
57112.5116.0051106.1996125.81060.24180.99090.59520.7326
58122.4117.5136107.6805127.34670.1650.84120.58010.8211
59113.3113.7821103.9293123.63490.46180.04320.56960.5696

\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[47]) \tabularnewline
35 & 108.8 & - & - & - & - & - & - & - \tabularnewline
36 & 102.3 & - & - & - & - & - & - & - \tabularnewline
37 & 99 & - & - & - & - & - & - & - \tabularnewline
38 & 100.7 & - & - & - & - & - & - & - \tabularnewline
39 & 115.5 & - & - & - & - & - & - & - \tabularnewline
40 & 100.7 & - & - & - & - & - & - & - \tabularnewline
41 & 109.9 & - & - & - & - & - & - & - \tabularnewline
42 & 114.6 & - & - & - & - & - & - & - \tabularnewline
43 & 85.4 & - & - & - & - & - & - & - \tabularnewline
44 & 100.5 & - & - & - & - & - & - & - \tabularnewline
45 & 114.8 & - & - & - & - & - & - & - \tabularnewline
46 & 116.5 & - & - & - & - & - & - & - \tabularnewline
47 & 112.9 & - & - & - & - & - & - & - \tabularnewline
48 & 102 & 106.7847 & 98.4193 & 115.15 & 0.1311 & 0.076 & 0.8533 & 0.076 \tabularnewline
49 & 106 & 103.8257 & 95.46 & 112.1914 & 0.3052 & 0.6656 & 0.8709 & 0.0168 \tabularnewline
50 & 105.3 & 103.6372 & 94.6886 & 112.5858 & 0.3579 & 0.3024 & 0.74 & 0.0212 \tabularnewline
51 & 118.8 & 118.7052 & 109.3996 & 128.0107 & 0.492 & 0.9976 & 0.7502 & 0.8893 \tabularnewline
52 & 106.1 & 103.2922 & 93.9151 & 112.6693 & 0.2786 & 6e-04 & 0.706 & 0.0223 \tabularnewline
53 & 109.3 & 112.0097 & 102.4318 & 121.5875 & 0.2896 & 0.8867 & 0.667 & 0.4277 \tabularnewline
54 & 117.2 & 116.5653 & 106.9104 & 126.2203 & 0.4487 & 0.9299 & 0.655 & 0.7716 \tabularnewline
55 & 92.5 & 86.992 & 77.2757 & 96.7083 & 0.1333 & 0 & 0.6259 & 0 \tabularnewline
56 & 104.2 & 101.89 & 92.1159 & 111.6641 & 0.3216 & 0.9701 & 0.6098 & 0.0136 \tabularnewline
57 & 112.5 & 116.0051 & 106.1996 & 125.8106 & 0.2418 & 0.9909 & 0.5952 & 0.7326 \tabularnewline
58 & 122.4 & 117.5136 & 107.6805 & 127.3467 & 0.165 & 0.8412 & 0.5801 & 0.8211 \tabularnewline
59 & 113.3 & 113.7821 & 103.9293 & 123.6349 & 0.4618 & 0.0432 & 0.5696 & 0.5696 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65999&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[47])[/C][/ROW]
[ROW][C]35[/C][C]108.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]102.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]99[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]100.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]115.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]100.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]109.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]114.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]85.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]100.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]114.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]116.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]112.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]102[/C][C]106.7847[/C][C]98.4193[/C][C]115.15[/C][C]0.1311[/C][C]0.076[/C][C]0.8533[/C][C]0.076[/C][/ROW]
[ROW][C]49[/C][C]106[/C][C]103.8257[/C][C]95.46[/C][C]112.1914[/C][C]0.3052[/C][C]0.6656[/C][C]0.8709[/C][C]0.0168[/C][/ROW]
[ROW][C]50[/C][C]105.3[/C][C]103.6372[/C][C]94.6886[/C][C]112.5858[/C][C]0.3579[/C][C]0.3024[/C][C]0.74[/C][C]0.0212[/C][/ROW]
[ROW][C]51[/C][C]118.8[/C][C]118.7052[/C][C]109.3996[/C][C]128.0107[/C][C]0.492[/C][C]0.9976[/C][C]0.7502[/C][C]0.8893[/C][/ROW]
[ROW][C]52[/C][C]106.1[/C][C]103.2922[/C][C]93.9151[/C][C]112.6693[/C][C]0.2786[/C][C]6e-04[/C][C]0.706[/C][C]0.0223[/C][/ROW]
[ROW][C]53[/C][C]109.3[/C][C]112.0097[/C][C]102.4318[/C][C]121.5875[/C][C]0.2896[/C][C]0.8867[/C][C]0.667[/C][C]0.4277[/C][/ROW]
[ROW][C]54[/C][C]117.2[/C][C]116.5653[/C][C]106.9104[/C][C]126.2203[/C][C]0.4487[/C][C]0.9299[/C][C]0.655[/C][C]0.7716[/C][/ROW]
[ROW][C]55[/C][C]92.5[/C][C]86.992[/C][C]77.2757[/C][C]96.7083[/C][C]0.1333[/C][C]0[/C][C]0.6259[/C][C]0[/C][/ROW]
[ROW][C]56[/C][C]104.2[/C][C]101.89[/C][C]92.1159[/C][C]111.6641[/C][C]0.3216[/C][C]0.9701[/C][C]0.6098[/C][C]0.0136[/C][/ROW]
[ROW][C]57[/C][C]112.5[/C][C]116.0051[/C][C]106.1996[/C][C]125.8106[/C][C]0.2418[/C][C]0.9909[/C][C]0.5952[/C][C]0.7326[/C][/ROW]
[ROW][C]58[/C][C]122.4[/C][C]117.5136[/C][C]107.6805[/C][C]127.3467[/C][C]0.165[/C][C]0.8412[/C][C]0.5801[/C][C]0.8211[/C][/ROW]
[ROW][C]59[/C][C]113.3[/C][C]113.7821[/C][C]103.9293[/C][C]123.6349[/C][C]0.4618[/C][C]0.0432[/C][C]0.5696[/C][C]0.5696[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65999&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65999&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[47])
35108.8-------
36102.3-------
3799-------
38100.7-------
39115.5-------
40100.7-------
41109.9-------
42114.6-------
4385.4-------
44100.5-------
45114.8-------
46116.5-------
47112.9-------
48102106.784798.4193115.150.13110.0760.85330.076
49106103.825795.46112.19140.30520.66560.87090.0168
50105.3103.637294.6886112.58580.35790.30240.740.0212
51118.8118.7052109.3996128.01070.4920.99760.75020.8893
52106.1103.292293.9151112.66930.27866e-040.7060.0223
53109.3112.0097102.4318121.58750.28960.88670.6670.4277
54117.2116.5653106.9104126.22030.44870.92990.6550.7716
5592.586.99277.275796.70830.133300.62590
56104.2101.8992.1159111.66410.32160.97010.60980.0136
57112.5116.0051106.1996125.81060.24180.99090.59520.7326
58122.4117.5136107.6805127.34670.1650.84120.58010.8211
59113.3113.7821103.9293123.63490.46180.04320.56960.5696







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
480.04-0.0448022.893200
490.04110.02090.03294.727513.81043.7162
500.04410.0160.02732.764910.12853.1825
510.048e-040.02060.0097.59872.7566
520.04630.02720.0227.8847.65572.7669
530.0436-0.02420.02237.34227.60352.7574
540.04230.00540.01990.40286.57482.5641
550.0570.06330.025330.33839.54523.0895
560.04890.02270.0255.3369.07753.0129
570.0431-0.03020.025612.28599.39843.0657
580.04270.04160.02723.877210.71463.2733
590.0442-0.00420.02510.23249.84113.1371

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
48 & 0.04 & -0.0448 & 0 & 22.8932 & 0 & 0 \tabularnewline
49 & 0.0411 & 0.0209 & 0.0329 & 4.7275 & 13.8104 & 3.7162 \tabularnewline
50 & 0.0441 & 0.016 & 0.0273 & 2.7649 & 10.1285 & 3.1825 \tabularnewline
51 & 0.04 & 8e-04 & 0.0206 & 0.009 & 7.5987 & 2.7566 \tabularnewline
52 & 0.0463 & 0.0272 & 0.022 & 7.884 & 7.6557 & 2.7669 \tabularnewline
53 & 0.0436 & -0.0242 & 0.0223 & 7.3422 & 7.6035 & 2.7574 \tabularnewline
54 & 0.0423 & 0.0054 & 0.0199 & 0.4028 & 6.5748 & 2.5641 \tabularnewline
55 & 0.057 & 0.0633 & 0.0253 & 30.3383 & 9.5452 & 3.0895 \tabularnewline
56 & 0.0489 & 0.0227 & 0.025 & 5.336 & 9.0775 & 3.0129 \tabularnewline
57 & 0.0431 & -0.0302 & 0.0256 & 12.2859 & 9.3984 & 3.0657 \tabularnewline
58 & 0.0427 & 0.0416 & 0.027 & 23.8772 & 10.7146 & 3.2733 \tabularnewline
59 & 0.0442 & -0.0042 & 0.0251 & 0.2324 & 9.8411 & 3.1371 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65999&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]48[/C][C]0.04[/C][C]-0.0448[/C][C]0[/C][C]22.8932[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]49[/C][C]0.0411[/C][C]0.0209[/C][C]0.0329[/C][C]4.7275[/C][C]13.8104[/C][C]3.7162[/C][/ROW]
[ROW][C]50[/C][C]0.0441[/C][C]0.016[/C][C]0.0273[/C][C]2.7649[/C][C]10.1285[/C][C]3.1825[/C][/ROW]
[ROW][C]51[/C][C]0.04[/C][C]8e-04[/C][C]0.0206[/C][C]0.009[/C][C]7.5987[/C][C]2.7566[/C][/ROW]
[ROW][C]52[/C][C]0.0463[/C][C]0.0272[/C][C]0.022[/C][C]7.884[/C][C]7.6557[/C][C]2.7669[/C][/ROW]
[ROW][C]53[/C][C]0.0436[/C][C]-0.0242[/C][C]0.0223[/C][C]7.3422[/C][C]7.6035[/C][C]2.7574[/C][/ROW]
[ROW][C]54[/C][C]0.0423[/C][C]0.0054[/C][C]0.0199[/C][C]0.4028[/C][C]6.5748[/C][C]2.5641[/C][/ROW]
[ROW][C]55[/C][C]0.057[/C][C]0.0633[/C][C]0.0253[/C][C]30.3383[/C][C]9.5452[/C][C]3.0895[/C][/ROW]
[ROW][C]56[/C][C]0.0489[/C][C]0.0227[/C][C]0.025[/C][C]5.336[/C][C]9.0775[/C][C]3.0129[/C][/ROW]
[ROW][C]57[/C][C]0.0431[/C][C]-0.0302[/C][C]0.0256[/C][C]12.2859[/C][C]9.3984[/C][C]3.0657[/C][/ROW]
[ROW][C]58[/C][C]0.0427[/C][C]0.0416[/C][C]0.027[/C][C]23.8772[/C][C]10.7146[/C][C]3.2733[/C][/ROW]
[ROW][C]59[/C][C]0.0442[/C][C]-0.0042[/C][C]0.0251[/C][C]0.2324[/C][C]9.8411[/C][C]3.1371[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65999&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65999&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
480.04-0.0448022.893200
490.04110.02090.03294.727513.81043.7162
500.04410.0160.02732.764910.12853.1825
510.048e-040.02060.0097.59872.7566
520.04630.02720.0227.8847.65572.7669
530.0436-0.02420.02237.34227.60352.7574
540.04230.00540.01990.40286.57482.5641
550.0570.06330.025330.33839.54523.0895
560.04890.02270.0255.3369.07753.0129
570.0431-0.03020.025612.28599.39843.0657
580.04270.04160.02723.877210.71463.2733
590.0442-0.00420.02510.23249.84113.1371



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; 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,par1))
(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.mape1 <- 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)
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.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.mse[1] = abs(perf.se[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.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[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',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.mape1[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.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')