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, 23 Dec 2010 08:33:21 +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/23/t1293093071kongbmm6pakwv8f.htm/, Retrieved Sun, 05 May 2024 06:15:42 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=114651, Retrieved Sun, 05 May 2024 06:15:42 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact160
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Paper] [2010-12-23 08:33:21] [ca0a9c6c6ac3cc5623c7945c1ccf8fd2] [Current]
Feedback Forum

Post a new message
Dataseries X:
120.9
119.6
125.9
116.1
107.5
116.7
112.5
113
126.4
114.1
112.5
112.4
113.1
116.3
111.7
118.8
116.5
125.1
113.1
119.6
114.4
114
117.8
117
120.9
115
117.3
119.4
114.9
125.8
117.6
117.6
114.9
121.9
117
106.4
110.5
113.6
114.2
125.4
124.6
120.2
120.8
111.4
124.1
120.2
125.5
116
117
105.7
102
106.4
96.9
107.6
98.8
101.1
105.7
104.6
103.2
101.6




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114651&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 time4 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])
36106.4-------
37110.5-------
38113.6-------
39114.2-------
40125.4-------
41124.6-------
42120.2-------
43120.8-------
44111.4-------
45124.1-------
46120.2-------
47125.5-------
48116-------
49117117.6491107.8528127.44540.44830.62930.92370.6293
50105.7117.6491107.8468127.45140.00840.55160.79090.6292
51102117.6491107.8408127.45749e-040.99150.75470.6291
52106.4117.6491107.8348127.46340.01230.99910.06080.6291
5396.9117.6491107.8288127.469400.98760.08270.629
54107.6117.6491107.8228127.47540.022510.30540.6289
5598.8117.6491107.8168127.48141e-040.97740.2650.6288
56101.1117.6491107.8108127.48745e-040.99990.89340.6287
57105.7117.6491107.8048127.49340.00870.99950.09950.6287
58104.6117.6491107.7988127.49940.00470.99130.30590.6286
59103.2117.6491107.7928127.50540.0020.99530.05920.6285
60101.6117.6491107.7869127.51147e-040.9980.62840.6284

