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 computationThu, 17 Dec 2009 13:07: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/2009/Dec/17/t1261080504gts3we4w6wypd1q.htm/, Retrieved Tue, 30 Apr 2024 02:34:05 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69083, Retrieved Tue, 30 Apr 2024 02:34:05 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact105
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
-   PD  [ARIMA Forecasting] [Ws10Forecast] [2009-12-10 17:31:39] [e0fc65a5811681d807296d590d5b45de]
- R P       [ARIMA Forecasting] [verbetering WS10] [2009-12-17 20:07:19] [b653746fe14da1ddc21bd75262e8c46b] [Current]
Feedback Forum

Post a new message
Dataseries X:
151.7
121.3
133.0
119.6
122.2
117.4
106.7
87.5
81.0
110.3
87.0
55.7
146.0
137.5
138.5
135.6
107.3
99.0
91.4
68.4
82.6
98.4
71.3
47.6
130.8
113.6
125.7
113.6
97.1
104.4
91.8
75.1
89.2
110.2
78.4
68.4
122.8
129.7
159.1
139.0
102.2
113.6
81.5
77.4
87.6
101.2
87.2
64.9
133.1
118.0
135.9
125.7
108.0
128.3
84.7
86.4
92.2
95.8
92.3
54.3




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 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 & 3 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69083&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]3 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=69083&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69083&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 time3 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])
3668.4-------
37122.8-------
38129.7-------
39159.1-------
40139-------
41102.2-------
42113.6-------
4381.5-------
4477.4-------
4587.6-------
46101.2-------
4787.2-------
4864.9-------
49133.1126.5256108.9104144.14080.232210.66081
50118120.6431102.0905139.19560.390.09410.16931
51135.9150.5599129.7612171.35860.08360.99890.21051
52125.7126.4732104.6757148.27070.47230.19830.131
53108105.442983.4722127.41370.40980.03540.61380.9999
54128.3121.491698.2573144.7260.28290.87250.74721
5584.792.167868.1124116.22320.27140.00160.80760.9868
5686.486.187461.9251110.44980.49310.54780.76110.9573
5792.295.944270.6934121.19510.38570.77060.74140.992
5895.8113.643887.6353139.65240.08940.9470.82580.9999
5992.393.233266.9815119.48490.47220.4240.67380.9828
6054.378.639751.5839105.69560.03890.16120.84020.8402

