Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 24 Dec 2008 03:32:53 -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/2008/Dec/24/t1230114799iz2magvfvmc427l.htm/, Retrieved Fri, 17 May 2024 03:03:52 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=36447, Retrieved Fri, 17 May 2024 03:03:52 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact215
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]
F RMP   [(Partial) Autocorrelation Function] [ARMA unemployment...] [2008-12-06 10:56:51] [6c955a33a02d5e30e404487434e7a5c9]
- RMPD    [ARIMA Backward Selection] [] [2008-12-24 09:40:54] [74be16979710d4c4e7c6647856088456]
- RMP         [ARIMA Forecasting] [] [2008-12-24 10:32:53] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
9.2
9.1
9.1
9.1
9.1
9.2
9.3
9.3
9.3
9.3
9.3
9.4
9.4
9.4
9.5
9.5
9.4
9.4
9.3
9.4
9.4
9.2
9.1
9.1
9.1
9.1
9
8.9
8.8
8.7
8.5
8.3
8.1
7.8
7.6
7.5
7.4
7.3
7.1
6.9
6.8
6.8
6.8
6.9
6.7
6.6
6.5
6.4
6.3
6.3
6.3
6.5
6.6
6.5
6.4
6.5
6.7
7.1
7.1
7.2
7.2
7.3
7.3
7.3
7.4
7.4
7.6
7.6
7.6
7.7
7.8
7.9
8.1
8.1
8.1
8.2
8.2
8.2
8.2
8.2
8.2
8.3
8.3
8.4
8.4
8.4
8.3
8
8
8.2
8.6
8.7
8.7
8.5
8.4
8.4
8.4
8.5
8.5
8.5
8.5
8.5
8.4
8.4
8.4
8.5
8.5
8.6
8.6
8.6
8.5
8.4
8.4
8.3
8.2
8.1
8.2
8.1
8
7.9
7.8
7.7
7.7
7.9
7.8
7.6
7.4
7.3
7.1
7.1
7
7




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36447&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'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[120])
1088.6-------
1098.6-------
1108.6-------
1118.5-------
1128.4-------
1138.4-------
1148.3-------
1158.2-------
1168.1-------
1178.2-------
1188.1-------
1198-------
1207.9-------
1217.87.84887.66118.03660.3050.296700.2967
1227.77.80867.47398.14330.26240.5200.2962
1237.77.7717.29858.24340.38420.61580.00120.2962
1247.97.71847.14238.29450.26840.5250.01020.2684
1257.87.65516.98358.32680.33620.23740.01490.2374
1267.67.59586.82468.3670.49570.30190.03670.2197
1277.47.54166.65658.42670.37690.44850.07240.2137
1287.37.49056.48018.50090.35590.56970.11850.2135
1297.17.43166.28928.5740.28470.58930.09370.2108
1307.17.37936.10248.65610.33410.66590.13430.212
13177.32565.91188.73940.32590.62280.17490.2129
13277.27155.7178.8260.36610.63390.2140.214

