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 computationFri, 11 Dec 2009 16:00:39 -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/12/t1260572612otj4gxysne3loor.htm/, Retrieved Mon, 29 Apr 2024 09:53:31 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=66829, Retrieved Mon, 29 Apr 2024 09:53:31 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact182
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Bivariate Granger Causality] [] [2009-12-07 09:26:51] [b98453cac15ba1066b407e146608df68]
-    D  [Bivariate Granger Causality] [Shw10: p =26] [2009-12-10 17:08:41] [3c8b83428ce260cd44df892bb7619588]
-         [Bivariate Granger Causality] [Shw10: p =26] [2009-12-10 18:07:32] [1433a524809eda02c3198b3ae6eebb69]
- RMPD        [ARIMA Forecasting] [] [2009-12-11 23:00:39] [71596e6a53ccce532e52aaf6113616ef] [Current]
Feedback Forum

Post a new message
Dataseries X:
85,9
76,8
96,2
83,9
88,7
105,4
86,7
76,3
93,2
105,1
121
163
94,7
78,4
101,4
91,2
89,9
112,2
81,5
78,8
99,1
101,3
91,5
152,6
86,6
86,6
98,5
86,7
89,1
111
92,6
85,1
116,1
98,3
97,7
177,9
94,2
83,8
109,5
102,3
102,5
162,7
85,3
88,2
104,7
99,4
113,8
166,6
89,2
93,2
115
97,2
112,5
121,8
100,2
93,8
113,6
110,7
127,6
185,9




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66829&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[48])
36177.9-------
3794.2-------
3883.8-------
39109.5-------
40102.3-------
41102.5-------
42162.7-------
4385.3-------
4488.2-------
45104.7-------
4699.4-------
47113.8-------
48166.6-------
4989.299.117475.8024122.43230.202200.66030
5093.290.679867.0963114.26330.4170.54890.71630
51115111.719987.871135.56890.39370.9360.57240
5297.2102.338678.2271126.45020.33810.15170.50130
53112.5103.367678.9963127.73890.23130.69010.52780
54121.8143.3608118.7325167.98920.04310.9930.06190.0322
55100.294.469769.587119.35240.32590.01570.76490
5693.892.430667.2961117.56510.45750.27230.62930
57113.6113.321887.938138.70560.49140.93410.74720
58110.7107.683482.0527133.31410.40880.32550.73680
59127.6114.702488.8272140.57760.16430.61910.52720
60185.9174.7614148.644200.87890.20160.99980.72990.7299

