Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 07 Dec 2007 09:06:57 -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/07/t11970428222iqw59otue4jw2e.htm/, Retrieved Mon, 29 Apr 2024 07:18:34 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2877, Retrieved Mon, 29 Apr 2024 07:18:34 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact191
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Arima Forecasting...] [2007-12-07 16:06:57] [ca5e0f9f346e091f4d0fe7e17f7dba21] [Current]
Feedback Forum

Post a new message
Dataseries X:
101,5
126,6
93,9
89,8
93,4
101,5
110,4
105,9
108,4
113,9
86,1
69,4
101,2
100,5
98
106,6
90,1
96,9
125,9
112
100
123,9
79,8
83,4
113,6
112,9
104
109,9
99
106,3
128,9
111,1
102,9
130
87
87,5
117,6
103,4
110,8
112,6
102,5
112,4
135,6
105,1
127,7
137
91
90,5
122,4
123,3
124,3
120
118,1
119
142,7
123,6
129,6
146,9
108,7
99,4




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\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 & 3 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2877&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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2877&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2877&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 time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







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])
3687.5-------
37117.6-------
38103.4-------
39110.8-------
40112.6-------
41102.5-------
42112.4-------
43135.6-------
44105.1-------
45127.7-------
46137-------
4791-------
4890.5-------
49122.4126.1969112.3745138.64820.27510.9121
50123.3117.2509102.052130.69410.18890.22640.97831
51124.3113.800997.849127.77670.07050.09140.66310.9995
52120119.3248103.1006133.5930.46310.24720.82221
53118.1109.928491.8322125.44060.15090.10160.8260.993
54119116.648199.7776131.36960.37710.42340.71420.9998
55142.7138.4997124.4642151.23820.25910.99870.67231
56123.6115.95898.5425131.07960.1613e-040.92030.9995
57129.6122.9765106.6634137.36580.18350.46620.261
58146.9139.4897125.2709152.38750.13010.93360.64741
59108.797.798175.9683115.57580.114700.77320.7895
6099.497.634775.6363115.51720.42330.11260.78290.7829

