Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationSat, 08 Dec 2007 09:22:49 -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/08/t11971302163rj5omb32lypr3x.htm/, Retrieved Sun, 28 Apr 2024 20:59:51 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2938, Retrieved Sun, 28 Apr 2024 20:59:51 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsExtrapolation Forecasts Q1
Estimated Impact208
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Extrapolation For...] [2007-12-08 16:22:49] [0cecb02636bfe8ebd97a7fef80b2b9e7] [Current]
Feedback Forum

Post a new message
Dataseries X:
117
103,8
100,8
110,6
104
112,6
107,3
98,9
109,8
104,9
102,2
123,9
124,9
112,7
121,9
100,6
104,3
120,4
107,5
102,9
125,6
107,5
108,8
128,4
121,1
119,5
128,7
108,7
105,5
119,8
111,3
110,6
120,1
97,5
107,7
127,3
117,2
119,8
116,2
111
112,4
130,6
109,1
118,8
123,9
101,6
112,8
128
129,6
125,8
119,5
115,7
113,6
129,7
112
116,8
127
112,9
113,3
121,7




Summary of compuational 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 compuational 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=2938&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]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=2938&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2938&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 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])
36127.3-------
37117.2-------
38119.8-------
39116.2-------
40111-------
41112.4-------
42130.6-------
43109.1-------
44118.8-------
45123.9-------
46101.6-------
47112.8-------
48128-------
49129.6120.2775106.9638135.24830.11110.1560.65650.156
50125.8122.639108.9764138.01450.34350.18740.64130.2472
51119.5120.4713107.0407135.58710.44990.24480.71020.1645
52115.7112.608499.861126.98310.33670.17370.58680.0179
53113.6113.1904100.2155127.84510.47820.36860.54210.0238
54129.7130.8958115.7719147.99530.44550.97630.51350.63
55112111.169498.2299125.81320.45570.00660.60910.0121
56116.8119.1416105.179134.95780.38580.81190.51690.1362
57127124.988110.253141.69230.40670.83170.55080.3619
58112.9102.244890.1282115.99040.06432e-040.53661e-04
59113.3113.339699.846128.65670.4980.52240.52750.0303
60121.7129.3926113.9248146.96060.19540.96370.56170.5617