\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 & 177.9 & - & - & - & - & - & - & - \tabularnewline
37 & 94.2 & - & - & - & - & - & - & - \tabularnewline
38 & 83.8 & - & - & - & - & - & - & - \tabularnewline
39 & 109.5 & - & - & - & - & - & - & - \tabularnewline
40 & 102.3 & - & - & - & - & - & - & - \tabularnewline
41 & 102.5 & - & - & - & - & - & - & - \tabularnewline
42 & 162.7 & - & - & - & - & - & - & - \tabularnewline
43 & 85.3 & - & - & - & - & - & - & - \tabularnewline
44 & 88.2 & - & - & - & - & - & - & - \tabularnewline
45 & 104.7 & - & - & - & - & - & - & - \tabularnewline
46 & 99.4 & - & - & - & - & - & - & - \tabularnewline
47 & 113.8 & - & - & - & - & - & - & - \tabularnewline
48 & 166.6 & - & - & - & - & - & - & - \tabularnewline
49 & 89.2 & 99.1174 & 75.8024 & 122.4323 & 0.2022 & 0 & 0.6603 & 0 \tabularnewline
50 & 93.2 & 90.6798 & 67.0963 & 114.2633 & 0.417 & 0.5489 & 0.7163 & 0 \tabularnewline
51 & 115 & 111.7199 & 87.871 & 135.5689 & 0.3937 & 0.936 & 0.5724 & 0 \tabularnewline
52 & 97.2 & 102.3386 & 78.2271 & 126.4502 & 0.3381 & 0.1517 & 0.5013 & 0 \tabularnewline
53 & 112.5 & 103.3676 & 78.9963 & 127.7389 & 0.2313 & 0.6901 & 0.5278 & 0 \tabularnewline
54 & 121.8 & 143.3608 & 118.7325 & 167.9892 & 0.0431 & 0.993 & 0.0619 & 0.0322 \tabularnewline
55 & 100.2 & 94.4697 & 69.587 & 119.3524 & 0.3259 & 0.0157 & 0.7649 & 0 \tabularnewline
56 & 93.8 & 92.4306 & 67.2961 & 117.5651 & 0.4575 & 0.2723 & 0.6293 & 0 \tabularnewline
57 & 113.6 & 113.3218 & 87.938 & 138.7056 & 0.4914 & 0.9341 & 0.7472 & 0 \tabularnewline
58 & 110.7 & 107.6834 & 82.0527 & 133.3141 & 0.4088 & 0.3255 & 0.7368 & 0 \tabularnewline
59 & 127.6 & 114.7024 & 88.8272 & 140.5776 & 0.1643 & 0.6191 & 0.5272 & 0 \tabularnewline
60 & 185.9 & 174.7614 & 148.644 & 200.8789 & 0.2016 & 0.9998 & 0.7299 & 0.7299 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66829&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]177.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]94.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]83.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]109.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]102.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]102.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]162.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]85.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]88.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]104.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]99.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]113.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]166.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]89.2[/C][C]99.1174[/C][C]75.8024[/C][C]122.4323[/C][C]0.2022[/C][C]0[/C][C]0.6603[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]93.2[/C][C]90.6798[/C][C]67.0963[/C][C]114.2633[/C][C]0.417[/C][C]0.5489[/C][C]0.7163[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]115[/C][C]111.7199[/C][C]87.871[/C][C]135.5689[/C][C]0.3937[/C][C]0.936[/C][C]0.5724[/C][C]0[/C][/ROW]
[ROW][C]52[/C][C]97.2[/C][C]102.3386[/C][C]78.2271[/C][C]126.4502[/C][C]0.3381[/C][C]0.1517[/C][C]0.5013[/C][C]0[/C][/ROW]
[ROW][C]53[/C][C]112.5[/C][C]103.3676[/C][C]78.9963[/C][C]127.7389[/C][C]0.2313[/C][C]0.6901[/C][C]0.5278[/C][C]0[/C][/ROW]
[ROW][C]54[/C][C]121.8[/C][C]143.3608[/C][C]118.7325[/C][C]167.9892[/C][C]0.0431[/C][C]0.993[/C][C]0.0619[/C][C]0.0322[/C][/ROW]
[ROW][C]55[/C][C]100.2[/C][C]94.4697[/C][C]69.587[/C][C]119.3524[/C][C]0.3259[/C][C]0.0157[/C][C]0.7649[/C][C]0[/C][/ROW]
[ROW][C]56[/C][C]93.8[/C][C]92.4306[/C][C]67.2961[/C][C]117.5651[/C][C]0.4575[/C][C]0.2723[/C][C]0.6293[/C][C]0[/C][/ROW]
[ROW][C]57[/C][C]113.6[/C][C]113.3218[/C][C]87.938[/C][C]138.7056[/C][C]0.4914[/C][C]0.9341[/C][C]0.7472[/C][C]0[/C][/ROW]
[ROW][C]58[/C][C]110.7[/C][C]107.6834[/C][C]82.0527[/C][C]133.3141[/C][C]0.4088[/C][C]0.3255[/C][C]0.7368[/C][C]0[/C][/ROW]
[ROW][C]59[/C][C]127.6[/C][C]114.7024[/C][C]88.8272[/C][C]140.5776[/C][C]0.1643[/C][C]0.6191[/C][C]0.5272[/C][C]0[/C][/ROW]
[ROW][C]60[/C][C]185.9[/C][C]174.7614[/C][C]148.644[/C][C]200.8789[/C][C]0.2016[/C][C]0.9998[/C][C]0.7299[/C][C]0.7299[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66829&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66829&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])
36177.9-------
3794.2-------
3883.8-------
39109.5-------
40102.3-------
41102.5-------
42162.7-------
4385.3-------
4488.2-------
45104.7-------
4699.4-------
47113.8-------
48166.6-------
4989.299.117475.8024122.43230.202200.66030
5093.290.679867.0963114.26330.4170.54890.71630
51115111.719987.871135.56890.39370.9360.57240
5297.2102.338678.2271126.45020.33810.15170.50130
53112.5103.367678.9963127.73890.23130.69010.52780
54121.8143.3608118.7325167.98920.04310.9930.06190.0322
55100.294.469769.587119.35240.32590.01570.76490
5693.892.430667.2961117.56510.45750.27230.62930
57113.6113.321887.938138.70560.49140.93410.74720
58110.7107.683482.0527133.31410.40880.32550.73680
59127.6114.702488.8272140.57760.16430.61910.52720
60185.9174.7614148.644200.87890.20160.99980.72990.7299







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.12-0.1001098.354500
500.13270.02780.06396.351552.3537.2355
510.10890.02940.052410.758838.48836.2039
520.1202-0.05020.051926.405735.46765.9555
530.12030.08830.059283.40145.05436.7123
540.0876-0.15040.0744464.8685115.023310.7249
550.13440.06070.072432.8362103.282310.1628
560.13870.01480.06521.875290.60649.5187
570.11430.00250.05820.077480.54778.9748
580.12140.0280.05529.173.40298.5675
590.11510.11240.0604166.34881.85249.0472
600.07620.06370.0607124.067685.37049.2396

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.12 & -0.1001 & 0 & 98.3545 & 0 & 0 \tabularnewline
50 & 0.1327 & 0.0278 & 0.0639 & 6.3515 & 52.353 & 7.2355 \tabularnewline
51 & 0.1089 & 0.0294 & 0.0524 & 10.7588 & 38.4883 & 6.2039 \tabularnewline
52 & 0.1202 & -0.0502 & 0.0519 & 26.4057 & 35.4676 & 5.9555 \tabularnewline
53 & 0.1203 & 0.0883 & 0.0592 & 83.401 & 45.0543 & 6.7123 \tabularnewline
54 & 0.0876 & -0.1504 & 0.0744 & 464.8685 & 115.0233 & 10.7249 \tabularnewline
55 & 0.1344 & 0.0607 & 0.0724 & 32.8362 & 103.2823 & 10.1628 \tabularnewline
56 & 0.1387 & 0.0148 & 0.0652 & 1.8752 & 90.6064 & 9.5187 \tabularnewline
57 & 0.1143 & 0.0025 & 0.0582 & 0.0774 & 80.5477 & 8.9748 \tabularnewline
58 & 0.1214 & 0.028 & 0.0552 & 9.1 & 73.4029 & 8.5675 \tabularnewline
59 & 0.1151 & 0.1124 & 0.0604 & 166.348 & 81.8524 & 9.0472 \tabularnewline
60 & 0.0762 & 0.0637 & 0.0607 & 124.0676 & 85.3704 & 9.2396 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66829&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.12[/C][C]-0.1001[/C][C]0[/C][C]98.3545[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.1327[/C][C]0.0278[/C][C]0.0639[/C][C]6.3515[/C][C]52.353[/C][C]7.2355[/C][/ROW]
[ROW][C]51[/C][C]0.1089[/C][C]0.0294[/C][C]0.0524[/C][C]10.7588[/C][C]38.4883[/C][C]6.2039[/C][/ROW]
[ROW][C]52[/C][C]0.1202[/C][C]-0.0502[/C][C]0.0519[/C][C]26.4057[/C][C]35.4676[/C][C]5.9555[/C][/ROW]
[ROW][C]53[/C][C]0.1203[/C][C]0.0883[/C][C]0.0592[/C][C]83.401[/C][C]45.0543[/C][C]6.7123[/C][/ROW]
[ROW][C]54[/C][C]0.0876[/C][C]-0.1504[/C][C]0.0744[/C][C]464.8685[/C][C]115.0233[/C][C]10.7249[/C][/ROW]
[ROW][C]55[/C][C]0.1344[/C][C]0.0607[/C][C]0.0724[/C][C]32.8362[/C][C]103.2823[/C][C]10.1628[/C][/ROW]
[ROW][C]56[/C][C]0.1387[/C][C]0.0148[/C][C]0.0652[/C][C]1.8752[/C][C]90.6064[/C][C]9.5187[/C][/ROW]
[ROW][C]57[/C][C]0.1143[/C][C]0.0025[/C][C]0.0582[/C][C]0.0774[/C][C]80.5477[/C][C]8.9748[/C][/ROW]
[ROW][C]58[/C][C]0.1214[/C][C]0.028[/C][C]0.0552[/C][C]9.1[/C][C]73.4029[/C][C]8.5675[/C][/ROW]
[ROW][C]59[/C][C]0.1151[/C][C]0.1124[/C][C]0.0604[/C][C]166.348[/C][C]81.8524[/C][C]9.0472[/C][/ROW]
[ROW][C]60[/C][C]0.0762[/C][C]0.0637[/C][C]0.0607[/C][C]124.0676[/C][C]85.3704[/C][C]9.2396[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66829&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66829&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.12-0.1001098.354500
500.13270.02780.06396.351552.3537.2355
510.10890.02940.052410.758838.48836.2039
520.1202-0.05020.051926.405735.46765.9555
530.12030.08830.059283.40145.05436.7123
540.0876-0.15040.0744464.8685115.023310.7249
550.13440.06070.072432.8362103.282310.1628
560.13870.01480.06521.875290.60649.5187
570.11430.00250.05820.077480.54778.9748
580.12140.0280.05529.173.40298.5675
590.11510.11240.0604166.34881.85249.0472
600.07620.06370.0607124.067685.37049.2396



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