Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 07 Dec 2007 05:35:28 -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/07/t1197030134nmx6jllu8tzqlnk.htm/, Retrieved Sun, 28 Apr 2024 20:01:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2778, Retrieved Sun, 28 Apr 2024 20:01:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsWorkshop 9 question 1, duurzame consumptiegoederen
Estimated Impact192
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Workshop 9 questi...] [2007-12-07 12:35:28] [181c187d2008ac66a37ecc12859b08c5] [Current]
Feedback Forum

Post a new message
Dataseries X:
106,7
100,6
101,2
93,1
84,2
85,8
91,8
92,4
80,3
79,7
62,5
57,1
100,8
100,7
86,2
83,2
71,7
77,5
89,8
80,3
78,7
93,8
57,6
60,6
91
85,3
77,4
77,3
68,3
69,9
81,7
75,1
69,9
84
54,3
60
89,9
77
85,3
77,6
69,2
75,5
85,7
72,2
79,9
85,3
52,2
61,2
82,4
85,4
78,2
70,2
70,2
69,3
77,5
66,1
69
75,3
58,2
59,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=2778&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=2778&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2778&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])
3660-------
3789.9-------
3877-------
3985.3-------
4077.6-------
4169.2-------
4275.5-------
4385.7-------
4472.2-------
4579.9-------
4685.3-------
4752.2-------
4861.2-------
4982.488.884476.6189101.14990.150110.43551
5085.476.715864.00189.43050.09030.19050.48250.9916
5178.285.476472.378498.57450.13810.50460.51050.9999
5270.277.125763.094291.15710.16670.44040.47360.9869
5370.269.208555.097983.31910.44520.44520.50050.867
5469.375.424961.108589.74130.20090.76280.49590.9743
5577.585.539771.090499.9890.13770.98620.49130.9995
5666.172.201657.717986.68530.20450.23670.50010.9317
576979.825865.28294.36970.07230.96780.4960.994
5875.385.251770.68499.81930.09030.98560.49740.9994
5958.252.185137.603466.76690.20949e-040.49920.1128
6059.761.160946.56575.75670.42220.65450.49790.4979

