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, 24 Dec 2010 14:48:04 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/24/t1293201958kz6d6xpc1muvfdv.htm/, Retrieved Tue, 30 Apr 2024 05:21:31 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=115028, Retrieved Tue, 30 Apr 2024 05:21:31 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact97
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2010-12-24 14:48:04] [29eeba0e6ce2cd83aa315a4a7ff8c4aa] [Current]
Feedback Forum

Post a new message
Dataseries X:
6.4
7.7
9.2
8.6
7.4
8.6
6.2
6
6.6
5.1
4.7
5
3.6
1.9
-0.1
-5.7
-5.6
-6.4
-7.7
-8
-11.9
-15.4
-15.5
-13.4
-10.9
-10.8
-7.3
-6.5
-5.1
-5.3
-6.8
-8.4
-8.4
-9.7
-8.8
-9.6
-11.5
-11
-14.9
-16.2
-14.4
-17.3
-15.7
-12.6
-9.4
-8.1
-5.4
-4.6
-4.9
-4
-3.1
-1.3
0
-0.4
3
0.4
1.2
0.6
-1.3
-3.2
-1.8
-3.6
-4.2
-6.9
-8
-7.5
-8.2
-7.6
-3.7
-1.7
-0.7
0.2
0.6
2.2
3.3
5.3
5.5
6.3
7.7
6.5
5.5
6.9
5.7
6.9
6.1
4.8
3.7
5.8
6.8
8.5
7.2
5
4.7
2.3
2.4
0.1
1.9
1.7
2
-1.9
0.5
-1.3
-3.3
-2.8
-8
-13.9
-21.9
-28.8
-27.6
-31.4
-31.8
-29.4
-27.6
-23.6
-22.8
-18.2
-17.8
-14.2
-8.8
-7.9
-7
-7
-3.6
-2.4
-4.9
-7.7
-6.5
-5.1
-3.4
-2.8
0.8




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24

\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 & 2 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=115028&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]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Sir Ronald Aylmer Fisher' @ 193.190.124.24[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=115028&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=115028&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 time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24







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[119])
107-21.9-------
108-28.8-------
109-27.6-------
110-31.4-------
111-31.8-------
112-29.4-------
113-27.6-------
114-23.6-------
115-22.8-------
116-18.2-------
117-17.8-------
118-14.2-------
119-8.8-------
120-7.9-6.9345-10.8481-3.0210.31440.824910.8249
121-7-4.239-10.43771.95960.19130.876510.9254
122-7-2.6102-11.30056.080.16110.838910.9186
123-3.6-1.4389-12.77489.8970.35430.831910.8984
124-2.4-0.3037-14.020413.41290.38230.681210.8876
125-4.90.336-15.778216.45010.26210.63040.99970.8668
126-7.70.9602-17.39519.31530.17750.73430.99560.8513
127-6.51.3835-19.112421.87940.22550.80750.98960.8349
128-5.11.7053-20.835724.24640.2770.76220.95830.8195
129-3.41.9721-22.504526.44870.33350.71440.94330.8058
130-2.82.1531-24.175228.48150.35620.66030.88830.7926
1310.82.3055-25.786530.39750.45820.63920.78080.7808

