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, 14 Dec 2010 13:04:06 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/14/t1292331709agf8dnfa77qz0au.htm/, Retrieved Thu, 02 May 2024 23:06:55 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=109547, Retrieved Thu, 02 May 2024 23:06:55 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact147
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [data set] [2008-12-01 19:54:57] [b98453cac15ba1066b407e146608df68]
- RMP   [Standard Deviation-Mean Plot] [Unemployment] [2010-11-29 10:34:47] [b98453cac15ba1066b407e146608df68]
- RMP     [ARIMA Forecasting] [Unemployment] [2010-11-29 20:46:45] [b98453cac15ba1066b407e146608df68]
-   PD      [ARIMA Forecasting] [] [2010-12-03 14:30:36] [8a9a6f7c332640af31ddca253a8ded58]
-   PD          [ARIMA Forecasting] [] [2010-12-14 13:04:06] [5fd8c857995b7937a45335fd5ccccdde] [Current]
Feedback Forum

Post a new message
Dataseries X:
101.76
102.37
102.38
102.86
102.87
102.92
102.95
103.02
104.08
104.16
104.24
104.33
104.73
104.86
105.03
105.62
105.63
105.63
105.94
106.61
107.69
107.78
107.93
108.48
108.14
108.48
108.48
108.89
108.93
109.21
109.47
109.80
111.73
111.85
112.12
112.15
112.17
112.67
112.80
113.44
113.53
114.53
114.51
115.05
116.67
117.07
116.92
117.00
117.02
117.35
117.36
117.82
117.88
118.24
118.50
118.80
119.76
120.09




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24

\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 & 2 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=109547&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]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Sir Ronald Aylmer Fisher' @ 193.190.124.24[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=109547&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=109547&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 time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24







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[46])
34111.85-------
35112.12-------
36112.15-------
37112.17-------
38112.67-------
39112.8-------
40113.44-------
41113.53-------
42114.53-------
43114.51-------
44115.05-------
45116.67-------
46117.07-------
47116.92117.2761116.6701117.8820.12470.747510.7475
48117117.4581116.6012118.31490.14740.890810.8126
49117.02117.4423116.3929118.49180.21510.795610.7566
50117.35117.8645116.6536119.07550.20250.914210.9008
51117.36117.9577116.6043119.3110.19340.810610.9007
52117.82118.5215117.0394120.00370.17680.937710.9725
53117.88118.5832116.9826120.18370.19460.82510.9681
54118.24119.2079117.4971120.91870.13370.935910.9928
55118.5119.303117.4886121.11740.19290.874610.9921
56118.8119.7711117.8587121.68350.15980.903710.9972
57119.76121.3618119.3562123.36730.05870.993911
58120.09121.6292119.5346123.72380.07490.959911

