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 computationTue, 16 Dec 2008 03:55:45 -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/2008/Dec/16/t12294250553kovy464mywujwq.htm/, Retrieved Wed, 15 May 2024 15:30:49 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=33907, Retrieved Wed, 15 May 2024 15:30:49 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact184
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forcasting ...] [2008-12-16 10:55:45] [52d1f7c78552cd0e785e1b7a3cade101] [Current]
Feedback Forum

Post a new message
Dataseries X:
87.00
96.30
107.1
115.2
106.1
89.50
91.30
97.60
100.7
104.6
94.70
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




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

\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 & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33907&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]1 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=33907&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33907&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 time1 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[38])
26137.7-------
27151.7-------
28156.8-------
29180-------
30180.4-------
31170.4-------
32191.6-------
33199.5-------
34218.2-------
35217.5-------
36205-------
37194-------
38199.3-------
39219.3158.991861.3142256.66950.11310.20930.55820.2093
40211.191.4998-45.5537228.55330.04360.03380.17520.0616
41215.2102.8748-34.1787239.92830.05410.06080.1350.084
42240.298.2748-38.7787235.32830.02120.04720.12010.0743
43242.284.9749-52.0786222.02840.01230.01320.11090.051
44240.7105.1498-31.9037242.20330.02630.0250.10820.0891
45255.4108.2498-28.8037245.30330.01770.02910.0960.0964
46253116.2998-20.7537253.35330.02530.02330.07250.1176
47218.2113.8998-23.1537250.95330.06790.02330.06920.111
48203.794.6964-41.0016230.39450.05770.03720.05560.0654
49205.688.9199-45.3646223.20440.04430.04690.06250.0536
50215.699.6798-34.6047233.96430.04530.06110.0730.073