\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 & 127.3 & - & - & - & - & - & - & - \tabularnewline
37 & 117.2 & - & - & - & - & - & - & - \tabularnewline
38 & 119.8 & - & - & - & - & - & - & - \tabularnewline
39 & 116.2 & - & - & - & - & - & - & - \tabularnewline
40 & 111 & - & - & - & - & - & - & - \tabularnewline
41 & 112.4 & - & - & - & - & - & - & - \tabularnewline
42 & 130.6 & - & - & - & - & - & - & - \tabularnewline
43 & 109.1 & - & - & - & - & - & - & - \tabularnewline
44 & 118.8 & - & - & - & - & - & - & - \tabularnewline
45 & 123.9 & - & - & - & - & - & - & - \tabularnewline
46 & 101.6 & - & - & - & - & - & - & - \tabularnewline
47 & 112.8 & - & - & - & - & - & - & - \tabularnewline
48 & 128 & - & - & - & - & - & - & - \tabularnewline
49 & 129.6 & 120.2775 & 106.9638 & 135.2483 & 0.1111 & 0.156 & 0.6565 & 0.156 \tabularnewline
50 & 125.8 & 122.639 & 108.9764 & 138.0145 & 0.3435 & 0.1874 & 0.6413 & 0.2472 \tabularnewline
51 & 119.5 & 120.4713 & 107.0407 & 135.5871 & 0.4499 & 0.2448 & 0.7102 & 0.1645 \tabularnewline
52 & 115.7 & 112.6084 & 99.861 & 126.9831 & 0.3367 & 0.1737 & 0.5868 & 0.0179 \tabularnewline
53 & 113.6 & 113.1904 & 100.2155 & 127.8451 & 0.4782 & 0.3686 & 0.5421 & 0.0238 \tabularnewline
54 & 129.7 & 130.8958 & 115.7719 & 147.9953 & 0.4455 & 0.9763 & 0.5135 & 0.63 \tabularnewline
55 & 112 & 111.1694 & 98.2299 & 125.8132 & 0.4557 & 0.0066 & 0.6091 & 0.0121 \tabularnewline
56 & 116.8 & 119.1416 & 105.179 & 134.9578 & 0.3858 & 0.8119 & 0.5169 & 0.1362 \tabularnewline
57 & 127 & 124.988 & 110.253 & 141.6923 & 0.4067 & 0.8317 & 0.5508 & 0.3619 \tabularnewline
58 & 112.9 & 102.2448 & 90.1282 & 115.9904 & 0.0643 & 2e-04 & 0.5366 & 1e-04 \tabularnewline
59 & 113.3 & 113.3396 & 99.846 & 128.6567 & 0.498 & 0.5224 & 0.5275 & 0.0303 \tabularnewline
60 & 121.7 & 129.3926 & 113.9248 & 146.9606 & 0.1954 & 0.9637 & 0.5617 & 0.5617 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2938&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]127.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]117.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]119.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]116.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]111[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]112.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]130.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]109.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]118.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]123.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]101.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]112.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]128[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]129.6[/C][C]120.2775[/C][C]106.9638[/C][C]135.2483[/C][C]0.1111[/C][C]0.156[/C][C]0.6565[/C][C]0.156[/C][/ROW]
[ROW][C]50[/C][C]125.8[/C][C]122.639[/C][C]108.9764[/C][C]138.0145[/C][C]0.3435[/C][C]0.1874[/C][C]0.6413[/C][C]0.2472[/C][/ROW]
[ROW][C]51[/C][C]119.5[/C][C]120.4713[/C][C]107.0407[/C][C]135.5871[/C][C]0.4499[/C][C]0.2448[/C][C]0.7102[/C][C]0.1645[/C][/ROW]
[ROW][C]52[/C][C]115.7[/C][C]112.6084[/C][C]99.861[/C][C]126.9831[/C][C]0.3367[/C][C]0.1737[/C][C]0.5868[/C][C]0.0179[/C][/ROW]
[ROW][C]53[/C][C]113.6[/C][C]113.1904[/C][C]100.2155[/C][C]127.8451[/C][C]0.4782[/C][C]0.3686[/C][C]0.5421[/C][C]0.0238[/C][/ROW]
[ROW][C]54[/C][C]129.7[/C][C]130.8958[/C][C]115.7719[/C][C]147.9953[/C][C]0.4455[/C][C]0.9763[/C][C]0.5135[/C][C]0.63[/C][/ROW]
[ROW][C]55[/C][C]112[/C][C]111.1694[/C][C]98.2299[/C][C]125.8132[/C][C]0.4557[/C][C]0.0066[/C][C]0.6091[/C][C]0.0121[/C][/ROW]
[ROW][C]56[/C][C]116.8[/C][C]119.1416[/C][C]105.179[/C][C]134.9578[/C][C]0.3858[/C][C]0.8119[/C][C]0.5169[/C][C]0.1362[/C][/ROW]
[ROW][C]57[/C][C]127[/C][C]124.988[/C][C]110.253[/C][C]141.6923[/C][C]0.4067[/C][C]0.8317[/C][C]0.5508[/C][C]0.3619[/C][/ROW]
[ROW][C]58[/C][C]112.9[/C][C]102.2448[/C][C]90.1282[/C][C]115.9904[/C][C]0.0643[/C][C]2e-04[/C][C]0.5366[/C][C]1e-04[/C][/ROW]
[ROW][C]59[/C][C]113.3[/C][C]113.3396[/C][C]99.846[/C][C]128.6567[/C][C]0.498[/C][C]0.5224[/C][C]0.5275[/C][C]0.0303[/C][/ROW]
[ROW][C]60[/C][C]121.7[/C][C]129.3926[/C][C]113.9248[/C][C]146.9606[/C][C]0.1954[/C][C]0.9637[/C][C]0.5617[/C][C]0.5617[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2938&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2938&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])
36127.3-------
37117.2-------
38119.8-------
39116.2-------
40111-------
41112.4-------
42130.6-------
43109.1-------
44118.8-------
45123.9-------
46101.6-------
47112.8-------
48128-------
49129.6120.2775106.9638135.24830.11110.1560.65650.156
50125.8122.639108.9764138.01450.34350.18740.64130.2472
51119.5120.4713107.0407135.58710.44990.24480.71020.1645
52115.7112.608499.861126.98310.33670.17370.58680.0179
53113.6113.1904100.2155127.84510.47820.36860.54210.0238
54129.7130.8958115.7719147.99530.44550.97630.51350.63
55112111.169498.2299125.81320.45570.00660.60910.0121
56116.8119.1416105.179134.95780.38580.81190.51690.1362
57127124.988110.253141.69230.40670.83170.55080.3619
58112.9102.244890.1282115.99040.06432e-040.53661e-04
59113.3113.339699.846128.65670.4980.52240.52750.0303
60121.7129.3926113.9248146.96060.19540.96370.56170.5617







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.06350.07750.006586.90997.24252.6912
500.0640.02580.00219.9920.83270.9125
510.064-0.00817e-040.94340.07860.2804
520.06510.02750.00239.55770.79650.8925
530.06610.00363e-040.16780.0140.1182
540.0667-0.00918e-041.42980.11920.3452
550.06720.00756e-040.690.05750.2398
560.0677-0.01970.00165.48320.45690.676
570.06820.01610.00134.0480.33730.5808
580.06860.10420.0087113.53289.46113.0759
590.069-3e-0400.00161e-040.0114
600.0693-0.05950.00559.17664.93142.2207

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0635 & 0.0775 & 0.0065 & 86.9099 & 7.2425 & 2.6912 \tabularnewline
50 & 0.064 & 0.0258 & 0.0021 & 9.992 & 0.8327 & 0.9125 \tabularnewline
51 & 0.064 & -0.0081 & 7e-04 & 0.9434 & 0.0786 & 0.2804 \tabularnewline
52 & 0.0651 & 0.0275 & 0.0023 & 9.5577 & 0.7965 & 0.8925 \tabularnewline
53 & 0.0661 & 0.0036 & 3e-04 & 0.1678 & 0.014 & 0.1182 \tabularnewline
54 & 0.0667 & -0.0091 & 8e-04 & 1.4298 & 0.1192 & 0.3452 \tabularnewline
55 & 0.0672 & 0.0075 & 6e-04 & 0.69 & 0.0575 & 0.2398 \tabularnewline
56 & 0.0677 & -0.0197 & 0.0016 & 5.4832 & 0.4569 & 0.676 \tabularnewline
57 & 0.0682 & 0.0161 & 0.0013 & 4.048 & 0.3373 & 0.5808 \tabularnewline
58 & 0.0686 & 0.1042 & 0.0087 & 113.5328 & 9.4611 & 3.0759 \tabularnewline
59 & 0.069 & -3e-04 & 0 & 0.0016 & 1e-04 & 0.0114 \tabularnewline
60 & 0.0693 & -0.0595 & 0.005 & 59.1766 & 4.9314 & 2.2207 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2938&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.0635[/C][C]0.0775[/C][C]0.0065[/C][C]86.9099[/C][C]7.2425[/C][C]2.6912[/C][/ROW]
[ROW][C]50[/C][C]0.064[/C][C]0.0258[/C][C]0.0021[/C][C]9.992[/C][C]0.8327[/C][C]0.9125[/C][/ROW]
[ROW][C]51[/C][C]0.064[/C][C]-0.0081[/C][C]7e-04[/C][C]0.9434[/C][C]0.0786[/C][C]0.2804[/C][/ROW]
[ROW][C]52[/C][C]0.0651[/C][C]0.0275[/C][C]0.0023[/C][C]9.5577[/C][C]0.7965[/C][C]0.8925[/C][/ROW]
[ROW][C]53[/C][C]0.0661[/C][C]0.0036[/C][C]3e-04[/C][C]0.1678[/C][C]0.014[/C][C]0.1182[/C][/ROW]
[ROW][C]54[/C][C]0.0667[/C][C]-0.0091[/C][C]8e-04[/C][C]1.4298[/C][C]0.1192[/C][C]0.3452[/C][/ROW]
[ROW][C]55[/C][C]0.0672[/C][C]0.0075[/C][C]6e-04[/C][C]0.69[/C][C]0.0575[/C][C]0.2398[/C][/ROW]
[ROW][C]56[/C][C]0.0677[/C][C]-0.0197[/C][C]0.0016[/C][C]5.4832[/C][C]0.4569[/C][C]0.676[/C][/ROW]
[ROW][C]57[/C][C]0.0682[/C][C]0.0161[/C][C]0.0013[/C][C]4.048[/C][C]0.3373[/C][C]0.5808[/C][/ROW]
[ROW][C]58[/C][C]0.0686[/C][C]0.1042[/C][C]0.0087[/C][C]113.5328[/C][C]9.4611[/C][C]3.0759[/C][/ROW]
[ROW][C]59[/C][C]0.069[/C][C]-3e-04[/C][C]0[/C][C]0.0016[/C][C]1e-04[/C][C]0.0114[/C][/ROW]
[ROW][C]60[/C][C]0.0693[/C][C]-0.0595[/C][C]0.005[/C][C]59.1766[/C][C]4.9314[/C][C]2.2207[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2938&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2938&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.06350.07750.006586.90997.24252.6912
500.0640.02580.00219.9920.83270.9125
510.064-0.00817e-040.94340.07860.2804
520.06510.02750.00239.55770.79650.8925
530.06610.00363e-040.16780.0140.1182
540.0667-0.00918e-041.42980.11920.3452
550.06720.00756e-040.690.05750.2398
560.0677-0.01970.00165.48320.45690.676
570.06820.01610.00134.0480.33730.5808
580.06860.10420.0087113.53289.46113.0759
590.069-3e-0400.00161e-040.0114
600.0693-0.05950.00559.17664.93142.2207



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