Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 14 Dec 2007 00:21:19 -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/2007/Dec/14/t1197615954nac22sr1q0kflic.htm/, Retrieved Thu, 02 May 2024 16:15:23 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3762, Retrieved Thu, 02 May 2024 16:15:23 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact238
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [voorspelling olie] [2007-12-14 07:21:19] [e24e91da8d334fb8882bf413603fde71] [Current]
Feedback Forum

Post a new message
Dataseries X:
87,0
96,3
107,1
115,2
106,1
89,5
91,3
97,6
100,7
104,6
94,7
101,8
102,5
105,3
110,3
109,8
117,3
118,8
131,3
125,9
133,1
147,0
145,8
164,4
149,8
137,7
151,7
156,8
180,0
180,4
170,4
191,6
199,5
218,2
217,5
205,0
194,0
199,3
219,3
211,1
215,2
240,2
242,2
240,7
255,4
253,0
218,2
203,7
205,6
215,6
188,5
202,9
214,0
230,3
230,0
241,0
259,6
247,8
270,3
289,7




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\begin{tabular}{lllllllll}
\hline
Summary of compuational 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 & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3762&T=0

[TABLE]
[ROW][C]Summary of compuational 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]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3762&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3762&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 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[48])
36205-------
37194-------
38199.3-------
39219.3-------
40211.1-------
41215.2-------
42240.2-------
43242.2-------
44240.7-------
45255.4-------
46253-------
47218.2-------
48203.7-------
49205.6201.7413178.4586225.02390.37270.43450.74270.4345
50215.6202.8003169.8737235.72690.22310.43380.58250.4786
51188.5206.4373166.1106246.76390.19170.3280.26590.5529
52202.9204.8808158.3156251.4460.46680.75470.39670.5198
53214205.5039153.4423257.56540.37450.5390.35750.5271
54230.3210.1531153.1225267.18360.24430.44740.15090.5878
55230210.5855148.9855272.18550.26840.26520.15720.5867
56241210.1786144.3254276.03180.17950.27760.18180.5765
57259.6212.8662143.0183282.7140.09490.21490.11630.6015
58247.8212.3069138.6808285.9330.17240.1040.13930.5906
59270.3205.8361128.6164283.05580.05090.14340.37680.5216
60289.7203.2135122.5601283.86680.01780.05150.49530.4953

