Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 09 Dec 2008 07:21:43 -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/09/t1228832538ndh217boojynb28.htm/, Retrieved Thu, 23 May 2024 07:21:17 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=31450, Retrieved Thu, 23 May 2024 07:21:17 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact148
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2008-12-09 14:21:43] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
137.0
135.9
138.1
137.1
135.1
139.6
131.8
136.7
128.9
131.3
129.5
129.0
129.8
125.4
128.6
130.2
124.6
123.7
124.4
119.2
124.4
123.1
120.9
120.9
117.8
113.6
113.2
115.9
121.1
107.6
114.7
112.8
112.1
109.8
108.5
102.7
110.6
108.2
112.7
107.9
102.7
108.4
108.4
106.9
108.9
103.7
103.6
111.6
105.5
105.5
101.3
103.8
100.3
108.2
105.6
103.0
100.5
104.3
99.1
91.5




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 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 & 1 seconds \tabularnewline
R Server & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=31450&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]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=31450&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=31450&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'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[48])
36102.7-------
37110.6-------
38108.2-------
39112.7-------
40107.9-------
41102.7-------
42108.4-------
43108.4-------
44106.9-------
45108.9-------
46103.7-------
47103.6-------
48111.6-------
49105.5107.4708100.0071114.93440.30240.13910.20560.1391
50105.5109.6021101.3107117.89350.16610.83390.62980.3184
51101.3108.50298.4968118.50720.07910.72180.20540.272
52103.8109.069898.0689120.07070.17390.91690.58260.3261
53100.3108.776796.6499120.90360.08530.78940.8370.3241
54108.2108.92895.8748121.98120.45650.90240.53160.3441
55105.6108.849994.8823122.81760.32420.53630.52520.3498
56103108.890294.0887123.69180.21770.66850.60390.3599
57100.5108.869493.2667124.47220.14650.76950.49850.3658
58104.3108.880292.5213125.23910.29160.84230.73260.3723
5999.1108.874691.7901125.95910.13110.70010.72750.3773
6091.5108.877591.0984126.65660.02770.85950.3820.382

