Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 11 Dec 2007 07:01:44 -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/11/t1197385944h2hd99g5su7naa9.htm/, Retrieved Mon, 29 Apr 2024 03:23:59 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3122, Retrieved Mon, 29 Apr 2024 03:23:59 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact235
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Foorcasting] [2007-12-11 14:01:44] [9ec4fcc2bfe8b6d942eac6074e595603] [Current]
- RMPD    [ARIMA Forecasting] [PAPER] [2009-12-07 21:44:50] [37daf76adc256428993ec4063536c760]
Feedback Forum

Post a new message
Dataseries X:
106.70
110.20
125.90
100.10
106.40
114.80
81.30
87.00
104.20
108.00
105.00
94.50
92.00
95.90
108.80
103.40
102.10
110.10
83.20
82.70
106.80
113.70
102.50
96.60
92.10
95.60
102.30
98.60
98.20
104.50
84.00
73.80
103.90
106.00
97.20
102.60
89.00
93.80
116.70
106.80
98.50
118.70
90.00
91.90
113.30
113.10
104.10
108.70
96.70
101.00
116.90
105.80
99.00
129.40
83.00
88.90
115.90
104.20
113.40
112.20




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=3122&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=3122&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3122&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])
36102.6-------
3789-------
3893.8-------
39116.7-------
40106.8-------
4198.5-------
42118.7-------
4390-------
4491.9-------
45113.3-------
46113.1-------
47104.1-------
48108.7-------
4996.794.545484.3994104.69140.33860.00310.8580.0031
5010199.900889.2962110.50540.41950.72290.87030.0519
51116.9117.5819105.6706129.49320.45530.99680.55770.9281
52105.8106.23390.9727121.49330.47780.08530.4710.3757
5399104.107887.6913120.52430.2710.41990.74840.2918
54129.4117.465599.0576135.87330.10190.97540.44770.8247
558389.954269.0764110.83210.25691e-040.49830.0392
5688.988.650866.1565111.14510.49130.68880.38850.0403
57115.9113.056288.4331137.67930.41050.97270.49230.6356
58104.2114.411587.6324141.19060.22740.45660.53820.662
59113.4106.090477.4853134.69550.30820.55150.55420.429
60112.2107.946577.2624138.63060.39290.36380.48080.4808