\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 & 106.4 & - & - & - & - & - & - & - \tabularnewline
37 & 110.5 & - & - & - & - & - & - & - \tabularnewline
38 & 113.6 & - & - & - & - & - & - & - \tabularnewline
39 & 114.2 & - & - & - & - & - & - & - \tabularnewline
40 & 125.4 & - & - & - & - & - & - & - \tabularnewline
41 & 124.6 & - & - & - & - & - & - & - \tabularnewline
42 & 120.2 & - & - & - & - & - & - & - \tabularnewline
43 & 120.8 & - & - & - & - & - & - & - \tabularnewline
44 & 111.4 & - & - & - & - & - & - & - \tabularnewline
45 & 124.1 & - & - & - & - & - & - & - \tabularnewline
46 & 120.2 & - & - & - & - & - & - & - \tabularnewline
47 & 125.5 & - & - & - & - & - & - & - \tabularnewline
48 & 116 & - & - & - & - & - & - & - \tabularnewline
49 & 117 & 117.6491 & 107.8528 & 127.4454 & 0.4483 & 0.6293 & 0.9237 & 0.6293 \tabularnewline
50 & 105.7 & 117.6491 & 107.8468 & 127.4514 & 0.0084 & 0.5516 & 0.7909 & 0.6292 \tabularnewline
51 & 102 & 117.6491 & 107.8408 & 127.4574 & 9e-04 & 0.9915 & 0.7547 & 0.6291 \tabularnewline
52 & 106.4 & 117.6491 & 107.8348 & 127.4634 & 0.0123 & 0.9991 & 0.0608 & 0.6291 \tabularnewline
53 & 96.9 & 117.6491 & 107.8288 & 127.4694 & 0 & 0.9876 & 0.0827 & 0.629 \tabularnewline
54 & 107.6 & 117.6491 & 107.8228 & 127.4754 & 0.0225 & 1 & 0.3054 & 0.6289 \tabularnewline
55 & 98.8 & 117.6491 & 107.8168 & 127.4814 & 1e-04 & 0.9774 & 0.265 & 0.6288 \tabularnewline
56 & 101.1 & 117.6491 & 107.8108 & 127.4874 & 5e-04 & 0.9999 & 0.8934 & 0.6287 \tabularnewline
57 & 105.7 & 117.6491 & 107.8048 & 127.4934 & 0.0087 & 0.9995 & 0.0995 & 0.6287 \tabularnewline
58 & 104.6 & 117.6491 & 107.7988 & 127.4994 & 0.0047 & 0.9913 & 0.3059 & 0.6286 \tabularnewline
59 & 103.2 & 117.6491 & 107.7928 & 127.5054 & 0.002 & 0.9953 & 0.0592 & 0.6285 \tabularnewline
60 & 101.6 & 117.6491 & 107.7869 & 127.5114 & 7e-04 & 0.998 & 0.6284 & 0.6284 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114651&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]106.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]110.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]113.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]114.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]125.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]124.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]120.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]120.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]111.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]124.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]120.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]125.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]116[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]117[/C][C]117.6491[/C][C]107.8528[/C][C]127.4454[/C][C]0.4483[/C][C]0.6293[/C][C]0.9237[/C][C]0.6293[/C][/ROW]
[ROW][C]50[/C][C]105.7[/C][C]117.6491[/C][C]107.8468[/C][C]127.4514[/C][C]0.0084[/C][C]0.5516[/C][C]0.7909[/C][C]0.6292[/C][/ROW]
[ROW][C]51[/C][C]102[/C][C]117.6491[/C][C]107.8408[/C][C]127.4574[/C][C]9e-04[/C][C]0.9915[/C][C]0.7547[/C][C]0.6291[/C][/ROW]
[ROW][C]52[/C][C]106.4[/C][C]117.6491[/C][C]107.8348[/C][C]127.4634[/C][C]0.0123[/C][C]0.9991[/C][C]0.0608[/C][C]0.6291[/C][/ROW]
[ROW][C]53[/C][C]96.9[/C][C]117.6491[/C][C]107.8288[/C][C]127.4694[/C][C]0[/C][C]0.9876[/C][C]0.0827[/C][C]0.629[/C][/ROW]
[ROW][C]54[/C][C]107.6[/C][C]117.6491[/C][C]107.8228[/C][C]127.4754[/C][C]0.0225[/C][C]1[/C][C]0.3054[/C][C]0.6289[/C][/ROW]
[ROW][C]55[/C][C]98.8[/C][C]117.6491[/C][C]107.8168[/C][C]127.4814[/C][C]1e-04[/C][C]0.9774[/C][C]0.265[/C][C]0.6288[/C][/ROW]
[ROW][C]56[/C][C]101.1[/C][C]117.6491[/C][C]107.8108[/C][C]127.4874[/C][C]5e-04[/C][C]0.9999[/C][C]0.8934[/C][C]0.6287[/C][/ROW]
[ROW][C]57[/C][C]105.7[/C][C]117.6491[/C][C]107.8048[/C][C]127.4934[/C][C]0.0087[/C][C]0.9995[/C][C]0.0995[/C][C]0.6287[/C][/ROW]
[ROW][C]58[/C][C]104.6[/C][C]117.6491[/C][C]107.7988[/C][C]127.4994[/C][C]0.0047[/C][C]0.9913[/C][C]0.3059[/C][C]0.6286[/C][/ROW]
[ROW][C]59[/C][C]103.2[/C][C]117.6491[/C][C]107.7928[/C][C]127.5054[/C][C]0.002[/C][C]0.9953[/C][C]0.0592[/C][C]0.6285[/C][/ROW]
[ROW][C]60[/C][C]101.6[/C][C]117.6491[/C][C]107.7869[/C][C]127.5114[/C][C]7e-04[/C][C]0.998[/C][C]0.6284[/C][C]0.6284[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114651&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114651&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])
36106.4-------
37110.5-------
38113.6-------
39114.2-------
40125.4-------
41124.6-------
42120.2-------
43120.8-------
44111.4-------
45124.1-------
46120.2-------
47125.5-------
48116-------
49117117.6491107.8528127.44540.44830.62930.92370.6293
50105.7117.6491107.8468127.45140.00840.55160.79090.6292
51102117.6491107.8408127.45749e-040.99150.75470.6291
52106.4117.6491107.8348127.46340.01230.99910.06080.6291
5396.9117.6491107.8288127.469400.98760.08270.629
54107.6117.6491107.8228127.47540.022510.30540.6289
5598.8117.6491107.8168127.48141e-040.97740.2650.6288
56101.1117.6491107.8108127.48745e-040.99990.89340.6287
57105.7117.6491107.8048127.49340.00870.99950.09950.6287
58104.6117.6491107.7988127.49940.00470.99130.30590.6286
59103.2117.6491107.7928127.50540.0020.99530.05920.6285
60101.6117.6491107.7869127.51147e-040.9980.62840.6284







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0425-0.005500.421400
500.0425-0.10160.0535142.781471.60148.4618
510.0425-0.1330.08244.8949129.365911.3739
520.0426-0.09560.0839126.5426128.660111.3428
530.0426-0.17640.1024430.5259189.033213.7489
540.0426-0.08540.0996100.9848174.358513.2045
550.0426-0.16020.1082355.2892200.205714.1494
560.0427-0.14070.1123273.8733209.414214.4711
570.0427-0.10160.1111142.7814202.010514.213
580.0427-0.11090.1111170.2795198.837414.101
590.0427-0.12280.1122208.777199.74114.133
600.0428-0.13640.1142257.5742204.560414.3025

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0425 & -0.0055 & 0 & 0.4214 & 0 & 0 \tabularnewline
50 & 0.0425 & -0.1016 & 0.0535 & 142.7814 & 71.6014 & 8.4618 \tabularnewline
51 & 0.0425 & -0.133 & 0.08 & 244.8949 & 129.3659 & 11.3739 \tabularnewline
52 & 0.0426 & -0.0956 & 0.0839 & 126.5426 & 128.6601 & 11.3428 \tabularnewline
53 & 0.0426 & -0.1764 & 0.1024 & 430.5259 & 189.0332 & 13.7489 \tabularnewline
54 & 0.0426 & -0.0854 & 0.0996 & 100.9848 & 174.3585 & 13.2045 \tabularnewline
55 & 0.0426 & -0.1602 & 0.1082 & 355.2892 & 200.2057 & 14.1494 \tabularnewline
56 & 0.0427 & -0.1407 & 0.1123 & 273.8733 & 209.4142 & 14.4711 \tabularnewline
57 & 0.0427 & -0.1016 & 0.1111 & 142.7814 & 202.0105 & 14.213 \tabularnewline
58 & 0.0427 & -0.1109 & 0.1111 & 170.2795 & 198.8374 & 14.101 \tabularnewline
59 & 0.0427 & -0.1228 & 0.1122 & 208.777 & 199.741 & 14.133 \tabularnewline
60 & 0.0428 & -0.1364 & 0.1142 & 257.5742 & 204.5604 & 14.3025 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=114651&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.0425[/C][C]-0.0055[/C][C]0[/C][C]0.4214[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0425[/C][C]-0.1016[/C][C]0.0535[/C][C]142.7814[/C][C]71.6014[/C][C]8.4618[/C][/ROW]
[ROW][C]51[/C][C]0.0425[/C][C]-0.133[/C][C]0.08[/C][C]244.8949[/C][C]129.3659[/C][C]11.3739[/C][/ROW]
[ROW][C]52[/C][C]0.0426[/C][C]-0.0956[/C][C]0.0839[/C][C]126.5426[/C][C]128.6601[/C][C]11.3428[/C][/ROW]
[ROW][C]53[/C][C]0.0426[/C][C]-0.1764[/C][C]0.1024[/C][C]430.5259[/C][C]189.0332[/C][C]13.7489[/C][/ROW]
[ROW][C]54[/C][C]0.0426[/C][C]-0.0854[/C][C]0.0996[/C][C]100.9848[/C][C]174.3585[/C][C]13.2045[/C][/ROW]
[ROW][C]55[/C][C]0.0426[/C][C]-0.1602[/C][C]0.1082[/C][C]355.2892[/C][C]200.2057[/C][C]14.1494[/C][/ROW]
[ROW][C]56[/C][C]0.0427[/C][C]-0.1407[/C][C]0.1123[/C][C]273.8733[/C][C]209.4142[/C][C]14.4711[/C][/ROW]
[ROW][C]57[/C][C]0.0427[/C][C]-0.1016[/C][C]0.1111[/C][C]142.7814[/C][C]202.0105[/C][C]14.213[/C][/ROW]
[ROW][C]58[/C][C]0.0427[/C][C]-0.1109[/C][C]0.1111[/C][C]170.2795[/C][C]198.8374[/C][C]14.101[/C][/ROW]
[ROW][C]59[/C][C]0.0427[/C][C]-0.1228[/C][C]0.1122[/C][C]208.777[/C][C]199.741[/C][C]14.133[/C][/ROW]
[ROW][C]60[/C][C]0.0428[/C][C]-0.1364[/C][C]0.1142[/C][C]257.5742[/C][C]204.5604[/C][C]14.3025[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=114651&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=114651&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.0425-0.005500.421400
500.0425-0.10160.0535142.781471.60148.4618
510.0425-0.1330.08244.8949129.365911.3739
520.0426-0.09560.0839126.5426128.660111.3428
530.0426-0.17640.1024430.5259189.033213.7489
540.0426-0.08540.0996100.9848174.358513.2045
550.0426-0.16020.1082355.2892200.205714.1494
560.0427-0.14070.1123273.8733209.414214.4711
570.0427-0.10160.1111142.7814202.010514.213
580.0427-0.11090.1111170.2795198.837414.101
590.0427-0.12280.1122208.777199.74114.133
600.0428-0.13640.1142257.5742204.560414.3025



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