\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 & 205 & - & - & - & - & - & - & - \tabularnewline
37 & 194 & - & - & - & - & - & - & - \tabularnewline
38 & 199.3 & - & - & - & - & - & - & - \tabularnewline
39 & 219.3 & - & - & - & - & - & - & - \tabularnewline
40 & 211.1 & - & - & - & - & - & - & - \tabularnewline
41 & 215.2 & - & - & - & - & - & - & - \tabularnewline
42 & 240.2 & - & - & - & - & - & - & - \tabularnewline
43 & 242.2 & - & - & - & - & - & - & - \tabularnewline
44 & 240.7 & - & - & - & - & - & - & - \tabularnewline
45 & 255.4 & - & - & - & - & - & - & - \tabularnewline
46 & 253 & - & - & - & - & - & - & - \tabularnewline
47 & 218.2 & - & - & - & - & - & - & - \tabularnewline
48 & 203.7 & - & - & - & - & - & - & - \tabularnewline
49 & 205.6 & 201.7413 & 178.4586 & 225.0239 & 0.3727 & 0.4345 & 0.7427 & 0.4345 \tabularnewline
50 & 215.6 & 202.8003 & 169.8737 & 235.7269 & 0.2231 & 0.4338 & 0.5825 & 0.4786 \tabularnewline
51 & 188.5 & 206.4373 & 166.1106 & 246.7639 & 0.1917 & 0.328 & 0.2659 & 0.5529 \tabularnewline
52 & 202.9 & 204.8808 & 158.3156 & 251.446 & 0.4668 & 0.7547 & 0.3967 & 0.5198 \tabularnewline
53 & 214 & 205.5039 & 153.4423 & 257.5654 & 0.3745 & 0.539 & 0.3575 & 0.5271 \tabularnewline
54 & 230.3 & 210.1531 & 153.1225 & 267.1836 & 0.2443 & 0.4474 & 0.1509 & 0.5878 \tabularnewline
55 & 230 & 210.5855 & 148.9855 & 272.1855 & 0.2684 & 0.2652 & 0.1572 & 0.5867 \tabularnewline
56 & 241 & 210.1786 & 144.3254 & 276.0318 & 0.1795 & 0.2776 & 0.1818 & 0.5765 \tabularnewline
57 & 259.6 & 212.8662 & 143.0183 & 282.714 & 0.0949 & 0.2149 & 0.1163 & 0.6015 \tabularnewline
58 & 247.8 & 212.3069 & 138.6808 & 285.933 & 0.1724 & 0.104 & 0.1393 & 0.5906 \tabularnewline
59 & 270.3 & 205.8361 & 128.6164 & 283.0558 & 0.0509 & 0.1434 & 0.3768 & 0.5216 \tabularnewline
60 & 289.7 & 203.2135 & 122.5601 & 283.8668 & 0.0178 & 0.0515 & 0.4953 & 0.4953 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3762&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]205[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]194[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]199.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]219.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]211.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]215.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]240.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]242.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]240.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]255.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]253[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]218.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]203.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]205.6[/C][C]201.7413[/C][C]178.4586[/C][C]225.0239[/C][C]0.3727[/C][C]0.4345[/C][C]0.7427[/C][C]0.4345[/C][/ROW]
[ROW][C]50[/C][C]215.6[/C][C]202.8003[/C][C]169.8737[/C][C]235.7269[/C][C]0.2231[/C][C]0.4338[/C][C]0.5825[/C][C]0.4786[/C][/ROW]
[ROW][C]51[/C][C]188.5[/C][C]206.4373[/C][C]166.1106[/C][C]246.7639[/C][C]0.1917[/C][C]0.328[/C][C]0.2659[/C][C]0.5529[/C][/ROW]
[ROW][C]52[/C][C]202.9[/C][C]204.8808[/C][C]158.3156[/C][C]251.446[/C][C]0.4668[/C][C]0.7547[/C][C]0.3967[/C][C]0.5198[/C][/ROW]
[ROW][C]53[/C][C]214[/C][C]205.5039[/C][C]153.4423[/C][C]257.5654[/C][C]0.3745[/C][C]0.539[/C][C]0.3575[/C][C]0.5271[/C][/ROW]
[ROW][C]54[/C][C]230.3[/C][C]210.1531[/C][C]153.1225[/C][C]267.1836[/C][C]0.2443[/C][C]0.4474[/C][C]0.1509[/C][C]0.5878[/C][/ROW]
[ROW][C]55[/C][C]230[/C][C]210.5855[/C][C]148.9855[/C][C]272.1855[/C][C]0.2684[/C][C]0.2652[/C][C]0.1572[/C][C]0.5867[/C][/ROW]
[ROW][C]56[/C][C]241[/C][C]210.1786[/C][C]144.3254[/C][C]276.0318[/C][C]0.1795[/C][C]0.2776[/C][C]0.1818[/C][C]0.5765[/C][/ROW]
[ROW][C]57[/C][C]259.6[/C][C]212.8662[/C][C]143.0183[/C][C]282.714[/C][C]0.0949[/C][C]0.2149[/C][C]0.1163[/C][C]0.6015[/C][/ROW]
[ROW][C]58[/C][C]247.8[/C][C]212.3069[/C][C]138.6808[/C][C]285.933[/C][C]0.1724[/C][C]0.104[/C][C]0.1393[/C][C]0.5906[/C][/ROW]
[ROW][C]59[/C][C]270.3[/C][C]205.8361[/C][C]128.6164[/C][C]283.0558[/C][C]0.0509[/C][C]0.1434[/C][C]0.3768[/C][C]0.5216[/C][/ROW]
[ROW][C]60[/C][C]289.7[/C][C]203.2135[/C][C]122.5601[/C][C]283.8668[/C][C]0.0178[/C][C]0.0515[/C][C]0.4953[/C][C]0.4953[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3762&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3762&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])
36205-------
37194-------
38199.3-------
39219.3-------
40211.1-------
41215.2-------
42240.2-------
43242.2-------
44240.7-------
45255.4-------
46253-------
47218.2-------
48203.7-------
49205.6201.7413178.4586225.02390.37270.43450.74270.4345
50215.6202.8003169.8737235.72690.22310.43380.58250.4786
51188.5206.4373166.1106246.76390.19170.3280.26590.5529
52202.9204.8808158.3156251.4460.46680.75470.39670.5198
53214205.5039153.4423257.56540.37450.5390.35750.5271
54230.3210.1531153.1225267.18360.24430.44740.15090.5878
55230210.5855148.9855272.18550.26840.26520.15720.5867
56241210.1786144.3254276.03180.17950.27760.18180.5765
57259.6212.8662143.0183282.7140.09490.21490.11630.6015
58247.8212.3069138.6808285.9330.17240.1040.13930.5906
59270.3205.8361128.6164283.05580.05090.14340.37680.5216
60289.7203.2135122.5601283.86680.01780.05150.49530.4953







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.05890.01910.001614.88991.24081.1139
500.08280.06310.0053163.831913.65273.6949
510.0997-0.08690.0072321.745226.81215.178
520.116-0.00978e-043.92350.3270.5718
530.12930.04130.003472.18446.01542.4526
540.13850.09590.008405.898533.82495.8159
550.14920.09220.0077376.924131.41035.6045
560.15990.14660.0122949.957479.16318.8974
570.16740.21950.01832184.0505182.004213.4909
580.17690.16720.01391259.7577104.979810.246
590.19140.31320.02614155.5959346.299718.6091
600.20250.42560.03557479.9203623.326724.9665

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0589 & 0.0191 & 0.0016 & 14.8899 & 1.2408 & 1.1139 \tabularnewline
50 & 0.0828 & 0.0631 & 0.0053 & 163.8319 & 13.6527 & 3.6949 \tabularnewline
51 & 0.0997 & -0.0869 & 0.0072 & 321.7452 & 26.8121 & 5.178 \tabularnewline
52 & 0.116 & -0.0097 & 8e-04 & 3.9235 & 0.327 & 0.5718 \tabularnewline
53 & 0.1293 & 0.0413 & 0.0034 & 72.1844 & 6.0154 & 2.4526 \tabularnewline
54 & 0.1385 & 0.0959 & 0.008 & 405.8985 & 33.8249 & 5.8159 \tabularnewline
55 & 0.1492 & 0.0922 & 0.0077 & 376.9241 & 31.4103 & 5.6045 \tabularnewline
56 & 0.1599 & 0.1466 & 0.0122 & 949.9574 & 79.1631 & 8.8974 \tabularnewline
57 & 0.1674 & 0.2195 & 0.0183 & 2184.0505 & 182.0042 & 13.4909 \tabularnewline
58 & 0.1769 & 0.1672 & 0.0139 & 1259.7577 & 104.9798 & 10.246 \tabularnewline
59 & 0.1914 & 0.3132 & 0.0261 & 4155.5959 & 346.2997 & 18.6091 \tabularnewline
60 & 0.2025 & 0.4256 & 0.0355 & 7479.9203 & 623.3267 & 24.9665 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3762&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.0589[/C][C]0.0191[/C][C]0.0016[/C][C]14.8899[/C][C]1.2408[/C][C]1.1139[/C][/ROW]
[ROW][C]50[/C][C]0.0828[/C][C]0.0631[/C][C]0.0053[/C][C]163.8319[/C][C]13.6527[/C][C]3.6949[/C][/ROW]
[ROW][C]51[/C][C]0.0997[/C][C]-0.0869[/C][C]0.0072[/C][C]321.7452[/C][C]26.8121[/C][C]5.178[/C][/ROW]
[ROW][C]52[/C][C]0.116[/C][C]-0.0097[/C][C]8e-04[/C][C]3.9235[/C][C]0.327[/C][C]0.5718[/C][/ROW]
[ROW][C]53[/C][C]0.1293[/C][C]0.0413[/C][C]0.0034[/C][C]72.1844[/C][C]6.0154[/C][C]2.4526[/C][/ROW]
[ROW][C]54[/C][C]0.1385[/C][C]0.0959[/C][C]0.008[/C][C]405.8985[/C][C]33.8249[/C][C]5.8159[/C][/ROW]
[ROW][C]55[/C][C]0.1492[/C][C]0.0922[/C][C]0.0077[/C][C]376.9241[/C][C]31.4103[/C][C]5.6045[/C][/ROW]
[ROW][C]56[/C][C]0.1599[/C][C]0.1466[/C][C]0.0122[/C][C]949.9574[/C][C]79.1631[/C][C]8.8974[/C][/ROW]
[ROW][C]57[/C][C]0.1674[/C][C]0.2195[/C][C]0.0183[/C][C]2184.0505[/C][C]182.0042[/C][C]13.4909[/C][/ROW]
[ROW][C]58[/C][C]0.1769[/C][C]0.1672[/C][C]0.0139[/C][C]1259.7577[/C][C]104.9798[/C][C]10.246[/C][/ROW]
[ROW][C]59[/C][C]0.1914[/C][C]0.3132[/C][C]0.0261[/C][C]4155.5959[/C][C]346.2997[/C][C]18.6091[/C][/ROW]
[ROW][C]60[/C][C]0.2025[/C][C]0.4256[/C][C]0.0355[/C][C]7479.9203[/C][C]623.3267[/C][C]24.9665[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3762&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3762&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.05890.01910.001614.88991.24081.1139
500.08280.06310.0053163.831913.65273.6949
510.0997-0.08690.0072321.745226.81215.178
520.116-0.00978e-043.92350.3270.5718
530.12930.04130.003472.18446.01542.4526
540.13850.09590.008405.898533.82495.8159
550.14920.09220.0077376.924131.41035.6045
560.15990.14660.0122949.957479.16318.8974
570.16740.21950.01832184.0505182.004213.4909
580.17690.16720.01391259.7577104.979810.246
590.19140.31320.02614155.5959346.299718.6091
600.20250.42560.03557479.9203623.326724.9665



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