\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.6 & - & - & - & - & - & - & - \tabularnewline
37 & 89 & - & - & - & - & - & - & - \tabularnewline
38 & 93.8 & - & - & - & - & - & - & - \tabularnewline
39 & 116.7 & - & - & - & - & - & - & - \tabularnewline
40 & 106.8 & - & - & - & - & - & - & - \tabularnewline
41 & 98.5 & - & - & - & - & - & - & - \tabularnewline
42 & 118.7 & - & - & - & - & - & - & - \tabularnewline
43 & 90 & - & - & - & - & - & - & - \tabularnewline
44 & 91.9 & - & - & - & - & - & - & - \tabularnewline
45 & 113.3 & - & - & - & - & - & - & - \tabularnewline
46 & 113.1 & - & - & - & - & - & - & - \tabularnewline
47 & 104.1 & - & - & - & - & - & - & - \tabularnewline
48 & 108.7 & - & - & - & - & - & - & - \tabularnewline
49 & 96.7 & 94.5454 & 84.3994 & 104.6914 & 0.3386 & 0.0031 & 0.858 & 0.0031 \tabularnewline
50 & 101 & 99.9008 & 89.2962 & 110.5054 & 0.4195 & 0.7229 & 0.8703 & 0.0519 \tabularnewline
51 & 116.9 & 117.5819 & 105.6706 & 129.4932 & 0.4553 & 0.9968 & 0.5577 & 0.9281 \tabularnewline
52 & 105.8 & 106.233 & 90.9727 & 121.4933 & 0.4778 & 0.0853 & 0.471 & 0.3757 \tabularnewline
53 & 99 & 104.1078 & 87.6913 & 120.5243 & 0.271 & 0.4199 & 0.7484 & 0.2918 \tabularnewline
54 & 129.4 & 117.4655 & 99.0576 & 135.8733 & 0.1019 & 0.9754 & 0.4477 & 0.8247 \tabularnewline
55 & 83 & 89.9542 & 69.0764 & 110.8321 & 0.2569 & 1e-04 & 0.4983 & 0.0392 \tabularnewline
56 & 88.9 & 88.6508 & 66.1565 & 111.1451 & 0.4913 & 0.6888 & 0.3885 & 0.0403 \tabularnewline
57 & 115.9 & 113.0562 & 88.4331 & 137.6793 & 0.4105 & 0.9727 & 0.4923 & 0.6356 \tabularnewline
58 & 104.2 & 114.4115 & 87.6324 & 141.1906 & 0.2274 & 0.4566 & 0.5382 & 0.662 \tabularnewline
59 & 113.4 & 106.0904 & 77.4853 & 134.6955 & 0.3082 & 0.5515 & 0.5542 & 0.429 \tabularnewline
60 & 112.2 & 107.9465 & 77.2624 & 138.6306 & 0.3929 & 0.3638 & 0.4808 & 0.4808 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3122&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.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]89[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]93.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]116.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]106.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]98.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]118.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]90[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]91.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]113.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]113.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]104.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]108.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]96.7[/C][C]94.5454[/C][C]84.3994[/C][C]104.6914[/C][C]0.3386[/C][C]0.0031[/C][C]0.858[/C][C]0.0031[/C][/ROW]
[ROW][C]50[/C][C]101[/C][C]99.9008[/C][C]89.2962[/C][C]110.5054[/C][C]0.4195[/C][C]0.7229[/C][C]0.8703[/C][C]0.0519[/C][/ROW]
[ROW][C]51[/C][C]116.9[/C][C]117.5819[/C][C]105.6706[/C][C]129.4932[/C][C]0.4553[/C][C]0.9968[/C][C]0.5577[/C][C]0.9281[/C][/ROW]
[ROW][C]52[/C][C]105.8[/C][C]106.233[/C][C]90.9727[/C][C]121.4933[/C][C]0.4778[/C][C]0.0853[/C][C]0.471[/C][C]0.3757[/C][/ROW]
[ROW][C]53[/C][C]99[/C][C]104.1078[/C][C]87.6913[/C][C]120.5243[/C][C]0.271[/C][C]0.4199[/C][C]0.7484[/C][C]0.2918[/C][/ROW]
[ROW][C]54[/C][C]129.4[/C][C]117.4655[/C][C]99.0576[/C][C]135.8733[/C][C]0.1019[/C][C]0.9754[/C][C]0.4477[/C][C]0.8247[/C][/ROW]
[ROW][C]55[/C][C]83[/C][C]89.9542[/C][C]69.0764[/C][C]110.8321[/C][C]0.2569[/C][C]1e-04[/C][C]0.4983[/C][C]0.0392[/C][/ROW]
[ROW][C]56[/C][C]88.9[/C][C]88.6508[/C][C]66.1565[/C][C]111.1451[/C][C]0.4913[/C][C]0.6888[/C][C]0.3885[/C][C]0.0403[/C][/ROW]
[ROW][C]57[/C][C]115.9[/C][C]113.0562[/C][C]88.4331[/C][C]137.6793[/C][C]0.4105[/C][C]0.9727[/C][C]0.4923[/C][C]0.6356[/C][/ROW]
[ROW][C]58[/C][C]104.2[/C][C]114.4115[/C][C]87.6324[/C][C]141.1906[/C][C]0.2274[/C][C]0.4566[/C][C]0.5382[/C][C]0.662[/C][/ROW]
[ROW][C]59[/C][C]113.4[/C][C]106.0904[/C][C]77.4853[/C][C]134.6955[/C][C]0.3082[/C][C]0.5515[/C][C]0.5542[/C][C]0.429[/C][/ROW]
[ROW][C]60[/C][C]112.2[/C][C]107.9465[/C][C]77.2624[/C][C]138.6306[/C][C]0.3929[/C][C]0.3638[/C][C]0.4808[/C][C]0.4808[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3122&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3122&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.6-------
3789-------
3893.8-------
39116.7-------
40106.8-------
4198.5-------
42118.7-------
4390-------
4491.9-------
45113.3-------
46113.1-------
47104.1-------
48108.7-------
4996.794.545484.3994104.69140.33860.00310.8580.0031
5010199.900889.2962110.50540.41950.72290.87030.0519
51116.9117.5819105.6706129.49320.45530.99680.55770.9281
52105.8106.23390.9727121.49330.47780.08530.4710.3757
5399104.107887.6913120.52430.2710.41990.74840.2918
54129.4117.465599.0576135.87330.10190.97540.44770.8247
558389.954269.0764110.83210.25691e-040.49830.0392
5688.988.650866.1565111.14510.49130.68880.38850.0403
57115.9113.056288.4331137.67930.41050.97270.49230.6356
58104.2114.411587.6324141.19060.22740.45660.53820.662
59113.4106.090477.4853134.69550.30820.55150.55420.429
60112.2107.946577.2624138.63060.39290.36380.48080.4808







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.05480.02280.00194.64240.38690.622
500.05420.0119e-041.20830.10070.3173
510.0517-0.00585e-040.4650.03870.1968
520.0733-0.00413e-040.18750.01560.125
530.0805-0.04910.004126.08952.17411.4745
540.080.10160.0085142.432911.86943.4452
550.1184-0.07730.006448.36124.03012.0075
560.12950.00282e-040.06210.00520.0719
570.11110.02520.00218.08710.67390.8209
580.1194-0.08930.0074104.2748.68952.9478
590.13760.06890.005753.43024.45252.1101
600.1450.03940.003318.09211.50771.2279

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0548 & 0.0228 & 0.0019 & 4.6424 & 0.3869 & 0.622 \tabularnewline
50 & 0.0542 & 0.011 & 9e-04 & 1.2083 & 0.1007 & 0.3173 \tabularnewline
51 & 0.0517 & -0.0058 & 5e-04 & 0.465 & 0.0387 & 0.1968 \tabularnewline
52 & 0.0733 & -0.0041 & 3e-04 & 0.1875 & 0.0156 & 0.125 \tabularnewline
53 & 0.0805 & -0.0491 & 0.0041 & 26.0895 & 2.1741 & 1.4745 \tabularnewline
54 & 0.08 & 0.1016 & 0.0085 & 142.4329 & 11.8694 & 3.4452 \tabularnewline
55 & 0.1184 & -0.0773 & 0.0064 & 48.3612 & 4.0301 & 2.0075 \tabularnewline
56 & 0.1295 & 0.0028 & 2e-04 & 0.0621 & 0.0052 & 0.0719 \tabularnewline
57 & 0.1111 & 0.0252 & 0.0021 & 8.0871 & 0.6739 & 0.8209 \tabularnewline
58 & 0.1194 & -0.0893 & 0.0074 & 104.274 & 8.6895 & 2.9478 \tabularnewline
59 & 0.1376 & 0.0689 & 0.0057 & 53.4302 & 4.4525 & 2.1101 \tabularnewline
60 & 0.145 & 0.0394 & 0.0033 & 18.0921 & 1.5077 & 1.2279 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3122&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.0548[/C][C]0.0228[/C][C]0.0019[/C][C]4.6424[/C][C]0.3869[/C][C]0.622[/C][/ROW]
[ROW][C]50[/C][C]0.0542[/C][C]0.011[/C][C]9e-04[/C][C]1.2083[/C][C]0.1007[/C][C]0.3173[/C][/ROW]
[ROW][C]51[/C][C]0.0517[/C][C]-0.0058[/C][C]5e-04[/C][C]0.465[/C][C]0.0387[/C][C]0.1968[/C][/ROW]
[ROW][C]52[/C][C]0.0733[/C][C]-0.0041[/C][C]3e-04[/C][C]0.1875[/C][C]0.0156[/C][C]0.125[/C][/ROW]
[ROW][C]53[/C][C]0.0805[/C][C]-0.0491[/C][C]0.0041[/C][C]26.0895[/C][C]2.1741[/C][C]1.4745[/C][/ROW]
[ROW][C]54[/C][C]0.08[/C][C]0.1016[/C][C]0.0085[/C][C]142.4329[/C][C]11.8694[/C][C]3.4452[/C][/ROW]
[ROW][C]55[/C][C]0.1184[/C][C]-0.0773[/C][C]0.0064[/C][C]48.3612[/C][C]4.0301[/C][C]2.0075[/C][/ROW]
[ROW][C]56[/C][C]0.1295[/C][C]0.0028[/C][C]2e-04[/C][C]0.0621[/C][C]0.0052[/C][C]0.0719[/C][/ROW]
[ROW][C]57[/C][C]0.1111[/C][C]0.0252[/C][C]0.0021[/C][C]8.0871[/C][C]0.6739[/C][C]0.8209[/C][/ROW]
[ROW][C]58[/C][C]0.1194[/C][C]-0.0893[/C][C]0.0074[/C][C]104.274[/C][C]8.6895[/C][C]2.9478[/C][/ROW]
[ROW][C]59[/C][C]0.1376[/C][C]0.0689[/C][C]0.0057[/C][C]53.4302[/C][C]4.4525[/C][C]2.1101[/C][/ROW]
[ROW][C]60[/C][C]0.145[/C][C]0.0394[/C][C]0.0033[/C][C]18.0921[/C][C]1.5077[/C][C]1.2279[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3122&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3122&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.05480.02280.00194.64240.38690.622
500.05420.0119e-041.20830.10070.3173
510.0517-0.00585e-040.4650.03870.1968
520.0733-0.00413e-040.18750.01560.125
530.0805-0.04910.004126.08952.17411.4745
540.080.10160.0085142.432911.86943.4452
550.1184-0.07730.006448.36124.03012.0075
560.12950.00282e-040.06210.00520.0719
570.11110.02520.00218.08710.67390.8209
580.1194-0.08930.0074104.2748.68952.9478
590.13760.06890.005753.43024.45252.1101
600.1450.03940.003318.09211.50771.2279



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