\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 & 102.7 & - & - & - & - & - & - & - \tabularnewline
37 & 110.6 & - & - & - & - & - & - & - \tabularnewline
38 & 108.2 & - & - & - & - & - & - & - \tabularnewline
39 & 112.7 & - & - & - & - & - & - & - \tabularnewline
40 & 107.9 & - & - & - & - & - & - & - \tabularnewline
41 & 102.7 & - & - & - & - & - & - & - \tabularnewline
42 & 108.4 & - & - & - & - & - & - & - \tabularnewline
43 & 108.4 & - & - & - & - & - & - & - \tabularnewline
44 & 106.9 & - & - & - & - & - & - & - \tabularnewline
45 & 108.9 & - & - & - & - & - & - & - \tabularnewline
46 & 103.7 & - & - & - & - & - & - & - \tabularnewline
47 & 103.6 & - & - & - & - & - & - & - \tabularnewline
48 & 111.6 & - & - & - & - & - & - & - \tabularnewline
49 & 105.5 & 107.4708 & 100.0071 & 114.9344 & 0.3024 & 0.1391 & 0.2056 & 0.1391 \tabularnewline
50 & 105.5 & 109.6021 & 101.3107 & 117.8935 & 0.1661 & 0.8339 & 0.6298 & 0.3184 \tabularnewline
51 & 101.3 & 108.502 & 98.4968 & 118.5072 & 0.0791 & 0.7218 & 0.2054 & 0.272 \tabularnewline
52 & 103.8 & 109.0698 & 98.0689 & 120.0707 & 0.1739 & 0.9169 & 0.5826 & 0.3261 \tabularnewline
53 & 100.3 & 108.7767 & 96.6499 & 120.9036 & 0.0853 & 0.7894 & 0.837 & 0.3241 \tabularnewline
54 & 108.2 & 108.928 & 95.8748 & 121.9812 & 0.4565 & 0.9024 & 0.5316 & 0.3441 \tabularnewline
55 & 105.6 & 108.8499 & 94.8823 & 122.8176 & 0.3242 & 0.5363 & 0.5252 & 0.3498 \tabularnewline
56 & 103 & 108.8902 & 94.0887 & 123.6918 & 0.2177 & 0.6685 & 0.6039 & 0.3599 \tabularnewline
57 & 100.5 & 108.8694 & 93.2667 & 124.4722 & 0.1465 & 0.7695 & 0.4985 & 0.3658 \tabularnewline
58 & 104.3 & 108.8802 & 92.5213 & 125.2391 & 0.2916 & 0.8423 & 0.7326 & 0.3723 \tabularnewline
59 & 99.1 & 108.8746 & 91.7901 & 125.9591 & 0.1311 & 0.7001 & 0.7275 & 0.3773 \tabularnewline
60 & 91.5 & 108.8775 & 91.0984 & 126.6566 & 0.0277 & 0.8595 & 0.382 & 0.382 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=31450&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]102.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]110.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]108.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]112.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]107.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]102.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]108.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]108.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]106.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]108.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]103.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]103.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]111.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]105.5[/C][C]107.4708[/C][C]100.0071[/C][C]114.9344[/C][C]0.3024[/C][C]0.1391[/C][C]0.2056[/C][C]0.1391[/C][/ROW]
[ROW][C]50[/C][C]105.5[/C][C]109.6021[/C][C]101.3107[/C][C]117.8935[/C][C]0.1661[/C][C]0.8339[/C][C]0.6298[/C][C]0.3184[/C][/ROW]
[ROW][C]51[/C][C]101.3[/C][C]108.502[/C][C]98.4968[/C][C]118.5072[/C][C]0.0791[/C][C]0.7218[/C][C]0.2054[/C][C]0.272[/C][/ROW]
[ROW][C]52[/C][C]103.8[/C][C]109.0698[/C][C]98.0689[/C][C]120.0707[/C][C]0.1739[/C][C]0.9169[/C][C]0.5826[/C][C]0.3261[/C][/ROW]
[ROW][C]53[/C][C]100.3[/C][C]108.7767[/C][C]96.6499[/C][C]120.9036[/C][C]0.0853[/C][C]0.7894[/C][C]0.837[/C][C]0.3241[/C][/ROW]
[ROW][C]54[/C][C]108.2[/C][C]108.928[/C][C]95.8748[/C][C]121.9812[/C][C]0.4565[/C][C]0.9024[/C][C]0.5316[/C][C]0.3441[/C][/ROW]
[ROW][C]55[/C][C]105.6[/C][C]108.8499[/C][C]94.8823[/C][C]122.8176[/C][C]0.3242[/C][C]0.5363[/C][C]0.5252[/C][C]0.3498[/C][/ROW]
[ROW][C]56[/C][C]103[/C][C]108.8902[/C][C]94.0887[/C][C]123.6918[/C][C]0.2177[/C][C]0.6685[/C][C]0.6039[/C][C]0.3599[/C][/ROW]
[ROW][C]57[/C][C]100.5[/C][C]108.8694[/C][C]93.2667[/C][C]124.4722[/C][C]0.1465[/C][C]0.7695[/C][C]0.4985[/C][C]0.3658[/C][/ROW]
[ROW][C]58[/C][C]104.3[/C][C]108.8802[/C][C]92.5213[/C][C]125.2391[/C][C]0.2916[/C][C]0.8423[/C][C]0.7326[/C][C]0.3723[/C][/ROW]
[ROW][C]59[/C][C]99.1[/C][C]108.8746[/C][C]91.7901[/C][C]125.9591[/C][C]0.1311[/C][C]0.7001[/C][C]0.7275[/C][C]0.3773[/C][/ROW]
[ROW][C]60[/C][C]91.5[/C][C]108.8775[/C][C]91.0984[/C][C]126.6566[/C][C]0.0277[/C][C]0.8595[/C][C]0.382[/C][C]0.382[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=31450&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=31450&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])
36102.7-------
37110.6-------
38108.2-------
39112.7-------
40107.9-------
41102.7-------
42108.4-------
43108.4-------
44106.9-------
45108.9-------
46103.7-------
47103.6-------
48111.6-------
49105.5107.4708100.0071114.93440.30240.13910.20560.1391
50105.5109.6021101.3107117.89350.16610.83390.62980.3184
51101.3108.50298.4968118.50720.07910.72180.20540.272
52103.8109.069898.0689120.07070.17390.91690.58260.3261
53100.3108.776796.6499120.90360.08530.78940.8370.3241
54108.2108.92895.8748121.98120.45650.90240.53160.3441
55105.6108.849994.8823122.81760.32420.53630.52520.3498
56103108.890294.0887123.69180.21770.66850.60390.3599
57100.5108.869493.2667124.47220.14650.76950.49850.3658
58104.3108.880292.5213125.23910.29160.84230.73260.3723
5999.1108.874691.7901125.95910.13110.70010.72750.3773
6091.5108.877591.0984126.65660.02770.85950.3820.382







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0354-0.01830.00153.8840.32370.5689
500.0386-0.03740.003116.82711.40231.1842
510.047-0.06640.005551.86894.32242.079
520.0515-0.04830.00427.7712.31421.5213
530.0569-0.07790.006571.85515.98792.447
540.0611-0.00676e-040.530.04420.2102
550.0655-0.02990.002510.56210.88020.9382
560.0694-0.05410.004534.69482.89121.7004
570.0731-0.07690.006470.04745.83732.416
580.0767-0.04210.003520.97791.74821.3222
590.0801-0.08980.007595.54337.96192.8217
600.0833-0.15960.0133301.977125.16485.0164

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0354 & -0.0183 & 0.0015 & 3.884 & 0.3237 & 0.5689 \tabularnewline
50 & 0.0386 & -0.0374 & 0.0031 & 16.8271 & 1.4023 & 1.1842 \tabularnewline
51 & 0.047 & -0.0664 & 0.0055 & 51.8689 & 4.3224 & 2.079 \tabularnewline
52 & 0.0515 & -0.0483 & 0.004 & 27.771 & 2.3142 & 1.5213 \tabularnewline
53 & 0.0569 & -0.0779 & 0.0065 & 71.8551 & 5.9879 & 2.447 \tabularnewline
54 & 0.0611 & -0.0067 & 6e-04 & 0.53 & 0.0442 & 0.2102 \tabularnewline
55 & 0.0655 & -0.0299 & 0.0025 & 10.5621 & 0.8802 & 0.9382 \tabularnewline
56 & 0.0694 & -0.0541 & 0.0045 & 34.6948 & 2.8912 & 1.7004 \tabularnewline
57 & 0.0731 & -0.0769 & 0.0064 & 70.0474 & 5.8373 & 2.416 \tabularnewline
58 & 0.0767 & -0.0421 & 0.0035 & 20.9779 & 1.7482 & 1.3222 \tabularnewline
59 & 0.0801 & -0.0898 & 0.0075 & 95.5433 & 7.9619 & 2.8217 \tabularnewline
60 & 0.0833 & -0.1596 & 0.0133 & 301.9771 & 25.1648 & 5.0164 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=31450&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.0354[/C][C]-0.0183[/C][C]0.0015[/C][C]3.884[/C][C]0.3237[/C][C]0.5689[/C][/ROW]
[ROW][C]50[/C][C]0.0386[/C][C]-0.0374[/C][C]0.0031[/C][C]16.8271[/C][C]1.4023[/C][C]1.1842[/C][/ROW]
[ROW][C]51[/C][C]0.047[/C][C]-0.0664[/C][C]0.0055[/C][C]51.8689[/C][C]4.3224[/C][C]2.079[/C][/ROW]
[ROW][C]52[/C][C]0.0515[/C][C]-0.0483[/C][C]0.004[/C][C]27.771[/C][C]2.3142[/C][C]1.5213[/C][/ROW]
[ROW][C]53[/C][C]0.0569[/C][C]-0.0779[/C][C]0.0065[/C][C]71.8551[/C][C]5.9879[/C][C]2.447[/C][/ROW]
[ROW][C]54[/C][C]0.0611[/C][C]-0.0067[/C][C]6e-04[/C][C]0.53[/C][C]0.0442[/C][C]0.2102[/C][/ROW]
[ROW][C]55[/C][C]0.0655[/C][C]-0.0299[/C][C]0.0025[/C][C]10.5621[/C][C]0.8802[/C][C]0.9382[/C][/ROW]
[ROW][C]56[/C][C]0.0694[/C][C]-0.0541[/C][C]0.0045[/C][C]34.6948[/C][C]2.8912[/C][C]1.7004[/C][/ROW]
[ROW][C]57[/C][C]0.0731[/C][C]-0.0769[/C][C]0.0064[/C][C]70.0474[/C][C]5.8373[/C][C]2.416[/C][/ROW]
[ROW][C]58[/C][C]0.0767[/C][C]-0.0421[/C][C]0.0035[/C][C]20.9779[/C][C]1.7482[/C][C]1.3222[/C][/ROW]
[ROW][C]59[/C][C]0.0801[/C][C]-0.0898[/C][C]0.0075[/C][C]95.5433[/C][C]7.9619[/C][C]2.8217[/C][/ROW]
[ROW][C]60[/C][C]0.0833[/C][C]-0.1596[/C][C]0.0133[/C][C]301.9771[/C][C]25.1648[/C][C]5.0164[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=31450&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=31450&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.0354-0.01830.00153.8840.32370.5689
500.0386-0.03740.003116.82711.40231.1842
510.047-0.06640.005551.86894.32242.079
520.0515-0.04830.00427.7712.31421.5213
530.0569-0.07790.006571.85515.98792.447
540.0611-0.00676e-040.530.04420.2102
550.0655-0.02990.002510.56210.88020.9382
560.0694-0.05410.004534.69482.89121.7004
570.0731-0.07690.006470.04745.83732.416
580.0767-0.04210.003520.97791.74821.3222
590.0801-0.08980.007595.54337.96192.8217
600.0833-0.15960.0133301.977125.16485.0164



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