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 computationThu, 16 Dec 2010 15:49:16 +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/16/t129251443871e3tfbxcnurqyl.htm/, Retrieved Mon, 29 Apr 2024 06:47:03 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=111031, Retrieved Mon, 29 Apr 2024 06:47:03 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact164
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [ARIMA forecast] [2009-12-10 09:29:07] [21324e9cdf3569788a3d630236984d87]
-   PD    [ARIMA Forecasting] [] [2010-12-16 15:49:16] [1d208f56d63f78e3037c4c685f0bba30] [Current]
Feedback Forum

Post a new message
Dataseries X:
112,3
117,3
111,1
102,2
104,3
122,9
107,6
121,3
131,5
89
104,4
128,9
135,9
133,3
121,3
120,5
120,4
137,9
126,1
133,2
151,1
105
119
140,4
156,6
137,1
122,7
125,8
139,3
134,9
149,2
132,3
149
117,2
119,6
152
149,4
127,3
114,1
102,1
107,7
104,4
102,1
96
109,3
90
83,9
112
114,3
103,6
91,7
80,8
87,2
109,2
102,7
95,1
117,5
85,1
92,1
113,5




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk

\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 & 'RServer@AstonUniversity' @ vre.aston.ac.uk \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=111031&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]'RServer@AstonUniversity' @ vre.aston.ac.uk[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=111031&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=111031&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'RServer@AstonUniversity' @ vre.aston.ac.uk







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])
36152-------
37149.4-------
38127.3-------
39114.1-------
40102.1-------
41107.7-------
42104.4-------
43102.1-------
4496-------
45109.3-------
4690-------
4783.9-------
48112-------
49114.3109.368891.8143126.92330.2910.384500.3845
50103.694.659974.2261115.09380.19560.02989e-040.0481
5191.782.420459.4655105.37520.21410.03530.00340.0058
5280.869.607344.382194.83240.19220.0430.00585e-04
5387.269.827442.520197.13480.10620.21550.00330.0012
54109.275.851246.6096105.09290.01270.22340.02780.0077
55102.763.308532.252894.36420.00650.00190.00720.0011
5695.166.880934.111499.65040.04570.01610.04080.0035
57117.580.888546.4906115.28650.01850.2090.05270.0381
5885.154.748918.796190.70170.0493e-040.02739e-04
5992.154.103916.660891.5470.02340.05230.05940.0012
60113.577.733838.8574116.61010.03570.23440.0420.042

