Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationMon, 10 Dec 2007 11:28:26 -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/10/t1197310473oxep3o4pwrtm3gp.htm/, Retrieved Mon, 06 May 2024 15:25:52 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3011, Retrieved Mon, 06 May 2024 15:25:52 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact227
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forecasting...] [2007-12-10 18:28:26] [014bfc073eb4f6c1ae65a07cc44c50c0] [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 time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\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 & 3 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3011&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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3011&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3011&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 time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







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.009376.145999.87260.17710.37741
5085.478.656466.246791.06610.14340.27720.60320.9971
5178.282.849969.927795.77210.24030.34950.35510.9995
5270.276.365162.1690.57020.19750.40010.43230.9818
5370.268.717154.361383.0730.41980.41980.47370.8476
5469.373.461558.729788.19340.28990.66780.39310.9486
5577.584.05769.054199.05990.19580.97310.4150.9986
5666.172.82457.728187.920.19130.27190.53230.9344
576976.732461.479291.98570.16020.91410.3420.977
5875.384.68969.3597100.01820.1150.97760.46890.9987
5958.252.618937.236568.00140.23850.00190.52130.1371
6059.760.648945.211376.08640.45210.62210.47210.4721

\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.0093 & 76.1459 & 99.8726 & 0.177 & 1 & 0.3774 & 1 \tabularnewline
50 & 85.4 & 78.6564 & 66.2467 & 91.0661 & 0.1434 & 0.2772 & 0.6032 & 0.9971 \tabularnewline
51 & 78.2 & 82.8499 & 69.9277 & 95.7721 & 0.2403 & 0.3495 & 0.3551 & 0.9995 \tabularnewline
52 & 70.2 & 76.3651 & 62.16 & 90.5702 & 0.1975 & 0.4001 & 0.4323 & 0.9818 \tabularnewline
53 & 70.2 & 68.7171 & 54.3613 & 83.073 & 0.4198 & 0.4198 & 0.4737 & 0.8476 \tabularnewline
54 & 69.3 & 73.4615 & 58.7297 & 88.1934 & 0.2899 & 0.6678 & 0.3931 & 0.9486 \tabularnewline
55 & 77.5 & 84.057 & 69.0541 & 99.0599 & 0.1958 & 0.9731 & 0.415 & 0.9986 \tabularnewline
56 & 66.1 & 72.824 & 57.7281 & 87.92 & 0.1913 & 0.2719 & 0.5323 & 0.9344 \tabularnewline
57 & 69 & 76.7324 & 61.4792 & 91.9857 & 0.1602 & 0.9141 & 0.342 & 0.977 \tabularnewline
58 & 75.3 & 84.689 & 69.3597 & 100.0182 & 0.115 & 0.9776 & 0.4689 & 0.9987 \tabularnewline
59 & 58.2 & 52.6189 & 37.2365 & 68.0014 & 0.2385 & 0.0019 & 0.5213 & 0.1371 \tabularnewline
60 & 59.7 & 60.6489 & 45.2113 & 76.0864 & 0.4521 & 0.6221 & 0.4721 & 0.4721 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3011&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.0093[/C][C]76.1459[/C][C]99.8726[/C][C]0.177[/C][C]1[/C][C]0.3774[/C][C]1[/C][/ROW]
[ROW][C]50[/C][C]85.4[/C][C]78.6564[/C][C]66.2467[/C][C]91.0661[/C][C]0.1434[/C][C]0.2772[/C][C]0.6032[/C][C]0.9971[/C][/ROW]
[ROW][C]51[/C][C]78.2[/C][C]82.8499[/C][C]69.9277[/C][C]95.7721[/C][C]0.2403[/C][C]0.3495[/C][C]0.3551[/C][C]0.9995[/C][/ROW]
[ROW][C]52[/C][C]70.2[/C][C]76.3651[/C][C]62.16[/C][C]90.5702[/C][C]0.1975[/C][C]0.4001[/C][C]0.4323[/C][C]0.9818[/C][/ROW]
[ROW][C]53[/C][C]70.2[/C][C]68.7171[/C][C]54.3613[/C][C]83.073[/C][C]0.4198[/C][C]0.4198[/C][C]0.4737[/C][C]0.8476[/C][/ROW]
[ROW][C]54[/C][C]69.3[/C][C]73.4615[/C][C]58.7297[/C][C]88.1934[/C][C]0.2899[/C][C]0.6678[/C][C]0.3931[/C][C]0.9486[/C][/ROW]
[ROW][C]55[/C][C]77.5[/C][C]84.057[/C][C]69.0541[/C][C]99.0599[/C][C]0.1958[/C][C]0.9731[/C][C]0.415[/C][C]0.9986[/C][/ROW]
[ROW][C]56[/C][C]66.1[/C][C]72.824[/C][C]57.7281[/C][C]87.92[/C][C]0.1913[/C][C]0.2719[/C][C]0.5323[/C][C]0.9344[/C][/ROW]
[ROW][C]57[/C][C]69[/C][C]76.7324[/C][C]61.4792[/C][C]91.9857[/C][C]0.1602[/C][C]0.9141[/C][C]0.342[/C][C]0.977[/C][/ROW]
[ROW][C]58[/C][C]75.3[/C][C]84.689[/C][C]69.3597[/C][C]100.0182[/C][C]0.115[/C][C]0.9776[/C][C]0.4689[/C][C]0.9987[/C][/ROW]
[ROW][C]59[/C][C]58.2[/C][C]52.6189[/C][C]37.2365[/C][C]68.0014[/C][C]0.2385[/C][C]0.0019[/C][C]0.5213[/C][C]0.1371[/C][/ROW]
[ROW][C]60[/C][C]59.7[/C][C]60.6489[/C][C]45.2113[/C][C]76.0864[/C][C]0.4521[/C][C]0.6221[/C][C]0.4721[/C][C]0.4721[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3011&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3011&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.009376.145999.87260.17710.37741
5085.478.656466.246791.06610.14340.27720.60320.9971
5178.282.849969.927795.77210.24030.34950.35510.9995
5270.276.365162.1690.57020.19750.40010.43230.9818
5370.268.717154.361383.0730.41980.41980.47370.8476
5469.373.461558.729788.19340.28990.66780.39310.9486
5577.584.05769.054199.05990.19580.97310.4150.9986
5666.172.82457.728187.920.19130.27190.53230.9344
576976.732461.479291.98570.16020.91410.3420.977
5875.384.68969.3597100.01820.1150.97760.46890.9987
5958.252.618937.236568.00140.23850.00190.52130.1371
6059.760.648945.211376.08640.45210.62210.47210.4721







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0688-0.06370.005331.46392.6221.6193
500.08050.08570.007145.47633.78971.9467
510.0796-0.05610.004721.62171.80181.3423
520.0949-0.08070.006738.00793.16731.7797
530.10660.02160.00182.19880.18320.4281
540.1023-0.05660.004717.31821.44321.2013
550.0911-0.0780.006542.9943.58281.8928
560.1058-0.09230.007745.21273.76771.9411
570.1014-0.10080.008459.79074.98262.2322
580.0924-0.11090.009288.15267.3462.7104
590.14920.10610.008831.14842.59571.6111
600.1299-0.01560.00130.90030.0750.2739

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0688 & -0.0637 & 0.0053 & 31.4639 & 2.622 & 1.6193 \tabularnewline
50 & 0.0805 & 0.0857 & 0.0071 & 45.4763 & 3.7897 & 1.9467 \tabularnewline
51 & 0.0796 & -0.0561 & 0.0047 & 21.6217 & 1.8018 & 1.3423 \tabularnewline
52 & 0.0949 & -0.0807 & 0.0067 & 38.0079 & 3.1673 & 1.7797 \tabularnewline
53 & 0.1066 & 0.0216 & 0.0018 & 2.1988 & 0.1832 & 0.4281 \tabularnewline
54 & 0.1023 & -0.0566 & 0.0047 & 17.3182 & 1.4432 & 1.2013 \tabularnewline
55 & 0.0911 & -0.078 & 0.0065 & 42.994 & 3.5828 & 1.8928 \tabularnewline
56 & 0.1058 & -0.0923 & 0.0077 & 45.2127 & 3.7677 & 1.9411 \tabularnewline
57 & 0.1014 & -0.1008 & 0.0084 & 59.7907 & 4.9826 & 2.2322 \tabularnewline
58 & 0.0924 & -0.1109 & 0.0092 & 88.1526 & 7.346 & 2.7104 \tabularnewline
59 & 0.1492 & 0.1061 & 0.0088 & 31.1484 & 2.5957 & 1.6111 \tabularnewline
60 & 0.1299 & -0.0156 & 0.0013 & 0.9003 & 0.075 & 0.2739 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3011&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.0688[/C][C]-0.0637[/C][C]0.0053[/C][C]31.4639[/C][C]2.622[/C][C]1.6193[/C][/ROW]
[ROW][C]50[/C][C]0.0805[/C][C]0.0857[/C][C]0.0071[/C][C]45.4763[/C][C]3.7897[/C][C]1.9467[/C][/ROW]
[ROW][C]51[/C][C]0.0796[/C][C]-0.0561[/C][C]0.0047[/C][C]21.6217[/C][C]1.8018[/C][C]1.3423[/C][/ROW]
[ROW][C]52[/C][C]0.0949[/C][C]-0.0807[/C][C]0.0067[/C][C]38.0079[/C][C]3.1673[/C][C]1.7797[/C][/ROW]
[ROW][C]53[/C][C]0.1066[/C][C]0.0216[/C][C]0.0018[/C][C]2.1988[/C][C]0.1832[/C][C]0.4281[/C][/ROW]
[ROW][C]54[/C][C]0.1023[/C][C]-0.0566[/C][C]0.0047[/C][C]17.3182[/C][C]1.4432[/C][C]1.2013[/C][/ROW]
[ROW][C]55[/C][C]0.0911[/C][C]-0.078[/C][C]0.0065[/C][C]42.994[/C][C]3.5828[/C][C]1.8928[/C][/ROW]
[ROW][C]56[/C][C]0.1058[/C][C]-0.0923[/C][C]0.0077[/C][C]45.2127[/C][C]3.7677[/C][C]1.9411[/C][/ROW]
[ROW][C]57[/C][C]0.1014[/C][C]-0.1008[/C][C]0.0084[/C][C]59.7907[/C][C]4.9826[/C][C]2.2322[/C][/ROW]
[ROW][C]58[/C][C]0.0924[/C][C]-0.1109[/C][C]0.0092[/C][C]88.1526[/C][C]7.346[/C][C]2.7104[/C][/ROW]
[ROW][C]59[/C][C]0.1492[/C][C]0.1061[/C][C]0.0088[/C][C]31.1484[/C][C]2.5957[/C][C]1.6111[/C][/ROW]
[ROW][C]60[/C][C]0.1299[/C][C]-0.0156[/C][C]0.0013[/C][C]0.9003[/C][C]0.075[/C][C]0.2739[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3011&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3011&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.0688-0.06370.005331.46392.6221.6193
500.08050.08570.007145.47633.78971.9467
510.0796-0.05610.004721.62171.80181.3423
520.0949-0.08070.006738.00793.16731.7797
530.10660.02160.00182.19880.18320.4281
540.1023-0.05660.004717.31821.44321.2013
550.0911-0.0780.006542.9943.58281.8928
560.1058-0.09230.007745.21273.76771.9411
570.1014-0.10080.008459.79074.98262.2322
580.0924-0.11090.009288.15267.3462.7104
590.14920.10610.008831.14842.59571.6111
600.1299-0.01560.00130.90030.0750.2739



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