\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[120]) \tabularnewline
108 & 8.6 & - & - & - & - & - & - & - \tabularnewline
109 & 8.6 & - & - & - & - & - & - & - \tabularnewline
110 & 8.6 & - & - & - & - & - & - & - \tabularnewline
111 & 8.5 & - & - & - & - & - & - & - \tabularnewline
112 & 8.4 & - & - & - & - & - & - & - \tabularnewline
113 & 8.4 & - & - & - & - & - & - & - \tabularnewline
114 & 8.3 & - & - & - & - & - & - & - \tabularnewline
115 & 8.2 & - & - & - & - & - & - & - \tabularnewline
116 & 8.1 & - & - & - & - & - & - & - \tabularnewline
117 & 8.2 & - & - & - & - & - & - & - \tabularnewline
118 & 8.1 & - & - & - & - & - & - & - \tabularnewline
119 & 8 & - & - & - & - & - & - & - \tabularnewline
120 & 7.9 & - & - & - & - & - & - & - \tabularnewline
121 & 7.8 & 7.8488 & 7.6611 & 8.0366 & 0.305 & 0.2967 & 0 & 0.2967 \tabularnewline
122 & 7.7 & 7.8086 & 7.4739 & 8.1433 & 0.2624 & 0.52 & 0 & 0.2962 \tabularnewline
123 & 7.7 & 7.771 & 7.2985 & 8.2434 & 0.3842 & 0.6158 & 0.0012 & 0.2962 \tabularnewline
124 & 7.9 & 7.7184 & 7.1423 & 8.2945 & 0.2684 & 0.525 & 0.0102 & 0.2684 \tabularnewline
125 & 7.8 & 7.6551 & 6.9835 & 8.3268 & 0.3362 & 0.2374 & 0.0149 & 0.2374 \tabularnewline
126 & 7.6 & 7.5958 & 6.8246 & 8.367 & 0.4957 & 0.3019 & 0.0367 & 0.2197 \tabularnewline
127 & 7.4 & 7.5416 & 6.6565 & 8.4267 & 0.3769 & 0.4485 & 0.0724 & 0.2137 \tabularnewline
128 & 7.3 & 7.4905 & 6.4801 & 8.5009 & 0.3559 & 0.5697 & 0.1185 & 0.2135 \tabularnewline
129 & 7.1 & 7.4316 & 6.2892 & 8.574 & 0.2847 & 0.5893 & 0.0937 & 0.2108 \tabularnewline
130 & 7.1 & 7.3793 & 6.1024 & 8.6561 & 0.3341 & 0.6659 & 0.1343 & 0.212 \tabularnewline
131 & 7 & 7.3256 & 5.9118 & 8.7394 & 0.3259 & 0.6228 & 0.1749 & 0.2129 \tabularnewline
132 & 7 & 7.2715 & 5.717 & 8.826 & 0.3661 & 0.6339 & 0.214 & 0.214 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36447&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[120])[/C][/ROW]
[ROW][C]108[/C][C]8.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]8.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]8.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]8.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]8.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]8.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]8.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]8.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]8.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]8.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]8.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]7.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]7.8[/C][C]7.8488[/C][C]7.6611[/C][C]8.0366[/C][C]0.305[/C][C]0.2967[/C][C]0[/C][C]0.2967[/C][/ROW]
[ROW][C]122[/C][C]7.7[/C][C]7.8086[/C][C]7.4739[/C][C]8.1433[/C][C]0.2624[/C][C]0.52[/C][C]0[/C][C]0.2962[/C][/ROW]
[ROW][C]123[/C][C]7.7[/C][C]7.771[/C][C]7.2985[/C][C]8.2434[/C][C]0.3842[/C][C]0.6158[/C][C]0.0012[/C][C]0.2962[/C][/ROW]
[ROW][C]124[/C][C]7.9[/C][C]7.7184[/C][C]7.1423[/C][C]8.2945[/C][C]0.2684[/C][C]0.525[/C][C]0.0102[/C][C]0.2684[/C][/ROW]
[ROW][C]125[/C][C]7.8[/C][C]7.6551[/C][C]6.9835[/C][C]8.3268[/C][C]0.3362[/C][C]0.2374[/C][C]0.0149[/C][C]0.2374[/C][/ROW]
[ROW][C]126[/C][C]7.6[/C][C]7.5958[/C][C]6.8246[/C][C]8.367[/C][C]0.4957[/C][C]0.3019[/C][C]0.0367[/C][C]0.2197[/C][/ROW]
[ROW][C]127[/C][C]7.4[/C][C]7.5416[/C][C]6.6565[/C][C]8.4267[/C][C]0.3769[/C][C]0.4485[/C][C]0.0724[/C][C]0.2137[/C][/ROW]
[ROW][C]128[/C][C]7.3[/C][C]7.4905[/C][C]6.4801[/C][C]8.5009[/C][C]0.3559[/C][C]0.5697[/C][C]0.1185[/C][C]0.2135[/C][/ROW]
[ROW][C]129[/C][C]7.1[/C][C]7.4316[/C][C]6.2892[/C][C]8.574[/C][C]0.2847[/C][C]0.5893[/C][C]0.0937[/C][C]0.2108[/C][/ROW]
[ROW][C]130[/C][C]7.1[/C][C]7.3793[/C][C]6.1024[/C][C]8.6561[/C][C]0.3341[/C][C]0.6659[/C][C]0.1343[/C][C]0.212[/C][/ROW]
[ROW][C]131[/C][C]7[/C][C]7.3256[/C][C]5.9118[/C][C]8.7394[/C][C]0.3259[/C][C]0.6228[/C][C]0.1749[/C][C]0.2129[/C][/ROW]
[ROW][C]132[/C][C]7[/C][C]7.2715[/C][C]5.717[/C][C]8.826[/C][C]0.3661[/C][C]0.6339[/C][C]0.214[/C][C]0.214[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36447&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36447&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[120])
1088.6-------
1098.6-------
1108.6-------
1118.5-------
1128.4-------
1138.4-------
1148.3-------
1158.2-------
1168.1-------
1178.2-------
1188.1-------
1198-------
1207.9-------
1217.87.84887.66118.03660.3050.296700.2967
1227.77.80867.47398.14330.26240.5200.2962
1237.77.7717.29858.24340.38420.61580.00120.2962
1247.97.71847.14238.29450.26840.5250.01020.2684
1257.87.65516.98358.32680.33620.23740.01490.2374
1267.67.59586.82468.3670.49570.30190.03670.2197
1277.47.54166.65658.42670.37690.44850.07240.2137
1287.37.49056.48018.50090.35590.56970.11850.2135
1297.17.43166.28928.5740.28470.58930.09370.2108
1307.17.37936.10248.65610.33410.66590.13430.212
13177.32565.91188.73940.32590.62280.17490.2129
13277.27155.7178.8260.36610.63390.2140.214







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1210.0122-0.00625e-040.00242e-040.0141
1220.0219-0.01390.00120.01180.0010.0313
1230.031-0.00918e-040.0054e-040.0205
1240.03810.02350.0020.0330.00270.0524
1250.04480.01890.00160.0210.00170.0418
1260.05186e-040000.0012
1270.0599-0.01880.00160.020.00170.0409
1280.0688-0.02540.00210.03630.0030.055
1290.0784-0.04460.00370.110.00920.0957
1300.0883-0.03780.00320.0780.00650.0806
1310.0985-0.04440.00370.1060.00880.094
1320.1091-0.03730.00310.07370.00610.0784

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
121 & 0.0122 & -0.0062 & 5e-04 & 0.0024 & 2e-04 & 0.0141 \tabularnewline
122 & 0.0219 & -0.0139 & 0.0012 & 0.0118 & 0.001 & 0.0313 \tabularnewline
123 & 0.031 & -0.0091 & 8e-04 & 0.005 & 4e-04 & 0.0205 \tabularnewline
124 & 0.0381 & 0.0235 & 0.002 & 0.033 & 0.0027 & 0.0524 \tabularnewline
125 & 0.0448 & 0.0189 & 0.0016 & 0.021 & 0.0017 & 0.0418 \tabularnewline
126 & 0.0518 & 6e-04 & 0 & 0 & 0 & 0.0012 \tabularnewline
127 & 0.0599 & -0.0188 & 0.0016 & 0.02 & 0.0017 & 0.0409 \tabularnewline
128 & 0.0688 & -0.0254 & 0.0021 & 0.0363 & 0.003 & 0.055 \tabularnewline
129 & 0.0784 & -0.0446 & 0.0037 & 0.11 & 0.0092 & 0.0957 \tabularnewline
130 & 0.0883 & -0.0378 & 0.0032 & 0.078 & 0.0065 & 0.0806 \tabularnewline
131 & 0.0985 & -0.0444 & 0.0037 & 0.106 & 0.0088 & 0.094 \tabularnewline
132 & 0.1091 & -0.0373 & 0.0031 & 0.0737 & 0.0061 & 0.0784 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36447&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]121[/C][C]0.0122[/C][C]-0.0062[/C][C]5e-04[/C][C]0.0024[/C][C]2e-04[/C][C]0.0141[/C][/ROW]
[ROW][C]122[/C][C]0.0219[/C][C]-0.0139[/C][C]0.0012[/C][C]0.0118[/C][C]0.001[/C][C]0.0313[/C][/ROW]
[ROW][C]123[/C][C]0.031[/C][C]-0.0091[/C][C]8e-04[/C][C]0.005[/C][C]4e-04[/C][C]0.0205[/C][/ROW]
[ROW][C]124[/C][C]0.0381[/C][C]0.0235[/C][C]0.002[/C][C]0.033[/C][C]0.0027[/C][C]0.0524[/C][/ROW]
[ROW][C]125[/C][C]0.0448[/C][C]0.0189[/C][C]0.0016[/C][C]0.021[/C][C]0.0017[/C][C]0.0418[/C][/ROW]
[ROW][C]126[/C][C]0.0518[/C][C]6e-04[/C][C]0[/C][C]0[/C][C]0[/C][C]0.0012[/C][/ROW]
[ROW][C]127[/C][C]0.0599[/C][C]-0.0188[/C][C]0.0016[/C][C]0.02[/C][C]0.0017[/C][C]0.0409[/C][/ROW]
[ROW][C]128[/C][C]0.0688[/C][C]-0.0254[/C][C]0.0021[/C][C]0.0363[/C][C]0.003[/C][C]0.055[/C][/ROW]
[ROW][C]129[/C][C]0.0784[/C][C]-0.0446[/C][C]0.0037[/C][C]0.11[/C][C]0.0092[/C][C]0.0957[/C][/ROW]
[ROW][C]130[/C][C]0.0883[/C][C]-0.0378[/C][C]0.0032[/C][C]0.078[/C][C]0.0065[/C][C]0.0806[/C][/ROW]
[ROW][C]131[/C][C]0.0985[/C][C]-0.0444[/C][C]0.0037[/C][C]0.106[/C][C]0.0088[/C][C]0.094[/C][/ROW]
[ROW][C]132[/C][C]0.1091[/C][C]-0.0373[/C][C]0.0031[/C][C]0.0737[/C][C]0.0061[/C][C]0.0784[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36447&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36447&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
1210.0122-0.00625e-040.00242e-040.0141
1220.0219-0.01390.00120.01180.0010.0313
1230.031-0.00918e-040.0054e-040.0205
1240.03810.02350.0020.0330.00270.0524
1250.04480.01890.00160.0210.00170.0418
1260.05186e-040000.0012
1270.0599-0.01880.00160.020.00170.0409
1280.0688-0.02540.00210.03630.0030.055
1290.0784-0.04460.00370.110.00920.0957
1300.0883-0.03780.00320.0780.00650.0806
1310.0985-0.04440.00370.1060.00880.094
1320.1091-0.03730.00310.07370.00610.0784



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