\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 & 68.4 & - & - & - & - & - & - & - \tabularnewline
37 & 122.8 & - & - & - & - & - & - & - \tabularnewline
38 & 129.7 & - & - & - & - & - & - & - \tabularnewline
39 & 159.1 & - & - & - & - & - & - & - \tabularnewline
40 & 139 & - & - & - & - & - & - & - \tabularnewline
41 & 102.2 & - & - & - & - & - & - & - \tabularnewline
42 & 113.6 & - & - & - & - & - & - & - \tabularnewline
43 & 81.5 & - & - & - & - & - & - & - \tabularnewline
44 & 77.4 & - & - & - & - & - & - & - \tabularnewline
45 & 87.6 & - & - & - & - & - & - & - \tabularnewline
46 & 101.2 & - & - & - & - & - & - & - \tabularnewline
47 & 87.2 & - & - & - & - & - & - & - \tabularnewline
48 & 64.9 & - & - & - & - & - & - & - \tabularnewline
49 & 133.1 & 126.5256 & 108.9104 & 144.1408 & 0.2322 & 1 & 0.6608 & 1 \tabularnewline
50 & 118 & 120.6431 & 102.0905 & 139.1956 & 0.39 & 0.0941 & 0.1693 & 1 \tabularnewline
51 & 135.9 & 150.5599 & 129.7612 & 171.3586 & 0.0836 & 0.9989 & 0.2105 & 1 \tabularnewline
52 & 125.7 & 126.4732 & 104.6757 & 148.2707 & 0.4723 & 0.1983 & 0.13 & 1 \tabularnewline
53 & 108 & 105.4429 & 83.4722 & 127.4137 & 0.4098 & 0.0354 & 0.6138 & 0.9999 \tabularnewline
54 & 128.3 & 121.4916 & 98.2573 & 144.726 & 0.2829 & 0.8725 & 0.7472 & 1 \tabularnewline
55 & 84.7 & 92.1678 & 68.1124 & 116.2232 & 0.2714 & 0.0016 & 0.8076 & 0.9868 \tabularnewline
56 & 86.4 & 86.1874 & 61.9251 & 110.4498 & 0.4931 & 0.5478 & 0.7611 & 0.9573 \tabularnewline
57 & 92.2 & 95.9442 & 70.6934 & 121.1951 & 0.3857 & 0.7706 & 0.7414 & 0.992 \tabularnewline
58 & 95.8 & 113.6438 & 87.6353 & 139.6524 & 0.0894 & 0.947 & 0.8258 & 0.9999 \tabularnewline
59 & 92.3 & 93.2332 & 66.9815 & 119.4849 & 0.4722 & 0.424 & 0.6738 & 0.9828 \tabularnewline
60 & 54.3 & 78.6397 & 51.5839 & 105.6956 & 0.0389 & 0.1612 & 0.8402 & 0.8402 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69083&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]68.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]122.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]129.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]159.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]139[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]102.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]113.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]81.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]77.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]87.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]101.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]87.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]64.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]133.1[/C][C]126.5256[/C][C]108.9104[/C][C]144.1408[/C][C]0.2322[/C][C]1[/C][C]0.6608[/C][C]1[/C][/ROW]
[ROW][C]50[/C][C]118[/C][C]120.6431[/C][C]102.0905[/C][C]139.1956[/C][C]0.39[/C][C]0.0941[/C][C]0.1693[/C][C]1[/C][/ROW]
[ROW][C]51[/C][C]135.9[/C][C]150.5599[/C][C]129.7612[/C][C]171.3586[/C][C]0.0836[/C][C]0.9989[/C][C]0.2105[/C][C]1[/C][/ROW]
[ROW][C]52[/C][C]125.7[/C][C]126.4732[/C][C]104.6757[/C][C]148.2707[/C][C]0.4723[/C][C]0.1983[/C][C]0.13[/C][C]1[/C][/ROW]
[ROW][C]53[/C][C]108[/C][C]105.4429[/C][C]83.4722[/C][C]127.4137[/C][C]0.4098[/C][C]0.0354[/C][C]0.6138[/C][C]0.9999[/C][/ROW]
[ROW][C]54[/C][C]128.3[/C][C]121.4916[/C][C]98.2573[/C][C]144.726[/C][C]0.2829[/C][C]0.8725[/C][C]0.7472[/C][C]1[/C][/ROW]
[ROW][C]55[/C][C]84.7[/C][C]92.1678[/C][C]68.1124[/C][C]116.2232[/C][C]0.2714[/C][C]0.0016[/C][C]0.8076[/C][C]0.9868[/C][/ROW]
[ROW][C]56[/C][C]86.4[/C][C]86.1874[/C][C]61.9251[/C][C]110.4498[/C][C]0.4931[/C][C]0.5478[/C][C]0.7611[/C][C]0.9573[/C][/ROW]
[ROW][C]57[/C][C]92.2[/C][C]95.9442[/C][C]70.6934[/C][C]121.1951[/C][C]0.3857[/C][C]0.7706[/C][C]0.7414[/C][C]0.992[/C][/ROW]
[ROW][C]58[/C][C]95.8[/C][C]113.6438[/C][C]87.6353[/C][C]139.6524[/C][C]0.0894[/C][C]0.947[/C][C]0.8258[/C][C]0.9999[/C][/ROW]
[ROW][C]59[/C][C]92.3[/C][C]93.2332[/C][C]66.9815[/C][C]119.4849[/C][C]0.4722[/C][C]0.424[/C][C]0.6738[/C][C]0.9828[/C][/ROW]
[ROW][C]60[/C][C]54.3[/C][C]78.6397[/C][C]51.5839[/C][C]105.6956[/C][C]0.0389[/C][C]0.1612[/C][C]0.8402[/C][C]0.8402[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69083&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69083&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])
3668.4-------
37122.8-------
38129.7-------
39159.1-------
40139-------
41102.2-------
42113.6-------
4381.5-------
4477.4-------
4587.6-------
46101.2-------
4787.2-------
4864.9-------
49133.1126.5256108.9104144.14080.232210.66081
50118120.6431102.0905139.19560.390.09410.16931
51135.9150.5599129.7612171.35860.08360.99890.21051
52125.7126.4732104.6757148.27070.47230.19830.131
53108105.442983.4722127.41370.40980.03540.61380.9999
54128.3121.491698.2573144.7260.28290.87250.74721
5584.792.167868.1124116.22320.27140.00160.80760.9868
5686.486.187461.9251110.44980.49310.54780.76110.9573
5792.295.944270.6934121.19510.38570.77060.74140.992
5895.8113.643887.6353139.65240.08940.9470.82580.9999
5992.393.233266.9815119.48490.47220.4240.67380.9828
6054.378.639751.5839105.69560.03890.16120.84020.8402







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0710.052043.222700
500.0785-0.02190.03696.985725.10425.0104
510.0705-0.09740.0571214.913688.3749.4007
520.0879-0.00610.04430.597866.438.1505
530.10630.02430.04036.538654.45177.3791
540.09760.0560.042946.353853.1027.2871
550.1332-0.0810.048455.768153.48297.3132
560.14360.00250.04260.045246.80326.8413
570.1343-0.0390.042214.019243.16056.5697
580.1168-0.1570.0537318.402370.68478.4074
590.1437-0.010.04970.870964.3388.0211
600.1755-0.30950.0714592.4232108.345110.4089

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.071 & 0.052 & 0 & 43.2227 & 0 & 0 \tabularnewline
50 & 0.0785 & -0.0219 & 0.0369 & 6.9857 & 25.1042 & 5.0104 \tabularnewline
51 & 0.0705 & -0.0974 & 0.0571 & 214.9136 & 88.374 & 9.4007 \tabularnewline
52 & 0.0879 & -0.0061 & 0.0443 & 0.5978 & 66.43 & 8.1505 \tabularnewline
53 & 0.1063 & 0.0243 & 0.0403 & 6.5386 & 54.4517 & 7.3791 \tabularnewline
54 & 0.0976 & 0.056 & 0.0429 & 46.3538 & 53.102 & 7.2871 \tabularnewline
55 & 0.1332 & -0.081 & 0.0484 & 55.7681 & 53.4829 & 7.3132 \tabularnewline
56 & 0.1436 & 0.0025 & 0.0426 & 0.0452 & 46.8032 & 6.8413 \tabularnewline
57 & 0.1343 & -0.039 & 0.0422 & 14.0192 & 43.1605 & 6.5697 \tabularnewline
58 & 0.1168 & -0.157 & 0.0537 & 318.4023 & 70.6847 & 8.4074 \tabularnewline
59 & 0.1437 & -0.01 & 0.0497 & 0.8709 & 64.338 & 8.0211 \tabularnewline
60 & 0.1755 & -0.3095 & 0.0714 & 592.4232 & 108.3451 & 10.4089 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69083&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.071[/C][C]0.052[/C][C]0[/C][C]43.2227[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0785[/C][C]-0.0219[/C][C]0.0369[/C][C]6.9857[/C][C]25.1042[/C][C]5.0104[/C][/ROW]
[ROW][C]51[/C][C]0.0705[/C][C]-0.0974[/C][C]0.0571[/C][C]214.9136[/C][C]88.374[/C][C]9.4007[/C][/ROW]
[ROW][C]52[/C][C]0.0879[/C][C]-0.0061[/C][C]0.0443[/C][C]0.5978[/C][C]66.43[/C][C]8.1505[/C][/ROW]
[ROW][C]53[/C][C]0.1063[/C][C]0.0243[/C][C]0.0403[/C][C]6.5386[/C][C]54.4517[/C][C]7.3791[/C][/ROW]
[ROW][C]54[/C][C]0.0976[/C][C]0.056[/C][C]0.0429[/C][C]46.3538[/C][C]53.102[/C][C]7.2871[/C][/ROW]
[ROW][C]55[/C][C]0.1332[/C][C]-0.081[/C][C]0.0484[/C][C]55.7681[/C][C]53.4829[/C][C]7.3132[/C][/ROW]
[ROW][C]56[/C][C]0.1436[/C][C]0.0025[/C][C]0.0426[/C][C]0.0452[/C][C]46.8032[/C][C]6.8413[/C][/ROW]
[ROW][C]57[/C][C]0.1343[/C][C]-0.039[/C][C]0.0422[/C][C]14.0192[/C][C]43.1605[/C][C]6.5697[/C][/ROW]
[ROW][C]58[/C][C]0.1168[/C][C]-0.157[/C][C]0.0537[/C][C]318.4023[/C][C]70.6847[/C][C]8.4074[/C][/ROW]
[ROW][C]59[/C][C]0.1437[/C][C]-0.01[/C][C]0.0497[/C][C]0.8709[/C][C]64.338[/C][C]8.0211[/C][/ROW]
[ROW][C]60[/C][C]0.1755[/C][C]-0.3095[/C][C]0.0714[/C][C]592.4232[/C][C]108.3451[/C][C]10.4089[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69083&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69083&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.0710.052043.222700
500.0785-0.02190.03696.985725.10425.0104
510.0705-0.09740.0571214.913688.3749.4007
520.0879-0.00610.04430.597866.438.1505
530.10630.02430.04036.538654.45177.3791
540.09760.0560.042946.353853.1027.2871
550.1332-0.0810.048455.768153.48297.3132
560.14360.00250.04260.045246.80326.8413
570.1343-0.0390.042214.019243.16056.5697
580.1168-0.1570.0537318.402370.68478.4074
590.1437-0.010.04970.870964.3388.0211
600.1755-0.30950.0714592.4232108.345110.4089



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 1 ; 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
par6 <- 3
par7 <- as.numeric(par7) #q
par7 <- 3
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,par1))
(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.mape1 <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- array(0, dim=fx)
perf.mse1 <- 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.se[i] = (x[nx+i] - forecast$pred[i])^2
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[1] = abs(perf.pe[1])
perf.mse[1] = abs(perf.se[1])
for (i in 2:fx) {
perf.mape[i] = perf.mape[i-1] + abs(perf.pe[i])
perf.mape1[i] = perf.mape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
}
perf.rmse = sqrt(perf.mse1)
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:par1] <- 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.mape1[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse1[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')