\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[38]) \tabularnewline
26 & 137.7 & - & - & - & - & - & - & - \tabularnewline
27 & 151.7 & - & - & - & - & - & - & - \tabularnewline
28 & 156.8 & - & - & - & - & - & - & - \tabularnewline
29 & 180 & - & - & - & - & - & - & - \tabularnewline
30 & 180.4 & - & - & - & - & - & - & - \tabularnewline
31 & 170.4 & - & - & - & - & - & - & - \tabularnewline
32 & 191.6 & - & - & - & - & - & - & - \tabularnewline
33 & 199.5 & - & - & - & - & - & - & - \tabularnewline
34 & 218.2 & - & - & - & - & - & - & - \tabularnewline
35 & 217.5 & - & - & - & - & - & - & - \tabularnewline
36 & 205 & - & - & - & - & - & - & - \tabularnewline
37 & 194 & - & - & - & - & - & - & - \tabularnewline
38 & 199.3 & - & - & - & - & - & - & - \tabularnewline
39 & 219.3 & 158.9918 & 61.3142 & 256.6695 & 0.1131 & 0.2093 & 0.5582 & 0.2093 \tabularnewline
40 & 211.1 & 91.4998 & -45.5537 & 228.5533 & 0.0436 & 0.0338 & 0.1752 & 0.0616 \tabularnewline
41 & 215.2 & 102.8748 & -34.1787 & 239.9283 & 0.0541 & 0.0608 & 0.135 & 0.084 \tabularnewline
42 & 240.2 & 98.2748 & -38.7787 & 235.3283 & 0.0212 & 0.0472 & 0.1201 & 0.0743 \tabularnewline
43 & 242.2 & 84.9749 & -52.0786 & 222.0284 & 0.0123 & 0.0132 & 0.1109 & 0.051 \tabularnewline
44 & 240.7 & 105.1498 & -31.9037 & 242.2033 & 0.0263 & 0.025 & 0.1082 & 0.0891 \tabularnewline
45 & 255.4 & 108.2498 & -28.8037 & 245.3033 & 0.0177 & 0.0291 & 0.096 & 0.0964 \tabularnewline
46 & 253 & 116.2998 & -20.7537 & 253.3533 & 0.0253 & 0.0233 & 0.0725 & 0.1176 \tabularnewline
47 & 218.2 & 113.8998 & -23.1537 & 250.9533 & 0.0679 & 0.0233 & 0.0692 & 0.111 \tabularnewline
48 & 203.7 & 94.6964 & -41.0016 & 230.3945 & 0.0577 & 0.0372 & 0.0556 & 0.0654 \tabularnewline
49 & 205.6 & 88.9199 & -45.3646 & 223.2044 & 0.0443 & 0.0469 & 0.0625 & 0.0536 \tabularnewline
50 & 215.6 & 99.6798 & -34.6047 & 233.9643 & 0.0453 & 0.0611 & 0.073 & 0.073 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33907&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[38])[/C][/ROW]
[ROW][C]26[/C][C]137.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]27[/C][C]151.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]28[/C][C]156.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]29[/C][C]180[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]30[/C][C]180.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]31[/C][C]170.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]32[/C][C]191.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]199.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]218.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]217.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/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]158.9918[/C][C]61.3142[/C][C]256.6695[/C][C]0.1131[/C][C]0.2093[/C][C]0.5582[/C][C]0.2093[/C][/ROW]
[ROW][C]40[/C][C]211.1[/C][C]91.4998[/C][C]-45.5537[/C][C]228.5533[/C][C]0.0436[/C][C]0.0338[/C][C]0.1752[/C][C]0.0616[/C][/ROW]
[ROW][C]41[/C][C]215.2[/C][C]102.8748[/C][C]-34.1787[/C][C]239.9283[/C][C]0.0541[/C][C]0.0608[/C][C]0.135[/C][C]0.084[/C][/ROW]
[ROW][C]42[/C][C]240.2[/C][C]98.2748[/C][C]-38.7787[/C][C]235.3283[/C][C]0.0212[/C][C]0.0472[/C][C]0.1201[/C][C]0.0743[/C][/ROW]
[ROW][C]43[/C][C]242.2[/C][C]84.9749[/C][C]-52.0786[/C][C]222.0284[/C][C]0.0123[/C][C]0.0132[/C][C]0.1109[/C][C]0.051[/C][/ROW]
[ROW][C]44[/C][C]240.7[/C][C]105.1498[/C][C]-31.9037[/C][C]242.2033[/C][C]0.0263[/C][C]0.025[/C][C]0.1082[/C][C]0.0891[/C][/ROW]
[ROW][C]45[/C][C]255.4[/C][C]108.2498[/C][C]-28.8037[/C][C]245.3033[/C][C]0.0177[/C][C]0.0291[/C][C]0.096[/C][C]0.0964[/C][/ROW]
[ROW][C]46[/C][C]253[/C][C]116.2998[/C][C]-20.7537[/C][C]253.3533[/C][C]0.0253[/C][C]0.0233[/C][C]0.0725[/C][C]0.1176[/C][/ROW]
[ROW][C]47[/C][C]218.2[/C][C]113.8998[/C][C]-23.1537[/C][C]250.9533[/C][C]0.0679[/C][C]0.0233[/C][C]0.0692[/C][C]0.111[/C][/ROW]
[ROW][C]48[/C][C]203.7[/C][C]94.6964[/C][C]-41.0016[/C][C]230.3945[/C][C]0.0577[/C][C]0.0372[/C][C]0.0556[/C][C]0.0654[/C][/ROW]
[ROW][C]49[/C][C]205.6[/C][C]88.9199[/C][C]-45.3646[/C][C]223.2044[/C][C]0.0443[/C][C]0.0469[/C][C]0.0625[/C][C]0.0536[/C][/ROW]
[ROW][C]50[/C][C]215.6[/C][C]99.6798[/C][C]-34.6047[/C][C]233.9643[/C][C]0.0453[/C][C]0.0611[/C][C]0.073[/C][C]0.073[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33907&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33907&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[38])
26137.7-------
27151.7-------
28156.8-------
29180-------
30180.4-------
31170.4-------
32191.6-------
33199.5-------
34218.2-------
35217.5-------
36205-------
37194-------
38199.3-------
39219.3158.991861.3142256.66950.11310.20930.55820.2093
40211.191.4998-45.5537228.55330.04360.03380.17520.0616
41215.2102.8748-34.1787239.92830.05410.06080.1350.084
42240.298.2748-38.7787235.32830.02120.04720.12010.0743
43242.284.9749-52.0786222.02840.01230.01320.11090.051
44240.7105.1498-31.9037242.20330.02630.0250.10820.0891
45255.4108.2498-28.8037245.30330.01770.02910.0960.0964
46253116.2998-20.7537253.35330.02530.02330.07250.1176
47218.2113.8998-23.1537250.95330.06790.02330.06920.111
48203.794.6964-41.0016230.39450.05770.03720.05560.0654
49205.688.9199-45.3646223.20440.04430.04690.06250.0536
50215.699.6798-34.6047233.96430.04530.06110.0730.073







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
390.31340.37930.03163637.0742303.089517.4095
400.76421.30710.108914304.20381192.01734.5256
410.67971.09190.09112616.94971051.412532.4255
420.71151.44420.120320142.75531678.562940.9703
430.82291.85030.154224719.7442059.978745.387
440.6651.28910.107418373.85381531.154539.13
450.6461.35940.113321653.17911804.431642.4786
460.60121.17540.09818686.9451557.245439.4619
470.61390.91570.076310878.5298906.544230.1089
480.73111.15110.095911881.778990.148231.4666
490.77051.31220.109313614.25121134.520933.6827
500.68731.16290.096913437.48451119.790433.4633

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
39 & 0.3134 & 0.3793 & 0.0316 & 3637.0742 & 303.0895 & 17.4095 \tabularnewline
40 & 0.7642 & 1.3071 & 0.1089 & 14304.2038 & 1192.017 & 34.5256 \tabularnewline
41 & 0.6797 & 1.0919 & 0.091 & 12616.9497 & 1051.4125 & 32.4255 \tabularnewline
42 & 0.7115 & 1.4442 & 0.1203 & 20142.7553 & 1678.5629 & 40.9703 \tabularnewline
43 & 0.8229 & 1.8503 & 0.1542 & 24719.744 & 2059.9787 & 45.387 \tabularnewline
44 & 0.665 & 1.2891 & 0.1074 & 18373.8538 & 1531.1545 & 39.13 \tabularnewline
45 & 0.646 & 1.3594 & 0.1133 & 21653.1791 & 1804.4316 & 42.4786 \tabularnewline
46 & 0.6012 & 1.1754 & 0.098 & 18686.945 & 1557.2454 & 39.4619 \tabularnewline
47 & 0.6139 & 0.9157 & 0.0763 & 10878.5298 & 906.5442 & 30.1089 \tabularnewline
48 & 0.7311 & 1.1511 & 0.0959 & 11881.778 & 990.1482 & 31.4666 \tabularnewline
49 & 0.7705 & 1.3122 & 0.1093 & 13614.2512 & 1134.5209 & 33.6827 \tabularnewline
50 & 0.6873 & 1.1629 & 0.0969 & 13437.4845 & 1119.7904 & 33.4633 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=33907&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]39[/C][C]0.3134[/C][C]0.3793[/C][C]0.0316[/C][C]3637.0742[/C][C]303.0895[/C][C]17.4095[/C][/ROW]
[ROW][C]40[/C][C]0.7642[/C][C]1.3071[/C][C]0.1089[/C][C]14304.2038[/C][C]1192.017[/C][C]34.5256[/C][/ROW]
[ROW][C]41[/C][C]0.6797[/C][C]1.0919[/C][C]0.091[/C][C]12616.9497[/C][C]1051.4125[/C][C]32.4255[/C][/ROW]
[ROW][C]42[/C][C]0.7115[/C][C]1.4442[/C][C]0.1203[/C][C]20142.7553[/C][C]1678.5629[/C][C]40.9703[/C][/ROW]
[ROW][C]43[/C][C]0.8229[/C][C]1.8503[/C][C]0.1542[/C][C]24719.744[/C][C]2059.9787[/C][C]45.387[/C][/ROW]
[ROW][C]44[/C][C]0.665[/C][C]1.2891[/C][C]0.1074[/C][C]18373.8538[/C][C]1531.1545[/C][C]39.13[/C][/ROW]
[ROW][C]45[/C][C]0.646[/C][C]1.3594[/C][C]0.1133[/C][C]21653.1791[/C][C]1804.4316[/C][C]42.4786[/C][/ROW]
[ROW][C]46[/C][C]0.6012[/C][C]1.1754[/C][C]0.098[/C][C]18686.945[/C][C]1557.2454[/C][C]39.4619[/C][/ROW]
[ROW][C]47[/C][C]0.6139[/C][C]0.9157[/C][C]0.0763[/C][C]10878.5298[/C][C]906.5442[/C][C]30.1089[/C][/ROW]
[ROW][C]48[/C][C]0.7311[/C][C]1.1511[/C][C]0.0959[/C][C]11881.778[/C][C]990.1482[/C][C]31.4666[/C][/ROW]
[ROW][C]49[/C][C]0.7705[/C][C]1.3122[/C][C]0.1093[/C][C]13614.2512[/C][C]1134.5209[/C][C]33.6827[/C][/ROW]
[ROW][C]50[/C][C]0.6873[/C][C]1.1629[/C][C]0.0969[/C][C]13437.4845[/C][C]1119.7904[/C][C]33.4633[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=33907&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=33907&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
390.31340.37930.03163637.0742303.089517.4095
400.76421.30710.108914304.20381192.01734.5256
410.67971.09190.09112616.94971051.412532.4255
420.71151.44420.120320142.75531678.562940.9703
430.82291.85030.154224719.7442059.978745.387
440.6651.28910.107418373.85381531.154539.13
450.6461.35940.113321653.17911804.431642.4786
460.60121.17540.09818686.9451557.245439.4619
470.61390.91570.076310878.5298906.544230.1089
480.73111.15110.095911881.778990.148231.4666
490.77051.31220.109313614.25121134.520933.6827
500.68731.16290.096913437.48451119.790433.4633



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