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 computationThu, 16 Dec 2010 19:09: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/16/t1292526412jvs9l9ddi4e2evo.htm/, Retrieved Fri, 03 May 2024 04:39:24 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=111200, Retrieved Fri, 03 May 2024 04:39:24 +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] [] [2008-12-08 19:22:39] [d2d412c7f4d35ffbf5ee5ee89db327d4]
- RMP   [Spectral Analysis] [spectrum analyse ...] [2010-12-14 18:46:58] [d6e648f00513dd750579ba7880c5fbf5]
- RMP     [ARIMA Forecasting] [arima forecast] [2010-12-14 19:31:52] [d6e648f00513dd750579ba7880c5fbf5]
- R PD      [ARIMA Forecasting] [] [2010-12-16 10:48:12] [b10d6b9682dfaaa479f495240bcd67cf]
-   P           [ARIMA Forecasting] [] [2010-12-16 19:09:06] [7674ee8f347756742f81ca2ada5c384c] [Current]
-   PD            [ARIMA Forecasting] [] [2010-12-19 15:52:35] [b10d6b9682dfaaa479f495240bcd67cf]
-    D              [ARIMA Forecasting] [] [2010-12-28 21:16:29] [58af523ef9b33032fd2497c80088399b]
-   PD                [ARIMA Forecasting] [] [2010-12-29 09:52:04] [126c9e58bb659a0bfb4675d843c2c69e]
-    D            [ARIMA Forecasting] [] [2010-12-28 20:15:13] [58af523ef9b33032fd2497c80088399b]
-    D              [ARIMA Forecasting] [] [2010-12-29 09:36:05] [126c9e58bb659a0bfb4675d843c2c69e]
Feedback Forum

Post a new message
Dataseries X:
41.85
41.75
41.75
41.75
41.58
41.61
41.42
41.37
41.37
41.33
41.37
41.34
41.33
41.29
41.29
41.27
41.04
40.90
40.89
40.72
40.72
40.58
40.24
40.07
40.12
40.10
40.10
40.08
40.06
39.99
40.05
39.66
39.66
39.67
39.56
39.64
39.73
39.70
39.70
39.68
39.76
40.00
39.96
40.01
40.01
40.01
40.00
39.91
39.86
39.79
39.79
39.80
39.64
39.55
39.36
39.28




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=111200&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[44])
3239.66-------
3339.66-------
3439.67-------
3539.56-------
3639.64-------
3739.73-------
3839.7-------
3939.7-------
4039.68-------
4139.76-------
4240-------
4339.96-------
4440.01-------
4540.0140.0139.776440.24360.50.50.99830.5
4640.0140.0139.679740.34030.50.50.97820.5
474040.0139.605540.41450.48070.50.98540.5
4839.9140.0139.542940.47710.33740.51670.93970.5
4939.8640.0139.487740.53230.28670.64630.85330.5
5039.7940.0139.437940.58210.22550.69630.85590.5
5139.7940.0139.392140.62790.24270.75730.83730.5
5239.840.0139.349440.67060.26660.7430.83620.5
5339.6440.0139.309340.71070.15030.72150.75780.5
5439.5540.0139.271440.74860.11110.83690.51060.5
5539.3640.0139.235440.78460.050.87780.55030.5
5639.2840.0139.200940.81910.03850.94230.50.5