\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 & 152 & - & - & - & - & - & - & - \tabularnewline
37 & 149.4 & - & - & - & - & - & - & - \tabularnewline
38 & 127.3 & - & - & - & - & - & - & - \tabularnewline
39 & 114.1 & - & - & - & - & - & - & - \tabularnewline
40 & 102.1 & - & - & - & - & - & - & - \tabularnewline
41 & 107.7 & - & - & - & - & - & - & - \tabularnewline
42 & 104.4 & - & - & - & - & - & - & - \tabularnewline
43 & 102.1 & - & - & - & - & - & - & - \tabularnewline
44 & 96 & - & - & - & - & - & - & - \tabularnewline
45 & 109.3 & - & - & - & - & - & - & - \tabularnewline
46 & 90 & - & - & - & - & - & - & - \tabularnewline
47 & 83.9 & - & - & - & - & - & - & - \tabularnewline
48 & 112 & - & - & - & - & - & - & - \tabularnewline
49 & 114.3 & 109.3688 & 91.8143 & 126.9233 & 0.291 & 0.3845 & 0 & 0.3845 \tabularnewline
50 & 103.6 & 94.6599 & 74.2261 & 115.0938 & 0.1956 & 0.0298 & 9e-04 & 0.0481 \tabularnewline
51 & 91.7 & 82.4204 & 59.4655 & 105.3752 & 0.2141 & 0.0353 & 0.0034 & 0.0058 \tabularnewline
52 & 80.8 & 69.6073 & 44.3821 & 94.8324 & 0.1922 & 0.043 & 0.0058 & 5e-04 \tabularnewline
53 & 87.2 & 69.8274 & 42.5201 & 97.1348 & 0.1062 & 0.2155 & 0.0033 & 0.0012 \tabularnewline
54 & 109.2 & 75.8512 & 46.6096 & 105.0929 & 0.0127 & 0.2234 & 0.0278 & 0.0077 \tabularnewline
55 & 102.7 & 63.3085 & 32.2528 & 94.3642 & 0.0065 & 0.0019 & 0.0072 & 0.0011 \tabularnewline
56 & 95.1 & 66.8809 & 34.1114 & 99.6504 & 0.0457 & 0.0161 & 0.0408 & 0.0035 \tabularnewline
57 & 117.5 & 80.8885 & 46.4906 & 115.2865 & 0.0185 & 0.209 & 0.0527 & 0.0381 \tabularnewline
58 & 85.1 & 54.7489 & 18.7961 & 90.7017 & 0.049 & 3e-04 & 0.0273 & 9e-04 \tabularnewline
59 & 92.1 & 54.1039 & 16.6608 & 91.547 & 0.0234 & 0.0523 & 0.0594 & 0.0012 \tabularnewline
60 & 113.5 & 77.7338 & 38.8574 & 116.6101 & 0.0357 & 0.2344 & 0.042 & 0.042 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=111031&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]152[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]149.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]127.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]114.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]102.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]107.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]104.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]102.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]96[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]109.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]90[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]83.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]112[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]114.3[/C][C]109.3688[/C][C]91.8143[/C][C]126.9233[/C][C]0.291[/C][C]0.3845[/C][C]0[/C][C]0.3845[/C][/ROW]
[ROW][C]50[/C][C]103.6[/C][C]94.6599[/C][C]74.2261[/C][C]115.0938[/C][C]0.1956[/C][C]0.0298[/C][C]9e-04[/C][C]0.0481[/C][/ROW]
[ROW][C]51[/C][C]91.7[/C][C]82.4204[/C][C]59.4655[/C][C]105.3752[/C][C]0.2141[/C][C]0.0353[/C][C]0.0034[/C][C]0.0058[/C][/ROW]
[ROW][C]52[/C][C]80.8[/C][C]69.6073[/C][C]44.3821[/C][C]94.8324[/C][C]0.1922[/C][C]0.043[/C][C]0.0058[/C][C]5e-04[/C][/ROW]
[ROW][C]53[/C][C]87.2[/C][C]69.8274[/C][C]42.5201[/C][C]97.1348[/C][C]0.1062[/C][C]0.2155[/C][C]0.0033[/C][C]0.0012[/C][/ROW]
[ROW][C]54[/C][C]109.2[/C][C]75.8512[/C][C]46.6096[/C][C]105.0929[/C][C]0.0127[/C][C]0.2234[/C][C]0.0278[/C][C]0.0077[/C][/ROW]
[ROW][C]55[/C][C]102.7[/C][C]63.3085[/C][C]32.2528[/C][C]94.3642[/C][C]0.0065[/C][C]0.0019[/C][C]0.0072[/C][C]0.0011[/C][/ROW]
[ROW][C]56[/C][C]95.1[/C][C]66.8809[/C][C]34.1114[/C][C]99.6504[/C][C]0.0457[/C][C]0.0161[/C][C]0.0408[/C][C]0.0035[/C][/ROW]
[ROW][C]57[/C][C]117.5[/C][C]80.8885[/C][C]46.4906[/C][C]115.2865[/C][C]0.0185[/C][C]0.209[/C][C]0.0527[/C][C]0.0381[/C][/ROW]
[ROW][C]58[/C][C]85.1[/C][C]54.7489[/C][C]18.7961[/C][C]90.7017[/C][C]0.049[/C][C]3e-04[/C][C]0.0273[/C][C]9e-04[/C][/ROW]
[ROW][C]59[/C][C]92.1[/C][C]54.1039[/C][C]16.6608[/C][C]91.547[/C][C]0.0234[/C][C]0.0523[/C][C]0.0594[/C][C]0.0012[/C][/ROW]
[ROW][C]60[/C][C]113.5[/C][C]77.7338[/C][C]38.8574[/C][C]116.6101[/C][C]0.0357[/C][C]0.2344[/C][C]0.042[/C][C]0.042[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=111031&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=111031&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])
36152-------
37149.4-------
38127.3-------
39114.1-------
40102.1-------
41107.7-------
42104.4-------
43102.1-------
4496-------
45109.3-------
4690-------
4783.9-------
48112-------
49114.3109.368891.8143126.92330.2910.384500.3845
50103.694.659974.2261115.09380.19560.02989e-040.0481
5191.782.420459.4655105.37520.21410.03530.00340.0058
5280.869.607344.382194.83240.19220.0430.00585e-04
5387.269.827442.520197.13480.10620.21550.00330.0012
54109.275.851246.6096105.09290.01270.22340.02780.0077
55102.763.308532.252894.36420.00650.00190.00720.0011
5695.166.880934.111499.65040.04570.01610.04080.0035
57117.580.888546.4906115.28650.01850.2090.05270.0381
5885.154.748918.796190.70170.0493e-040.02739e-04
5992.154.103916.660891.5470.02340.05230.05940.0012
60113.577.733838.8574116.61010.03570.23440.0420.042







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.08190.0451024.316900
500.11010.09440.069879.924652.12087.2195
510.14210.11260.08486.111763.45117.9656
520.18490.16080.1032125.277378.90768.883
530.19950.24880.1323301.8064123.487411.1125
540.19670.43970.18361112.14288.262816.9783
550.25030.62220.24621551.6912468.752621.6507
560.250.42190.2682796.317509.698122.5765
570.2170.45260.28871340.4002601.998424.5357
580.3350.55440.3153921.1891633.917425.1777
590.35310.70230.35041443.7036707.534426.5995
600.25520.46010.35961279.2244755.175227.4805

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0819 & 0.0451 & 0 & 24.3169 & 0 & 0 \tabularnewline
50 & 0.1101 & 0.0944 & 0.0698 & 79.9246 & 52.1208 & 7.2195 \tabularnewline
51 & 0.1421 & 0.1126 & 0.084 & 86.1117 & 63.4511 & 7.9656 \tabularnewline
52 & 0.1849 & 0.1608 & 0.1032 & 125.2773 & 78.9076 & 8.883 \tabularnewline
53 & 0.1995 & 0.2488 & 0.1323 & 301.8064 & 123.4874 & 11.1125 \tabularnewline
54 & 0.1967 & 0.4397 & 0.1836 & 1112.14 & 288.2628 & 16.9783 \tabularnewline
55 & 0.2503 & 0.6222 & 0.2462 & 1551.6912 & 468.7526 & 21.6507 \tabularnewline
56 & 0.25 & 0.4219 & 0.2682 & 796.317 & 509.6981 & 22.5765 \tabularnewline
57 & 0.217 & 0.4526 & 0.2887 & 1340.4002 & 601.9984 & 24.5357 \tabularnewline
58 & 0.335 & 0.5544 & 0.3153 & 921.1891 & 633.9174 & 25.1777 \tabularnewline
59 & 0.3531 & 0.7023 & 0.3504 & 1443.7036 & 707.5344 & 26.5995 \tabularnewline
60 & 0.2552 & 0.4601 & 0.3596 & 1279.2244 & 755.1752 & 27.4805 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=111031&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]49[/C][C]0.0819[/C][C]0.0451[/C][C]0[/C][C]24.3169[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.1101[/C][C]0.0944[/C][C]0.0698[/C][C]79.9246[/C][C]52.1208[/C][C]7.2195[/C][/ROW]
[ROW][C]51[/C][C]0.1421[/C][C]0.1126[/C][C]0.084[/C][C]86.1117[/C][C]63.4511[/C][C]7.9656[/C][/ROW]
[ROW][C]52[/C][C]0.1849[/C][C]0.1608[/C][C]0.1032[/C][C]125.2773[/C][C]78.9076[/C][C]8.883[/C][/ROW]
[ROW][C]53[/C][C]0.1995[/C][C]0.2488[/C][C]0.1323[/C][C]301.8064[/C][C]123.4874[/C][C]11.1125[/C][/ROW]
[ROW][C]54[/C][C]0.1967[/C][C]0.4397[/C][C]0.1836[/C][C]1112.14[/C][C]288.2628[/C][C]16.9783[/C][/ROW]
[ROW][C]55[/C][C]0.2503[/C][C]0.6222[/C][C]0.2462[/C][C]1551.6912[/C][C]468.7526[/C][C]21.6507[/C][/ROW]
[ROW][C]56[/C][C]0.25[/C][C]0.4219[/C][C]0.2682[/C][C]796.317[/C][C]509.6981[/C][C]22.5765[/C][/ROW]
[ROW][C]57[/C][C]0.217[/C][C]0.4526[/C][C]0.2887[/C][C]1340.4002[/C][C]601.9984[/C][C]24.5357[/C][/ROW]
[ROW][C]58[/C][C]0.335[/C][C]0.5544[/C][C]0.3153[/C][C]921.1891[/C][C]633.9174[/C][C]25.1777[/C][/ROW]
[ROW][C]59[/C][C]0.3531[/C][C]0.7023[/C][C]0.3504[/C][C]1443.7036[/C][C]707.5344[/C][C]26.5995[/C][/ROW]
[ROW][C]60[/C][C]0.2552[/C][C]0.4601[/C][C]0.3596[/C][C]1279.2244[/C][C]755.1752[/C][C]27.4805[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=111031&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=111031&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
490.08190.0451024.316900
500.11010.09440.069879.924652.12087.2195
510.14210.11260.08486.111763.45117.9656
520.18490.16080.1032125.277378.90768.883
530.19950.24880.1323301.8064123.487411.1125
540.19670.43970.18361112.14288.262816.9783
550.25030.62220.24621551.6912468.752621.6507
560.250.42190.2682796.317509.698122.5765
570.2170.45260.28871340.4002601.998424.5357
580.3350.55440.3153921.1891633.917425.1777
590.35310.70230.35041443.7036707.534426.5995
600.25520.46010.35961279.2244755.175227.4805



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