\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[46]) \tabularnewline
34 & 111.85 & - & - & - & - & - & - & - \tabularnewline
35 & 112.12 & - & - & - & - & - & - & - \tabularnewline
36 & 112.15 & - & - & - & - & - & - & - \tabularnewline
37 & 112.17 & - & - & - & - & - & - & - \tabularnewline
38 & 112.67 & - & - & - & - & - & - & - \tabularnewline
39 & 112.8 & - & - & - & - & - & - & - \tabularnewline
40 & 113.44 & - & - & - & - & - & - & - \tabularnewline
41 & 113.53 & - & - & - & - & - & - & - \tabularnewline
42 & 114.53 & - & - & - & - & - & - & - \tabularnewline
43 & 114.51 & - & - & - & - & - & - & - \tabularnewline
44 & 115.05 & - & - & - & - & - & - & - \tabularnewline
45 & 116.67 & - & - & - & - & - & - & - \tabularnewline
46 & 117.07 & - & - & - & - & - & - & - \tabularnewline
47 & 116.92 & 117.2761 & 116.6701 & 117.882 & 0.1247 & 0.7475 & 1 & 0.7475 \tabularnewline
48 & 117 & 117.4581 & 116.6012 & 118.3149 & 0.1474 & 0.8908 & 1 & 0.8126 \tabularnewline
49 & 117.02 & 117.4423 & 116.3929 & 118.4918 & 0.2151 & 0.7956 & 1 & 0.7566 \tabularnewline
50 & 117.35 & 117.8645 & 116.6536 & 119.0755 & 0.2025 & 0.9142 & 1 & 0.9008 \tabularnewline
51 & 117.36 & 117.9577 & 116.6043 & 119.311 & 0.1934 & 0.8106 & 1 & 0.9007 \tabularnewline
52 & 117.82 & 118.5215 & 117.0394 & 120.0037 & 0.1768 & 0.9377 & 1 & 0.9725 \tabularnewline
53 & 117.88 & 118.5832 & 116.9826 & 120.1837 & 0.1946 & 0.825 & 1 & 0.9681 \tabularnewline
54 & 118.24 & 119.2079 & 117.4971 & 120.9187 & 0.1337 & 0.9359 & 1 & 0.9928 \tabularnewline
55 & 118.5 & 119.303 & 117.4886 & 121.1174 & 0.1929 & 0.8746 & 1 & 0.9921 \tabularnewline
56 & 118.8 & 119.7711 & 117.8587 & 121.6835 & 0.1598 & 0.9037 & 1 & 0.9972 \tabularnewline
57 & 119.76 & 121.3618 & 119.3562 & 123.3673 & 0.0587 & 0.9939 & 1 & 1 \tabularnewline
58 & 120.09 & 121.6292 & 119.5346 & 123.7238 & 0.0749 & 0.9599 & 1 & 1 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=109547&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[46])[/C][/ROW]
[ROW][C]34[/C][C]111.85[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]112.12[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]112.15[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]112.17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]112.67[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]112.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]113.44[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]113.53[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]114.53[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]114.51[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]115.05[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]116.67[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]117.07[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]116.92[/C][C]117.2761[/C][C]116.6701[/C][C]117.882[/C][C]0.1247[/C][C]0.7475[/C][C]1[/C][C]0.7475[/C][/ROW]
[ROW][C]48[/C][C]117[/C][C]117.4581[/C][C]116.6012[/C][C]118.3149[/C][C]0.1474[/C][C]0.8908[/C][C]1[/C][C]0.8126[/C][/ROW]
[ROW][C]49[/C][C]117.02[/C][C]117.4423[/C][C]116.3929[/C][C]118.4918[/C][C]0.2151[/C][C]0.7956[/C][C]1[/C][C]0.7566[/C][/ROW]
[ROW][C]50[/C][C]117.35[/C][C]117.8645[/C][C]116.6536[/C][C]119.0755[/C][C]0.2025[/C][C]0.9142[/C][C]1[/C][C]0.9008[/C][/ROW]
[ROW][C]51[/C][C]117.36[/C][C]117.9577[/C][C]116.6043[/C][C]119.311[/C][C]0.1934[/C][C]0.8106[/C][C]1[/C][C]0.9007[/C][/ROW]
[ROW][C]52[/C][C]117.82[/C][C]118.5215[/C][C]117.0394[/C][C]120.0037[/C][C]0.1768[/C][C]0.9377[/C][C]1[/C][C]0.9725[/C][/ROW]
[ROW][C]53[/C][C]117.88[/C][C]118.5832[/C][C]116.9826[/C][C]120.1837[/C][C]0.1946[/C][C]0.825[/C][C]1[/C][C]0.9681[/C][/ROW]
[ROW][C]54[/C][C]118.24[/C][C]119.2079[/C][C]117.4971[/C][C]120.9187[/C][C]0.1337[/C][C]0.9359[/C][C]1[/C][C]0.9928[/C][/ROW]
[ROW][C]55[/C][C]118.5[/C][C]119.303[/C][C]117.4886[/C][C]121.1174[/C][C]0.1929[/C][C]0.8746[/C][C]1[/C][C]0.9921[/C][/ROW]
[ROW][C]56[/C][C]118.8[/C][C]119.7711[/C][C]117.8587[/C][C]121.6835[/C][C]0.1598[/C][C]0.9037[/C][C]1[/C][C]0.9972[/C][/ROW]
[ROW][C]57[/C][C]119.76[/C][C]121.3618[/C][C]119.3562[/C][C]123.3673[/C][C]0.0587[/C][C]0.9939[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]58[/C][C]120.09[/C][C]121.6292[/C][C]119.5346[/C][C]123.7238[/C][C]0.0749[/C][C]0.9599[/C][C]1[/C][C]1[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=109547&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=109547&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[46])
34111.85-------
35112.12-------
36112.15-------
37112.17-------
38112.67-------
39112.8-------
40113.44-------
41113.53-------
42114.53-------
43114.51-------
44115.05-------
45116.67-------
46117.07-------
47116.92117.2761116.6701117.8820.12470.747510.7475
48117117.4581116.6012118.31490.14740.890810.8126
49117.02117.4423116.3929118.49180.21510.795610.7566
50117.35117.8645116.6536119.07550.20250.914210.9008
51117.36117.9577116.6043119.3110.19340.810610.9007
52117.82118.5215117.0394120.00370.17680.937710.9725
53117.88118.5832116.9826120.18370.19460.82510.9681
54118.24119.2079117.4971120.91870.13370.935910.9928
55118.5119.303117.4886121.11740.19290.874610.9921
56118.8119.7711117.8587121.68350.15980.903710.9972
57119.76121.3618119.3562123.36730.05870.993911
58120.09121.6292119.5346123.72380.07490.959911







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
470.0026-0.00300.126800
480.0037-0.00390.00350.20980.16830.4102
490.0046-0.00360.00350.17840.17160.4143
500.0052-0.00440.00370.26470.19490.4415
510.0059-0.00510.0040.35720.22740.4768
520.0064-0.00590.00430.49220.27150.5211
530.0069-0.00590.00450.49440.30340.5508
540.0073-0.00810.0050.93680.38250.6185
550.0078-0.00670.00520.64480.41170.6416
560.0081-0.00810.00550.9430.46480.6818
570.0084-0.01320.00622.56570.65580.8098
580.0088-0.01270.00672.36920.79860.8936

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
47 & 0.0026 & -0.003 & 0 & 0.1268 & 0 & 0 \tabularnewline
48 & 0.0037 & -0.0039 & 0.0035 & 0.2098 & 0.1683 & 0.4102 \tabularnewline
49 & 0.0046 & -0.0036 & 0.0035 & 0.1784 & 0.1716 & 0.4143 \tabularnewline
50 & 0.0052 & -0.0044 & 0.0037 & 0.2647 & 0.1949 & 0.4415 \tabularnewline
51 & 0.0059 & -0.0051 & 0.004 & 0.3572 & 0.2274 & 0.4768 \tabularnewline
52 & 0.0064 & -0.0059 & 0.0043 & 0.4922 & 0.2715 & 0.5211 \tabularnewline
53 & 0.0069 & -0.0059 & 0.0045 & 0.4944 & 0.3034 & 0.5508 \tabularnewline
54 & 0.0073 & -0.0081 & 0.005 & 0.9368 & 0.3825 & 0.6185 \tabularnewline
55 & 0.0078 & -0.0067 & 0.0052 & 0.6448 & 0.4117 & 0.6416 \tabularnewline
56 & 0.0081 & -0.0081 & 0.0055 & 0.943 & 0.4648 & 0.6818 \tabularnewline
57 & 0.0084 & -0.0132 & 0.0062 & 2.5657 & 0.6558 & 0.8098 \tabularnewline
58 & 0.0088 & -0.0127 & 0.0067 & 2.3692 & 0.7986 & 0.8936 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=109547&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]47[/C][C]0.0026[/C][C]-0.003[/C][C]0[/C][C]0.1268[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]48[/C][C]0.0037[/C][C]-0.0039[/C][C]0.0035[/C][C]0.2098[/C][C]0.1683[/C][C]0.4102[/C][/ROW]
[ROW][C]49[/C][C]0.0046[/C][C]-0.0036[/C][C]0.0035[/C][C]0.1784[/C][C]0.1716[/C][C]0.4143[/C][/ROW]
[ROW][C]50[/C][C]0.0052[/C][C]-0.0044[/C][C]0.0037[/C][C]0.2647[/C][C]0.1949[/C][C]0.4415[/C][/ROW]
[ROW][C]51[/C][C]0.0059[/C][C]-0.0051[/C][C]0.004[/C][C]0.3572[/C][C]0.2274[/C][C]0.4768[/C][/ROW]
[ROW][C]52[/C][C]0.0064[/C][C]-0.0059[/C][C]0.0043[/C][C]0.4922[/C][C]0.2715[/C][C]0.5211[/C][/ROW]
[ROW][C]53[/C][C]0.0069[/C][C]-0.0059[/C][C]0.0045[/C][C]0.4944[/C][C]0.3034[/C][C]0.5508[/C][/ROW]
[ROW][C]54[/C][C]0.0073[/C][C]-0.0081[/C][C]0.005[/C][C]0.9368[/C][C]0.3825[/C][C]0.6185[/C][/ROW]
[ROW][C]55[/C][C]0.0078[/C][C]-0.0067[/C][C]0.0052[/C][C]0.6448[/C][C]0.4117[/C][C]0.6416[/C][/ROW]
[ROW][C]56[/C][C]0.0081[/C][C]-0.0081[/C][C]0.0055[/C][C]0.943[/C][C]0.4648[/C][C]0.6818[/C][/ROW]
[ROW][C]57[/C][C]0.0084[/C][C]-0.0132[/C][C]0.0062[/C][C]2.5657[/C][C]0.6558[/C][C]0.8098[/C][/ROW]
[ROW][C]58[/C][C]0.0088[/C][C]-0.0127[/C][C]0.0067[/C][C]2.3692[/C][C]0.7986[/C][C]0.8936[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=109547&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=109547&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
470.0026-0.00300.126800
480.0037-0.00390.00350.20980.16830.4102
490.0046-0.00360.00350.17840.17160.4143
500.0052-0.00440.00370.26470.19490.4415
510.0059-0.00510.0040.35720.22740.4768
520.0064-0.00590.00430.49220.27150.5211
530.0069-0.00590.00450.49440.30340.5508
540.0073-0.00810.0050.93680.38250.6185
550.0078-0.00670.00520.64480.41170.6416
560.0081-0.00810.00550.9430.46480.6818
570.0084-0.01320.00622.56570.65580.8098
580.0088-0.01270.00672.36920.79860.8936



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