\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[44]) \tabularnewline
32 & 39.66 & - & - & - & - & - & - & - \tabularnewline
33 & 39.66 & - & - & - & - & - & - & - \tabularnewline
34 & 39.67 & - & - & - & - & - & - & - \tabularnewline
35 & 39.56 & - & - & - & - & - & - & - \tabularnewline
36 & 39.64 & - & - & - & - & - & - & - \tabularnewline
37 & 39.73 & - & - & - & - & - & - & - \tabularnewline
38 & 39.7 & - & - & - & - & - & - & - \tabularnewline
39 & 39.7 & - & - & - & - & - & - & - \tabularnewline
40 & 39.68 & - & - & - & - & - & - & - \tabularnewline
41 & 39.76 & - & - & - & - & - & - & - \tabularnewline
42 & 40 & - & - & - & - & - & - & - \tabularnewline
43 & 39.96 & - & - & - & - & - & - & - \tabularnewline
44 & 40.01 & - & - & - & - & - & - & - \tabularnewline
45 & 40.01 & 40.01 & 39.7764 & 40.2436 & 0.5 & 0.5 & 0.9983 & 0.5 \tabularnewline
46 & 40.01 & 40.01 & 39.6797 & 40.3403 & 0.5 & 0.5 & 0.9782 & 0.5 \tabularnewline
47 & 40 & 40.01 & 39.6055 & 40.4145 & 0.4807 & 0.5 & 0.9854 & 0.5 \tabularnewline
48 & 39.91 & 40.01 & 39.5429 & 40.4771 & 0.3374 & 0.5167 & 0.9397 & 0.5 \tabularnewline
49 & 39.86 & 40.01 & 39.4877 & 40.5323 & 0.2867 & 0.6463 & 0.8533 & 0.5 \tabularnewline
50 & 39.79 & 40.01 & 39.4379 & 40.5821 & 0.2255 & 0.6963 & 0.8559 & 0.5 \tabularnewline
51 & 39.79 & 40.01 & 39.3921 & 40.6279 & 0.2427 & 0.7573 & 0.8373 & 0.5 \tabularnewline
52 & 39.8 & 40.01 & 39.3494 & 40.6706 & 0.2666 & 0.743 & 0.8362 & 0.5 \tabularnewline
53 & 39.64 & 40.01 & 39.3093 & 40.7107 & 0.1503 & 0.7215 & 0.7578 & 0.5 \tabularnewline
54 & 39.55 & 40.01 & 39.2714 & 40.7486 & 0.1111 & 0.8369 & 0.5106 & 0.5 \tabularnewline
55 & 39.36 & 40.01 & 39.2354 & 40.7846 & 0.05 & 0.8778 & 0.5503 & 0.5 \tabularnewline
56 & 39.28 & 40.01 & 39.2009 & 40.8191 & 0.0385 & 0.9423 & 0.5 & 0.5 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=111200&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[44])[/C][/ROW]
[ROW][C]32[/C][C]39.66[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]39.66[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]39.67[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]39.56[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]39.64[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]39.73[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]39.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]39.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]39.68[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]39.76[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]40[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]39.96[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]40.01[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]40.01[/C][C]40.01[/C][C]39.7764[/C][C]40.2436[/C][C]0.5[/C][C]0.5[/C][C]0.9983[/C][C]0.5[/C][/ROW]
[ROW][C]46[/C][C]40.01[/C][C]40.01[/C][C]39.6797[/C][C]40.3403[/C][C]0.5[/C][C]0.5[/C][C]0.9782[/C][C]0.5[/C][/ROW]
[ROW][C]47[/C][C]40[/C][C]40.01[/C][C]39.6055[/C][C]40.4145[/C][C]0.4807[/C][C]0.5[/C][C]0.9854[/C][C]0.5[/C][/ROW]
[ROW][C]48[/C][C]39.91[/C][C]40.01[/C][C]39.5429[/C][C]40.4771[/C][C]0.3374[/C][C]0.5167[/C][C]0.9397[/C][C]0.5[/C][/ROW]
[ROW][C]49[/C][C]39.86[/C][C]40.01[/C][C]39.4877[/C][C]40.5323[/C][C]0.2867[/C][C]0.6463[/C][C]0.8533[/C][C]0.5[/C][/ROW]
[ROW][C]50[/C][C]39.79[/C][C]40.01[/C][C]39.4379[/C][C]40.5821[/C][C]0.2255[/C][C]0.6963[/C][C]0.8559[/C][C]0.5[/C][/ROW]
[ROW][C]51[/C][C]39.79[/C][C]40.01[/C][C]39.3921[/C][C]40.6279[/C][C]0.2427[/C][C]0.7573[/C][C]0.8373[/C][C]0.5[/C][/ROW]
[ROW][C]52[/C][C]39.8[/C][C]40.01[/C][C]39.3494[/C][C]40.6706[/C][C]0.2666[/C][C]0.743[/C][C]0.8362[/C][C]0.5[/C][/ROW]
[ROW][C]53[/C][C]39.64[/C][C]40.01[/C][C]39.3093[/C][C]40.7107[/C][C]0.1503[/C][C]0.7215[/C][C]0.7578[/C][C]0.5[/C][/ROW]
[ROW][C]54[/C][C]39.55[/C][C]40.01[/C][C]39.2714[/C][C]40.7486[/C][C]0.1111[/C][C]0.8369[/C][C]0.5106[/C][C]0.5[/C][/ROW]
[ROW][C]55[/C][C]39.36[/C][C]40.01[/C][C]39.2354[/C][C]40.7846[/C][C]0.05[/C][C]0.8778[/C][C]0.5503[/C][C]0.5[/C][/ROW]
[ROW][C]56[/C][C]39.28[/C][C]40.01[/C][C]39.2009[/C][C]40.8191[/C][C]0.0385[/C][C]0.9423[/C][C]0.5[/C][C]0.5[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=111200&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=111200&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[44])
3239.66-------
3339.66-------
3439.67-------
3539.56-------
3639.64-------
3739.73-------
3839.7-------
3939.7-------
4039.68-------
4139.76-------
4240-------
4339.96-------
4440.01-------
4540.0140.0139.776440.24360.50.50.99830.5
4640.0140.0139.679740.34030.50.50.97820.5
474040.0139.605540.41450.48070.50.98540.5
4839.9140.0139.542940.47710.33740.51670.93970.5
4939.8640.0139.487740.53230.28670.64630.85330.5
5039.7940.0139.437940.58210.22550.69630.85590.5
5139.7940.0139.392140.62790.24270.75730.83730.5
5239.840.0139.349440.67060.26660.7430.83620.5
5339.6440.0139.309340.71070.15030.72150.75780.5
5439.5540.0139.271440.74860.11110.83690.51060.5
5539.3640.0139.235440.78460.050.87780.55030.5
5639.2840.0139.200940.81910.03850.94230.50.5







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
450.00300000
460.004200000
470.0052-2e-041e-041e-0400.0058
480.006-0.00257e-040.010.00250.0502
490.0067-0.00370.00130.02250.00650.0807
500.0073-0.00550.0020.04840.01350.1162
510.0079-0.00550.00250.04840.01850.136
520.0084-0.00520.00280.04410.02170.1473
530.0089-0.00920.00360.13690.03450.1857
540.0094-0.01150.00430.21160.05220.2285
550.0099-0.01620.00540.42250.08590.293
560.0103-0.01820.00650.53290.12310.3509

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
45 & 0.003 & 0 & 0 & 0 & 0 & 0 \tabularnewline
46 & 0.0042 & 0 & 0 & 0 & 0 & 0 \tabularnewline
47 & 0.0052 & -2e-04 & 1e-04 & 1e-04 & 0 & 0.0058 \tabularnewline
48 & 0.006 & -0.0025 & 7e-04 & 0.01 & 0.0025 & 0.0502 \tabularnewline
49 & 0.0067 & -0.0037 & 0.0013 & 0.0225 & 0.0065 & 0.0807 \tabularnewline
50 & 0.0073 & -0.0055 & 0.002 & 0.0484 & 0.0135 & 0.1162 \tabularnewline
51 & 0.0079 & -0.0055 & 0.0025 & 0.0484 & 0.0185 & 0.136 \tabularnewline
52 & 0.0084 & -0.0052 & 0.0028 & 0.0441 & 0.0217 & 0.1473 \tabularnewline
53 & 0.0089 & -0.0092 & 0.0036 & 0.1369 & 0.0345 & 0.1857 \tabularnewline
54 & 0.0094 & -0.0115 & 0.0043 & 0.2116 & 0.0522 & 0.2285 \tabularnewline
55 & 0.0099 & -0.0162 & 0.0054 & 0.4225 & 0.0859 & 0.293 \tabularnewline
56 & 0.0103 & -0.0182 & 0.0065 & 0.5329 & 0.1231 & 0.3509 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=111200&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]45[/C][C]0.003[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]46[/C][C]0.0042[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]47[/C][C]0.0052[/C][C]-2e-04[/C][C]1e-04[/C][C]1e-04[/C][C]0[/C][C]0.0058[/C][/ROW]
[ROW][C]48[/C][C]0.006[/C][C]-0.0025[/C][C]7e-04[/C][C]0.01[/C][C]0.0025[/C][C]0.0502[/C][/ROW]
[ROW][C]49[/C][C]0.0067[/C][C]-0.0037[/C][C]0.0013[/C][C]0.0225[/C][C]0.0065[/C][C]0.0807[/C][/ROW]
[ROW][C]50[/C][C]0.0073[/C][C]-0.0055[/C][C]0.002[/C][C]0.0484[/C][C]0.0135[/C][C]0.1162[/C][/ROW]
[ROW][C]51[/C][C]0.0079[/C][C]-0.0055[/C][C]0.0025[/C][C]0.0484[/C][C]0.0185[/C][C]0.136[/C][/ROW]
[ROW][C]52[/C][C]0.0084[/C][C]-0.0052[/C][C]0.0028[/C][C]0.0441[/C][C]0.0217[/C][C]0.1473[/C][/ROW]
[ROW][C]53[/C][C]0.0089[/C][C]-0.0092[/C][C]0.0036[/C][C]0.1369[/C][C]0.0345[/C][C]0.1857[/C][/ROW]
[ROW][C]54[/C][C]0.0094[/C][C]-0.0115[/C][C]0.0043[/C][C]0.2116[/C][C]0.0522[/C][C]0.2285[/C][/ROW]
[ROW][C]55[/C][C]0.0099[/C][C]-0.0162[/C][C]0.0054[/C][C]0.4225[/C][C]0.0859[/C][C]0.293[/C][/ROW]
[ROW][C]56[/C][C]0.0103[/C][C]-0.0182[/C][C]0.0065[/C][C]0.5329[/C][C]0.1231[/C][C]0.3509[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=111200&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=111200&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
450.00300000
460.004200000
470.0052-2e-041e-041e-0400.0058
480.006-0.00257e-040.010.00250.0502
490.0067-0.00370.00130.02250.00650.0807
500.0073-0.00550.0020.04840.01350.1162
510.0079-0.00550.00250.04840.01850.136
520.0084-0.00520.00280.04410.02170.1473
530.0089-0.00920.00360.13690.03450.1857
540.0094-0.01150.00430.21160.05220.2285
550.0099-0.01620.00540.42250.08590.293
560.0103-0.01820.00650.53290.12310.3509



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