\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[119]) \tabularnewline
107 & -21.9 & - & - & - & - & - & - & - \tabularnewline
108 & -28.8 & - & - & - & - & - & - & - \tabularnewline
109 & -27.6 & - & - & - & - & - & - & - \tabularnewline
110 & -31.4 & - & - & - & - & - & - & - \tabularnewline
111 & -31.8 & - & - & - & - & - & - & - \tabularnewline
112 & -29.4 & - & - & - & - & - & - & - \tabularnewline
113 & -27.6 & - & - & - & - & - & - & - \tabularnewline
114 & -23.6 & - & - & - & - & - & - & - \tabularnewline
115 & -22.8 & - & - & - & - & - & - & - \tabularnewline
116 & -18.2 & - & - & - & - & - & - & - \tabularnewline
117 & -17.8 & - & - & - & - & - & - & - \tabularnewline
118 & -14.2 & - & - & - & - & - & - & - \tabularnewline
119 & -8.8 & - & - & - & - & - & - & - \tabularnewline
120 & -7.9 & -6.9345 & -10.8481 & -3.021 & 0.3144 & 0.8249 & 1 & 0.8249 \tabularnewline
121 & -7 & -4.239 & -10.4377 & 1.9596 & 0.1913 & 0.8765 & 1 & 0.9254 \tabularnewline
122 & -7 & -2.6102 & -11.3005 & 6.08 & 0.1611 & 0.8389 & 1 & 0.9186 \tabularnewline
123 & -3.6 & -1.4389 & -12.7748 & 9.897 & 0.3543 & 0.8319 & 1 & 0.8984 \tabularnewline
124 & -2.4 & -0.3037 & -14.0204 & 13.4129 & 0.3823 & 0.6812 & 1 & 0.8876 \tabularnewline
125 & -4.9 & 0.336 & -15.7782 & 16.4501 & 0.2621 & 0.6304 & 0.9997 & 0.8668 \tabularnewline
126 & -7.7 & 0.9602 & -17.395 & 19.3153 & 0.1775 & 0.7343 & 0.9956 & 0.8513 \tabularnewline
127 & -6.5 & 1.3835 & -19.1124 & 21.8794 & 0.2255 & 0.8075 & 0.9896 & 0.8349 \tabularnewline
128 & -5.1 & 1.7053 & -20.8357 & 24.2464 & 0.277 & 0.7622 & 0.9583 & 0.8195 \tabularnewline
129 & -3.4 & 1.9721 & -22.5045 & 26.4487 & 0.3335 & 0.7144 & 0.9433 & 0.8058 \tabularnewline
130 & -2.8 & 2.1531 & -24.1752 & 28.4815 & 0.3562 & 0.6603 & 0.8883 & 0.7926 \tabularnewline
131 & 0.8 & 2.3055 & -25.7865 & 30.3975 & 0.4582 & 0.6392 & 0.7808 & 0.7808 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=115028&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[119])[/C][/ROW]
[ROW][C]107[/C][C]-21.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]-28.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]-27.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]-31.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]-31.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]-29.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]-27.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]-23.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]-22.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]-18.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]-17.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]-14.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]-8.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]-7.9[/C][C]-6.9345[/C][C]-10.8481[/C][C]-3.021[/C][C]0.3144[/C][C]0.8249[/C][C]1[/C][C]0.8249[/C][/ROW]
[ROW][C]121[/C][C]-7[/C][C]-4.239[/C][C]-10.4377[/C][C]1.9596[/C][C]0.1913[/C][C]0.8765[/C][C]1[/C][C]0.9254[/C][/ROW]
[ROW][C]122[/C][C]-7[/C][C]-2.6102[/C][C]-11.3005[/C][C]6.08[/C][C]0.1611[/C][C]0.8389[/C][C]1[/C][C]0.9186[/C][/ROW]
[ROW][C]123[/C][C]-3.6[/C][C]-1.4389[/C][C]-12.7748[/C][C]9.897[/C][C]0.3543[/C][C]0.8319[/C][C]1[/C][C]0.8984[/C][/ROW]
[ROW][C]124[/C][C]-2.4[/C][C]-0.3037[/C][C]-14.0204[/C][C]13.4129[/C][C]0.3823[/C][C]0.6812[/C][C]1[/C][C]0.8876[/C][/ROW]
[ROW][C]125[/C][C]-4.9[/C][C]0.336[/C][C]-15.7782[/C][C]16.4501[/C][C]0.2621[/C][C]0.6304[/C][C]0.9997[/C][C]0.8668[/C][/ROW]
[ROW][C]126[/C][C]-7.7[/C][C]0.9602[/C][C]-17.395[/C][C]19.3153[/C][C]0.1775[/C][C]0.7343[/C][C]0.9956[/C][C]0.8513[/C][/ROW]
[ROW][C]127[/C][C]-6.5[/C][C]1.3835[/C][C]-19.1124[/C][C]21.8794[/C][C]0.2255[/C][C]0.8075[/C][C]0.9896[/C][C]0.8349[/C][/ROW]
[ROW][C]128[/C][C]-5.1[/C][C]1.7053[/C][C]-20.8357[/C][C]24.2464[/C][C]0.277[/C][C]0.7622[/C][C]0.9583[/C][C]0.8195[/C][/ROW]
[ROW][C]129[/C][C]-3.4[/C][C]1.9721[/C][C]-22.5045[/C][C]26.4487[/C][C]0.3335[/C][C]0.7144[/C][C]0.9433[/C][C]0.8058[/C][/ROW]
[ROW][C]130[/C][C]-2.8[/C][C]2.1531[/C][C]-24.1752[/C][C]28.4815[/C][C]0.3562[/C][C]0.6603[/C][C]0.8883[/C][C]0.7926[/C][/ROW]
[ROW][C]131[/C][C]0.8[/C][C]2.3055[/C][C]-25.7865[/C][C]30.3975[/C][C]0.4582[/C][C]0.6392[/C][C]0.7808[/C][C]0.7808[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=115028&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=115028&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[119])
107-21.9-------
108-28.8-------
109-27.6-------
110-31.4-------
111-31.8-------
112-29.4-------
113-27.6-------
114-23.6-------
115-22.8-------
116-18.2-------
117-17.8-------
118-14.2-------
119-8.8-------
120-7.9-6.9345-10.8481-3.0210.31440.824910.8249
121-7-4.239-10.43771.95960.19130.876510.9254
122-7-2.6102-11.30056.080.16110.838910.9186
123-3.6-1.4389-12.77489.8970.35430.831910.8984
124-2.4-0.3037-14.020413.41290.38230.681210.8876
125-4.90.336-15.778216.45010.26210.63040.99970.8668
126-7.70.9602-17.39519.31530.17750.73430.99560.8513
127-6.51.3835-19.112421.87940.22550.80750.98960.8349
128-5.11.7053-20.835724.24640.2770.76220.95830.8195
129-3.41.9721-22.504526.44870.33350.71440.94330.8058
130-2.82.1531-24.175228.48150.35620.66030.88830.7926
1310.82.3055-25.786530.39750.45820.63920.78080.7808







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
120-0.28790.139200.932100
121-0.74610.65130.39537.6234.27762.0682
122-1.69861.68180.824119.27019.27513.0455
123-4.01951.50190.99364.67048.12392.8502
124-23.03976.90132.17514.39437.3782.7162
12524.471-15.58474.4127.415410.71753.2738
1269.7535-9.01955.068574.998319.90054.461
1277.5586-5.69835.147262.149125.18165.0181
1286.7438-3.99065.018746.312727.52955.2469
1296.3323-2.7244.789328.859727.66255.2595
1306.2388-2.30044.56324.533427.37815.2324
1316.2167-0.6534.23722.266525.28545.0285

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
120 & -0.2879 & 0.1392 & 0 & 0.9321 & 0 & 0 \tabularnewline
121 & -0.7461 & 0.6513 & 0.3953 & 7.623 & 4.2776 & 2.0682 \tabularnewline
122 & -1.6986 & 1.6818 & 0.8241 & 19.2701 & 9.2751 & 3.0455 \tabularnewline
123 & -4.0195 & 1.5019 & 0.9936 & 4.6704 & 8.1239 & 2.8502 \tabularnewline
124 & -23.0397 & 6.9013 & 2.1751 & 4.3943 & 7.378 & 2.7162 \tabularnewline
125 & 24.471 & -15.5847 & 4.41 & 27.4154 & 10.7175 & 3.2738 \tabularnewline
126 & 9.7535 & -9.0195 & 5.0685 & 74.9983 & 19.9005 & 4.461 \tabularnewline
127 & 7.5586 & -5.6983 & 5.1472 & 62.1491 & 25.1816 & 5.0181 \tabularnewline
128 & 6.7438 & -3.9906 & 5.0187 & 46.3127 & 27.5295 & 5.2469 \tabularnewline
129 & 6.3323 & -2.724 & 4.7893 & 28.8597 & 27.6625 & 5.2595 \tabularnewline
130 & 6.2388 & -2.3004 & 4.563 & 24.5334 & 27.3781 & 5.2324 \tabularnewline
131 & 6.2167 & -0.653 & 4.2372 & 2.2665 & 25.2854 & 5.0285 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=115028&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]120[/C][C]-0.2879[/C][C]0.1392[/C][C]0[/C][C]0.9321[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]121[/C][C]-0.7461[/C][C]0.6513[/C][C]0.3953[/C][C]7.623[/C][C]4.2776[/C][C]2.0682[/C][/ROW]
[ROW][C]122[/C][C]-1.6986[/C][C]1.6818[/C][C]0.8241[/C][C]19.2701[/C][C]9.2751[/C][C]3.0455[/C][/ROW]
[ROW][C]123[/C][C]-4.0195[/C][C]1.5019[/C][C]0.9936[/C][C]4.6704[/C][C]8.1239[/C][C]2.8502[/C][/ROW]
[ROW][C]124[/C][C]-23.0397[/C][C]6.9013[/C][C]2.1751[/C][C]4.3943[/C][C]7.378[/C][C]2.7162[/C][/ROW]
[ROW][C]125[/C][C]24.471[/C][C]-15.5847[/C][C]4.41[/C][C]27.4154[/C][C]10.7175[/C][C]3.2738[/C][/ROW]
[ROW][C]126[/C][C]9.7535[/C][C]-9.0195[/C][C]5.0685[/C][C]74.9983[/C][C]19.9005[/C][C]4.461[/C][/ROW]
[ROW][C]127[/C][C]7.5586[/C][C]-5.6983[/C][C]5.1472[/C][C]62.1491[/C][C]25.1816[/C][C]5.0181[/C][/ROW]
[ROW][C]128[/C][C]6.7438[/C][C]-3.9906[/C][C]5.0187[/C][C]46.3127[/C][C]27.5295[/C][C]5.2469[/C][/ROW]
[ROW][C]129[/C][C]6.3323[/C][C]-2.724[/C][C]4.7893[/C][C]28.8597[/C][C]27.6625[/C][C]5.2595[/C][/ROW]
[ROW][C]130[/C][C]6.2388[/C][C]-2.3004[/C][C]4.563[/C][C]24.5334[/C][C]27.3781[/C][C]5.2324[/C][/ROW]
[ROW][C]131[/C][C]6.2167[/C][C]-0.653[/C][C]4.2372[/C][C]2.2665[/C][C]25.2854[/C][C]5.0285[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=115028&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=115028&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
120-0.28790.139200.932100
121-0.74610.65130.39537.6234.27762.0682
122-1.69861.68180.824119.27019.27513.0455
123-4.01951.50190.99364.67048.12392.8502
124-23.03976.90132.17514.39437.3782.7162
12524.471-15.58474.4127.415410.71753.2738
1269.7535-9.01955.068574.998319.90054.461
1277.5586-5.69835.147262.149125.18165.0181
1286.7438-3.99065.018746.312727.52955.2469
1296.3323-2.7244.789328.859727.66255.2595
1306.2388-2.30044.56324.533427.37815.2324
1316.2167-0.6534.23722.266525.28545.0285



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