\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 & 87.5 & - & - & - & - & - & - & - \tabularnewline
37 & 117.6 & - & - & - & - & - & - & - \tabularnewline
38 & 103.4 & - & - & - & - & - & - & - \tabularnewline
39 & 110.8 & - & - & - & - & - & - & - \tabularnewline
40 & 112.6 & - & - & - & - & - & - & - \tabularnewline
41 & 102.5 & - & - & - & - & - & - & - \tabularnewline
42 & 112.4 & - & - & - & - & - & - & - \tabularnewline
43 & 135.6 & - & - & - & - & - & - & - \tabularnewline
44 & 105.1 & - & - & - & - & - & - & - \tabularnewline
45 & 127.7 & - & - & - & - & - & - & - \tabularnewline
46 & 137 & - & - & - & - & - & - & - \tabularnewline
47 & 91 & - & - & - & - & - & - & - \tabularnewline
48 & 90.5 & - & - & - & - & - & - & - \tabularnewline
49 & 122.4 & 126.1969 & 112.3745 & 138.6482 & 0.275 & 1 & 0.912 & 1 \tabularnewline
50 & 123.3 & 117.2509 & 102.052 & 130.6941 & 0.1889 & 0.2264 & 0.9783 & 1 \tabularnewline
51 & 124.3 & 113.8009 & 97.849 & 127.7767 & 0.0705 & 0.0914 & 0.6631 & 0.9995 \tabularnewline
52 & 120 & 119.3248 & 103.1006 & 133.593 & 0.4631 & 0.2472 & 0.8222 & 1 \tabularnewline
53 & 118.1 & 109.9284 & 91.8322 & 125.4406 & 0.1509 & 0.1016 & 0.826 & 0.993 \tabularnewline
54 & 119 & 116.6481 & 99.7776 & 131.3696 & 0.3771 & 0.4234 & 0.7142 & 0.9998 \tabularnewline
55 & 142.7 & 138.4997 & 124.4642 & 151.2382 & 0.2591 & 0.9987 & 0.6723 & 1 \tabularnewline
56 & 123.6 & 115.958 & 98.5425 & 131.0796 & 0.161 & 3e-04 & 0.9203 & 0.9995 \tabularnewline
57 & 129.6 & 122.9765 & 106.6634 & 137.3658 & 0.1835 & 0.4662 & 0.26 & 1 \tabularnewline
58 & 146.9 & 139.4897 & 125.2709 & 152.3875 & 0.1301 & 0.9336 & 0.6474 & 1 \tabularnewline
59 & 108.7 & 97.7981 & 75.9683 & 115.5758 & 0.1147 & 0 & 0.7732 & 0.7895 \tabularnewline
60 & 99.4 & 97.6347 & 75.6363 & 115.5172 & 0.4233 & 0.1126 & 0.7829 & 0.7829 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2877&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]87.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]117.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]103.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]110.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]112.6[/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]112.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]135.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]105.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]127.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]137[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]91[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]90.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]122.4[/C][C]126.1969[/C][C]112.3745[/C][C]138.6482[/C][C]0.275[/C][C]1[/C][C]0.912[/C][C]1[/C][/ROW]
[ROW][C]50[/C][C]123.3[/C][C]117.2509[/C][C]102.052[/C][C]130.6941[/C][C]0.1889[/C][C]0.2264[/C][C]0.9783[/C][C]1[/C][/ROW]
[ROW][C]51[/C][C]124.3[/C][C]113.8009[/C][C]97.849[/C][C]127.7767[/C][C]0.0705[/C][C]0.0914[/C][C]0.6631[/C][C]0.9995[/C][/ROW]
[ROW][C]52[/C][C]120[/C][C]119.3248[/C][C]103.1006[/C][C]133.593[/C][C]0.4631[/C][C]0.2472[/C][C]0.8222[/C][C]1[/C][/ROW]
[ROW][C]53[/C][C]118.1[/C][C]109.9284[/C][C]91.8322[/C][C]125.4406[/C][C]0.1509[/C][C]0.1016[/C][C]0.826[/C][C]0.993[/C][/ROW]
[ROW][C]54[/C][C]119[/C][C]116.6481[/C][C]99.7776[/C][C]131.3696[/C][C]0.3771[/C][C]0.4234[/C][C]0.7142[/C][C]0.9998[/C][/ROW]
[ROW][C]55[/C][C]142.7[/C][C]138.4997[/C][C]124.4642[/C][C]151.2382[/C][C]0.2591[/C][C]0.9987[/C][C]0.6723[/C][C]1[/C][/ROW]
[ROW][C]56[/C][C]123.6[/C][C]115.958[/C][C]98.5425[/C][C]131.0796[/C][C]0.161[/C][C]3e-04[/C][C]0.9203[/C][C]0.9995[/C][/ROW]
[ROW][C]57[/C][C]129.6[/C][C]122.9765[/C][C]106.6634[/C][C]137.3658[/C][C]0.1835[/C][C]0.4662[/C][C]0.26[/C][C]1[/C][/ROW]
[ROW][C]58[/C][C]146.9[/C][C]139.4897[/C][C]125.2709[/C][C]152.3875[/C][C]0.1301[/C][C]0.9336[/C][C]0.6474[/C][C]1[/C][/ROW]
[ROW][C]59[/C][C]108.7[/C][C]97.7981[/C][C]75.9683[/C][C]115.5758[/C][C]0.1147[/C][C]0[/C][C]0.7732[/C][C]0.7895[/C][/ROW]
[ROW][C]60[/C][C]99.4[/C][C]97.6347[/C][C]75.6363[/C][C]115.5172[/C][C]0.4233[/C][C]0.1126[/C][C]0.7829[/C][C]0.7829[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2877&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2877&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])
3687.5-------
37117.6-------
38103.4-------
39110.8-------
40112.6-------
41102.5-------
42112.4-------
43135.6-------
44105.1-------
45127.7-------
46137-------
4791-------
4890.5-------
49122.4126.1969112.3745138.64820.27510.9121
50123.3117.2509102.052130.69410.18890.22640.97831
51124.3113.800997.849127.77670.07050.09140.66310.9995
52120119.3248103.1006133.5930.46310.24720.82221
53118.1109.928491.8322125.44060.15090.10160.8260.993
54119116.648199.7776131.36960.37710.42340.71420.9998
55142.7138.4997124.4642151.23820.25910.99870.67231
56123.6115.95898.5425131.07960.1613e-040.92030.9995
57129.6122.9765106.6634137.36580.18350.46620.261
58146.9139.4897125.2709152.38750.13010.93360.64741
59108.797.798175.9683115.57580.114700.77320.7895
6099.497.634775.6363115.51720.42330.11260.78290.7829







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0503-0.03010.002514.41681.20141.0961
500.05850.05160.004336.59173.04931.7462
510.06270.09230.0077110.23049.18593.0308
520.0610.00575e-040.45590.0380.1949
530.0720.07430.006266.77495.56462.3589
540.06440.02020.00175.53150.4610.6789
550.04690.03030.002517.64241.47021.2125
560.06650.06590.005558.40094.86672.2061
570.05970.05390.004543.87083.65591.912
580.04720.05310.004454.91244.5762.1392
590.09270.11150.0093118.85089.90423.1471
600.09340.01810.00153.11630.25970.5096

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0503 & -0.0301 & 0.0025 & 14.4168 & 1.2014 & 1.0961 \tabularnewline
50 & 0.0585 & 0.0516 & 0.0043 & 36.5917 & 3.0493 & 1.7462 \tabularnewline
51 & 0.0627 & 0.0923 & 0.0077 & 110.2304 & 9.1859 & 3.0308 \tabularnewline
52 & 0.061 & 0.0057 & 5e-04 & 0.4559 & 0.038 & 0.1949 \tabularnewline
53 & 0.072 & 0.0743 & 0.0062 & 66.7749 & 5.5646 & 2.3589 \tabularnewline
54 & 0.0644 & 0.0202 & 0.0017 & 5.5315 & 0.461 & 0.6789 \tabularnewline
55 & 0.0469 & 0.0303 & 0.0025 & 17.6424 & 1.4702 & 1.2125 \tabularnewline
56 & 0.0665 & 0.0659 & 0.0055 & 58.4009 & 4.8667 & 2.2061 \tabularnewline
57 & 0.0597 & 0.0539 & 0.0045 & 43.8708 & 3.6559 & 1.912 \tabularnewline
58 & 0.0472 & 0.0531 & 0.0044 & 54.9124 & 4.576 & 2.1392 \tabularnewline
59 & 0.0927 & 0.1115 & 0.0093 & 118.8508 & 9.9042 & 3.1471 \tabularnewline
60 & 0.0934 & 0.0181 & 0.0015 & 3.1163 & 0.2597 & 0.5096 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2877&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.0503[/C][C]-0.0301[/C][C]0.0025[/C][C]14.4168[/C][C]1.2014[/C][C]1.0961[/C][/ROW]
[ROW][C]50[/C][C]0.0585[/C][C]0.0516[/C][C]0.0043[/C][C]36.5917[/C][C]3.0493[/C][C]1.7462[/C][/ROW]
[ROW][C]51[/C][C]0.0627[/C][C]0.0923[/C][C]0.0077[/C][C]110.2304[/C][C]9.1859[/C][C]3.0308[/C][/ROW]
[ROW][C]52[/C][C]0.061[/C][C]0.0057[/C][C]5e-04[/C][C]0.4559[/C][C]0.038[/C][C]0.1949[/C][/ROW]
[ROW][C]53[/C][C]0.072[/C][C]0.0743[/C][C]0.0062[/C][C]66.7749[/C][C]5.5646[/C][C]2.3589[/C][/ROW]
[ROW][C]54[/C][C]0.0644[/C][C]0.0202[/C][C]0.0017[/C][C]5.5315[/C][C]0.461[/C][C]0.6789[/C][/ROW]
[ROW][C]55[/C][C]0.0469[/C][C]0.0303[/C][C]0.0025[/C][C]17.6424[/C][C]1.4702[/C][C]1.2125[/C][/ROW]
[ROW][C]56[/C][C]0.0665[/C][C]0.0659[/C][C]0.0055[/C][C]58.4009[/C][C]4.8667[/C][C]2.2061[/C][/ROW]
[ROW][C]57[/C][C]0.0597[/C][C]0.0539[/C][C]0.0045[/C][C]43.8708[/C][C]3.6559[/C][C]1.912[/C][/ROW]
[ROW][C]58[/C][C]0.0472[/C][C]0.0531[/C][C]0.0044[/C][C]54.9124[/C][C]4.576[/C][C]2.1392[/C][/ROW]
[ROW][C]59[/C][C]0.0927[/C][C]0.1115[/C][C]0.0093[/C][C]118.8508[/C][C]9.9042[/C][C]3.1471[/C][/ROW]
[ROW][C]60[/C][C]0.0934[/C][C]0.0181[/C][C]0.0015[/C][C]3.1163[/C][C]0.2597[/C][C]0.5096[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2877&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2877&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.0503-0.03010.002514.41681.20141.0961
500.05850.05160.004336.59173.04931.7462
510.06270.09230.0077110.23049.18593.0308
520.0610.00575e-040.45590.0380.1949
530.0720.07430.006266.77495.56462.3589
540.06440.02020.00175.53150.4610.6789
550.04690.03030.002517.64241.47021.2125
560.06650.06590.005558.40094.86672.2061
570.05970.05390.004543.87083.65591.912
580.04720.05310.004454.91244.5762.1392
590.09270.11150.0093118.85089.90423.1471
600.09340.01810.00153.11630.25970.5096



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