\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 & 60 & - & - & - & - & - & - & - \tabularnewline
37 & 89.9 & - & - & - & - & - & - & - \tabularnewline
38 & 77 & - & - & - & - & - & - & - \tabularnewline
39 & 85.3 & - & - & - & - & - & - & - \tabularnewline
40 & 77.6 & - & - & - & - & - & - & - \tabularnewline
41 & 69.2 & - & - & - & - & - & - & - \tabularnewline
42 & 75.5 & - & - & - & - & - & - & - \tabularnewline
43 & 85.7 & - & - & - & - & - & - & - \tabularnewline
44 & 72.2 & - & - & - & - & - & - & - \tabularnewline
45 & 79.9 & - & - & - & - & - & - & - \tabularnewline
46 & 85.3 & - & - & - & - & - & - & - \tabularnewline
47 & 52.2 & - & - & - & - & - & - & - \tabularnewline
48 & 61.2 & - & - & - & - & - & - & - \tabularnewline
49 & 82.4 & 88.8844 & 76.6189 & 101.1499 & 0.1501 & 1 & 0.4355 & 1 \tabularnewline
50 & 85.4 & 76.7158 & 64.001 & 89.4305 & 0.0903 & 0.1905 & 0.4825 & 0.9916 \tabularnewline
51 & 78.2 & 85.4764 & 72.3784 & 98.5745 & 0.1381 & 0.5046 & 0.5105 & 0.9999 \tabularnewline
52 & 70.2 & 77.1257 & 63.0942 & 91.1571 & 0.1667 & 0.4404 & 0.4736 & 0.9869 \tabularnewline
53 & 70.2 & 69.2085 & 55.0979 & 83.3191 & 0.4452 & 0.4452 & 0.5005 & 0.867 \tabularnewline
54 & 69.3 & 75.4249 & 61.1085 & 89.7413 & 0.2009 & 0.7628 & 0.4959 & 0.9743 \tabularnewline
55 & 77.5 & 85.5397 & 71.0904 & 99.989 & 0.1377 & 0.9862 & 0.4913 & 0.9995 \tabularnewline
56 & 66.1 & 72.2016 & 57.7179 & 86.6853 & 0.2045 & 0.2367 & 0.5001 & 0.9317 \tabularnewline
57 & 69 & 79.8258 & 65.282 & 94.3697 & 0.0723 & 0.9678 & 0.496 & 0.994 \tabularnewline
58 & 75.3 & 85.2517 & 70.684 & 99.8193 & 0.0903 & 0.9856 & 0.4974 & 0.9994 \tabularnewline
59 & 58.2 & 52.1851 & 37.6034 & 66.7669 & 0.2094 & 9e-04 & 0.4992 & 0.1128 \tabularnewline
60 & 59.7 & 61.1609 & 46.565 & 75.7567 & 0.4222 & 0.6545 & 0.4979 & 0.4979 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2778&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]60[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]89.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]77[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]85.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]77.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]69.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]75.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]85.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]72.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]79.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]85.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]52.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]61.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]82.4[/C][C]88.8844[/C][C]76.6189[/C][C]101.1499[/C][C]0.1501[/C][C]1[/C][C]0.4355[/C][C]1[/C][/ROW]
[ROW][C]50[/C][C]85.4[/C][C]76.7158[/C][C]64.001[/C][C]89.4305[/C][C]0.0903[/C][C]0.1905[/C][C]0.4825[/C][C]0.9916[/C][/ROW]
[ROW][C]51[/C][C]78.2[/C][C]85.4764[/C][C]72.3784[/C][C]98.5745[/C][C]0.1381[/C][C]0.5046[/C][C]0.5105[/C][C]0.9999[/C][/ROW]
[ROW][C]52[/C][C]70.2[/C][C]77.1257[/C][C]63.0942[/C][C]91.1571[/C][C]0.1667[/C][C]0.4404[/C][C]0.4736[/C][C]0.9869[/C][/ROW]
[ROW][C]53[/C][C]70.2[/C][C]69.2085[/C][C]55.0979[/C][C]83.3191[/C][C]0.4452[/C][C]0.4452[/C][C]0.5005[/C][C]0.867[/C][/ROW]
[ROW][C]54[/C][C]69.3[/C][C]75.4249[/C][C]61.1085[/C][C]89.7413[/C][C]0.2009[/C][C]0.7628[/C][C]0.4959[/C][C]0.9743[/C][/ROW]
[ROW][C]55[/C][C]77.5[/C][C]85.5397[/C][C]71.0904[/C][C]99.989[/C][C]0.1377[/C][C]0.9862[/C][C]0.4913[/C][C]0.9995[/C][/ROW]
[ROW][C]56[/C][C]66.1[/C][C]72.2016[/C][C]57.7179[/C][C]86.6853[/C][C]0.2045[/C][C]0.2367[/C][C]0.5001[/C][C]0.9317[/C][/ROW]
[ROW][C]57[/C][C]69[/C][C]79.8258[/C][C]65.282[/C][C]94.3697[/C][C]0.0723[/C][C]0.9678[/C][C]0.496[/C][C]0.994[/C][/ROW]
[ROW][C]58[/C][C]75.3[/C][C]85.2517[/C][C]70.684[/C][C]99.8193[/C][C]0.0903[/C][C]0.9856[/C][C]0.4974[/C][C]0.9994[/C][/ROW]
[ROW][C]59[/C][C]58.2[/C][C]52.1851[/C][C]37.6034[/C][C]66.7669[/C][C]0.2094[/C][C]9e-04[/C][C]0.4992[/C][C]0.1128[/C][/ROW]
[ROW][C]60[/C][C]59.7[/C][C]61.1609[/C][C]46.565[/C][C]75.7567[/C][C]0.4222[/C][C]0.6545[/C][C]0.4979[/C][C]0.4979[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2778&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2778&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])
3660-------
3789.9-------
3877-------
3985.3-------
4077.6-------
4169.2-------
4275.5-------
4385.7-------
4472.2-------
4579.9-------
4685.3-------
4752.2-------
4861.2-------
4982.488.884476.6189101.14990.150110.43551
5085.476.715864.00189.43050.09030.19050.48250.9916
5178.285.476472.378498.57450.13810.50460.51050.9999
5270.277.125763.094291.15710.16670.44040.47360.9869
5370.269.208555.097983.31910.44520.44520.50050.867
5469.375.424961.108589.74130.20090.76280.49590.9743
5577.585.539771.090499.9890.13770.98620.49130.9995
5666.172.201657.717986.68530.20450.23670.50010.9317
576979.825865.28294.36970.07230.96780.4960.994
5875.385.251770.68499.81930.09030.98560.49740.9994
5958.252.185137.603466.76690.20949e-040.49920.1128
6059.761.160946.56575.75670.42220.65450.49790.4979







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0704-0.0730.006142.04683.50391.8719
500.08460.11320.009475.4166.28472.5069
510.0782-0.08510.007152.94674.41222.1005
520.0928-0.08980.007547.9653.99711.9993
530.1040.01430.00120.9830.08190.2862
540.0968-0.08120.006837.51423.12621.7681
550.0862-0.0940.007864.63665.38642.3209
560.1023-0.08450.00737.233.10251.7614
570.093-0.13560.0113117.1989.76653.1251
580.0872-0.11670.009799.03588.2532.8728
590.14260.11530.009636.17853.01491.7363
600.1218-0.02390.0022.13410.17780.4217

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0704 & -0.073 & 0.0061 & 42.0468 & 3.5039 & 1.8719 \tabularnewline
50 & 0.0846 & 0.1132 & 0.0094 & 75.416 & 6.2847 & 2.5069 \tabularnewline
51 & 0.0782 & -0.0851 & 0.0071 & 52.9467 & 4.4122 & 2.1005 \tabularnewline
52 & 0.0928 & -0.0898 & 0.0075 & 47.965 & 3.9971 & 1.9993 \tabularnewline
53 & 0.104 & 0.0143 & 0.0012 & 0.983 & 0.0819 & 0.2862 \tabularnewline
54 & 0.0968 & -0.0812 & 0.0068 & 37.5142 & 3.1262 & 1.7681 \tabularnewline
55 & 0.0862 & -0.094 & 0.0078 & 64.6366 & 5.3864 & 2.3209 \tabularnewline
56 & 0.1023 & -0.0845 & 0.007 & 37.23 & 3.1025 & 1.7614 \tabularnewline
57 & 0.093 & -0.1356 & 0.0113 & 117.198 & 9.7665 & 3.1251 \tabularnewline
58 & 0.0872 & -0.1167 & 0.0097 & 99.0358 & 8.253 & 2.8728 \tabularnewline
59 & 0.1426 & 0.1153 & 0.0096 & 36.1785 & 3.0149 & 1.7363 \tabularnewline
60 & 0.1218 & -0.0239 & 0.002 & 2.1341 & 0.1778 & 0.4217 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2778&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.0704[/C][C]-0.073[/C][C]0.0061[/C][C]42.0468[/C][C]3.5039[/C][C]1.8719[/C][/ROW]
[ROW][C]50[/C][C]0.0846[/C][C]0.1132[/C][C]0.0094[/C][C]75.416[/C][C]6.2847[/C][C]2.5069[/C][/ROW]
[ROW][C]51[/C][C]0.0782[/C][C]-0.0851[/C][C]0.0071[/C][C]52.9467[/C][C]4.4122[/C][C]2.1005[/C][/ROW]
[ROW][C]52[/C][C]0.0928[/C][C]-0.0898[/C][C]0.0075[/C][C]47.965[/C][C]3.9971[/C][C]1.9993[/C][/ROW]
[ROW][C]53[/C][C]0.104[/C][C]0.0143[/C][C]0.0012[/C][C]0.983[/C][C]0.0819[/C][C]0.2862[/C][/ROW]
[ROW][C]54[/C][C]0.0968[/C][C]-0.0812[/C][C]0.0068[/C][C]37.5142[/C][C]3.1262[/C][C]1.7681[/C][/ROW]
[ROW][C]55[/C][C]0.0862[/C][C]-0.094[/C][C]0.0078[/C][C]64.6366[/C][C]5.3864[/C][C]2.3209[/C][/ROW]
[ROW][C]56[/C][C]0.1023[/C][C]-0.0845[/C][C]0.007[/C][C]37.23[/C][C]3.1025[/C][C]1.7614[/C][/ROW]
[ROW][C]57[/C][C]0.093[/C][C]-0.1356[/C][C]0.0113[/C][C]117.198[/C][C]9.7665[/C][C]3.1251[/C][/ROW]
[ROW][C]58[/C][C]0.0872[/C][C]-0.1167[/C][C]0.0097[/C][C]99.0358[/C][C]8.253[/C][C]2.8728[/C][/ROW]
[ROW][C]59[/C][C]0.1426[/C][C]0.1153[/C][C]0.0096[/C][C]36.1785[/C][C]3.0149[/C][C]1.7363[/C][/ROW]
[ROW][C]60[/C][C]0.1218[/C][C]-0.0239[/C][C]0.002[/C][C]2.1341[/C][C]0.1778[/C][C]0.4217[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2778&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2778&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.0704-0.0730.006142.04683.50391.8719
500.08460.11320.009475.4166.28472.5069
510.0782-0.08510.007152.94674.41222.1005
520.0928-0.08980.007547.9653.99711.9993
530.1040.01430.00120.9830.08190.2862
540.0968-0.08120.006837.51423.12621.7681
550.0862-0.0940.007864.63665.38642.3209
560.1023-0.08450.00737.233.10251.7614
570.093-0.13560.0113117.1989.76653.1251
580.0872-0.11670.009799.03588.2532.8728
590.14260.11530.009636.17853.01491.7363
600.1218-0.02390.0022.13410.17780.4217



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