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 computationMon, 20 Dec 2010 16:43:19 +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/20/t1292863401lv3iso5eorzw4c6.htm/, Retrieved Fri, 03 May 2024 21:37:06 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=113019, Retrieved Fri, 03 May 2024 21:37:06 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact130
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-12 13:32:37] [76963dc1903f0f612b6153510a3818cf]
- R  D  [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-17 12:14:40] [76963dc1903f0f612b6153510a3818cf]
-         [Univariate Explorative Data Analysis] [Run Sequence Plot...] [2008-12-22 18:19:51] [1ce0d16c8f4225c977b42c8fa93bc163]
- RMP       [Univariate Data Series] [Identifying Integ...] [2009-11-22 12:08:06] [b98453cac15ba1066b407e146608df68]
- RMP         [Standard Deviation-Mean Plot] [Births] [2010-11-29 10:52:49] [b98453cac15ba1066b407e146608df68]
- RMP           [ARIMA Forecasting] [Births] [2010-11-29 20:53:49] [b98453cac15ba1066b407e146608df68]
-   PD              [ARIMA Forecasting] [Paper - Forecasti...] [2010-12-20 16:43:19] [ffc0b3af89e3f152a248771909785efd] [Current]
Feedback Forum

Post a new message
Dataseries X:
9.3
14.2
17.3
23
16.3
18.4
14.2
9.1
5.9
7.2
6.8
8
14.3
14.6
17.5
17.2
17.2
14.1
10.4
6.8
4.1
6.5
6.1
6.3
9.3
16.4
16.1
18
17.6
14
10.5
6.9
2.8
0.7
3.6
6.7
12.5
14.4
16.5
18.7
19.4
15.8
11.3
9.7
2.9
0.1
2.5
6.7
10.3
11.2
17.4
20.5
17
14.2
10.6
6.1




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk

\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 & 3 seconds \tabularnewline
R Server & 'RServer@AstonUniversity' @ vre.aston.ac.uk \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=113019&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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'RServer@AstonUniversity' @ vre.aston.ac.uk[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=113019&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=113019&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 time3 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk







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])
326.9-------
332.8-------
340.7-------
353.6-------
366.7-------
3712.5-------
3814.4-------
3916.5-------
4018.7-------
4119.4-------
4215.8-------
4311.3-------
449.7-------
452.95.04871.30678.79080.13020.00740.88060.0074
460.16.16112.313910.00820.0010.95170.99730.0357
472.56.54212.604910.47920.02210.99930.92850.058
486.77.29833.205811.39080.38720.98920.61280.125
4910.311.54717.394115.70020.27810.98890.32650.8083
5011.215.926111.733820.11840.01360.99570.76220.9982
5117.416.804112.5821.02810.39110.99530.55610.9995
5220.518.158513.915222.40190.13970.6370.40131
531718.027813.771822.28380.3180.12750.26370.9999
5414.214.517710.252818.78250.4420.1270.27780.9866
5510.610.75116.480515.02180.47240.05670.40060.6852
566.17.50583.231211.78030.25960.0780.15720.1572

\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 & 6.9 & - & - & - & - & - & - & - \tabularnewline
33 & 2.8 & - & - & - & - & - & - & - \tabularnewline
34 & 0.7 & - & - & - & - & - & - & - \tabularnewline
35 & 3.6 & - & - & - & - & - & - & - \tabularnewline
36 & 6.7 & - & - & - & - & - & - & - \tabularnewline
37 & 12.5 & - & - & - & - & - & - & - \tabularnewline
38 & 14.4 & - & - & - & - & - & - & - \tabularnewline
39 & 16.5 & - & - & - & - & - & - & - \tabularnewline
40 & 18.7 & - & - & - & - & - & - & - \tabularnewline
41 & 19.4 & - & - & - & - & - & - & - \tabularnewline
42 & 15.8 & - & - & - & - & - & - & - \tabularnewline
43 & 11.3 & - & - & - & - & - & - & - \tabularnewline
44 & 9.7 & - & - & - & - & - & - & - \tabularnewline
45 & 2.9 & 5.0487 & 1.3067 & 8.7908 & 0.1302 & 0.0074 & 0.8806 & 0.0074 \tabularnewline
46 & 0.1 & 6.1611 & 2.3139 & 10.0082 & 0.001 & 0.9517 & 0.9973 & 0.0357 \tabularnewline
47 & 2.5 & 6.5421 & 2.6049 & 10.4792 & 0.0221 & 0.9993 & 0.9285 & 0.058 \tabularnewline
48 & 6.7 & 7.2983 & 3.2058 & 11.3908 & 0.3872 & 0.9892 & 0.6128 & 0.125 \tabularnewline
49 & 10.3 & 11.5471 & 7.3941 & 15.7002 & 0.2781 & 0.9889 & 0.3265 & 0.8083 \tabularnewline
50 & 11.2 & 15.9261 & 11.7338 & 20.1184 & 0.0136 & 0.9957 & 0.7622 & 0.9982 \tabularnewline
51 & 17.4 & 16.8041 & 12.58 & 21.0281 & 0.3911 & 0.9953 & 0.5561 & 0.9995 \tabularnewline
52 & 20.5 & 18.1585 & 13.9152 & 22.4019 & 0.1397 & 0.637 & 0.4013 & 1 \tabularnewline
53 & 17 & 18.0278 & 13.7718 & 22.2838 & 0.318 & 0.1275 & 0.2637 & 0.9999 \tabularnewline
54 & 14.2 & 14.5177 & 10.2528 & 18.7825 & 0.442 & 0.127 & 0.2778 & 0.9866 \tabularnewline
55 & 10.6 & 10.7511 & 6.4805 & 15.0218 & 0.4724 & 0.0567 & 0.4006 & 0.6852 \tabularnewline
56 & 6.1 & 7.5058 & 3.2312 & 11.7803 & 0.2596 & 0.078 & 0.1572 & 0.1572 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=113019&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]6.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]2.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]0.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]3.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]6.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]12.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]14.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]16.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]18.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]19.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]15.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]11.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]9.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]2.9[/C][C]5.0487[/C][C]1.3067[/C][C]8.7908[/C][C]0.1302[/C][C]0.0074[/C][C]0.8806[/C][C]0.0074[/C][/ROW]
[ROW][C]46[/C][C]0.1[/C][C]6.1611[/C][C]2.3139[/C][C]10.0082[/C][C]0.001[/C][C]0.9517[/C][C]0.9973[/C][C]0.0357[/C][/ROW]
[ROW][C]47[/C][C]2.5[/C][C]6.5421[/C][C]2.6049[/C][C]10.4792[/C][C]0.0221[/C][C]0.9993[/C][C]0.9285[/C][C]0.058[/C][/ROW]
[ROW][C]48[/C][C]6.7[/C][C]7.2983[/C][C]3.2058[/C][C]11.3908[/C][C]0.3872[/C][C]0.9892[/C][C]0.6128[/C][C]0.125[/C][/ROW]
[ROW][C]49[/C][C]10.3[/C][C]11.5471[/C][C]7.3941[/C][C]15.7002[/C][C]0.2781[/C][C]0.9889[/C][C]0.3265[/C][C]0.8083[/C][/ROW]
[ROW][C]50[/C][C]11.2[/C][C]15.9261[/C][C]11.7338[/C][C]20.1184[/C][C]0.0136[/C][C]0.9957[/C][C]0.7622[/C][C]0.9982[/C][/ROW]
[ROW][C]51[/C][C]17.4[/C][C]16.8041[/C][C]12.58[/C][C]21.0281[/C][C]0.3911[/C][C]0.9953[/C][C]0.5561[/C][C]0.9995[/C][/ROW]
[ROW][C]52[/C][C]20.5[/C][C]18.1585[/C][C]13.9152[/C][C]22.4019[/C][C]0.1397[/C][C]0.637[/C][C]0.4013[/C][C]1[/C][/ROW]
[ROW][C]53[/C][C]17[/C][C]18.0278[/C][C]13.7718[/C][C]22.2838[/C][C]0.318[/C][C]0.1275[/C][C]0.2637[/C][C]0.9999[/C][/ROW]
[ROW][C]54[/C][C]14.2[/C][C]14.5177[/C][C]10.2528[/C][C]18.7825[/C][C]0.442[/C][C]0.127[/C][C]0.2778[/C][C]0.9866[/C][/ROW]
[ROW][C]55[/C][C]10.6[/C][C]10.7511[/C][C]6.4805[/C][C]15.0218[/C][C]0.4724[/C][C]0.0567[/C][C]0.4006[/C][C]0.6852[/C][/ROW]
[ROW][C]56[/C][C]6.1[/C][C]7.5058[/C][C]3.2312[/C][C]11.7803[/C][C]0.2596[/C][C]0.078[/C][C]0.1572[/C][C]0.1572[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=113019&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=113019&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])
326.9-------
332.8-------
340.7-------
353.6-------
366.7-------
3712.5-------
3814.4-------
3916.5-------
4018.7-------
4119.4-------
4215.8-------
4311.3-------
449.7-------
452.95.04871.30678.79080.13020.00740.88060.0074
460.16.16112.313910.00820.0010.95170.99730.0357
472.56.54212.604910.47920.02210.99930.92850.058
486.77.29833.205811.39080.38720.98920.61280.125
4910.311.54717.394115.70020.27810.98890.32650.8083
5011.215.926111.733820.11840.01360.99570.76220.9982
5117.416.804112.5821.02810.39110.99530.55610.9995
5220.518.158513.915222.40190.13970.6370.40131
531718.027813.771822.28380.3180.12750.26370.9999
5414.214.517710.252818.78250.4420.1270.27780.9866
5510.610.75116.480515.02180.47240.05670.40060.6852
566.17.50583.231211.78030.25960.0780.15720.1572







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
450.3782-0.425604.617100
460.3186-0.98380.704736.736420.67674.5472
470.3071-0.61790.675716.338219.23064.3853
480.2861-0.0820.52730.35814.51243.8095
490.1835-0.1080.44341.555311.9213.4527
500.1343-0.29680.41922.336113.65683.6955
510.12830.03550.36420.355111.75663.4288
520.11920.12890.33485.482410.97233.3125
530.1204-0.0570.30391.05649.87063.1417
540.1499-0.02190.27570.10098.89362.9822
550.2027-0.01410.25190.02288.08722.8438
560.2906-0.18730.24661.97627.57792.7528

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
45 & 0.3782 & -0.4256 & 0 & 4.6171 & 0 & 0 \tabularnewline
46 & 0.3186 & -0.9838 & 0.7047 & 36.7364 & 20.6767 & 4.5472 \tabularnewline
47 & 0.3071 & -0.6179 & 0.6757 & 16.3382 & 19.2306 & 4.3853 \tabularnewline
48 & 0.2861 & -0.082 & 0.5273 & 0.358 & 14.5124 & 3.8095 \tabularnewline
49 & 0.1835 & -0.108 & 0.4434 & 1.5553 & 11.921 & 3.4527 \tabularnewline
50 & 0.1343 & -0.2968 & 0.419 & 22.3361 & 13.6568 & 3.6955 \tabularnewline
51 & 0.1283 & 0.0355 & 0.3642 & 0.3551 & 11.7566 & 3.4288 \tabularnewline
52 & 0.1192 & 0.1289 & 0.3348 & 5.4824 & 10.9723 & 3.3125 \tabularnewline
53 & 0.1204 & -0.057 & 0.3039 & 1.0564 & 9.8706 & 3.1417 \tabularnewline
54 & 0.1499 & -0.0219 & 0.2757 & 0.1009 & 8.8936 & 2.9822 \tabularnewline
55 & 0.2027 & -0.0141 & 0.2519 & 0.0228 & 8.0872 & 2.8438 \tabularnewline
56 & 0.2906 & -0.1873 & 0.2466 & 1.9762 & 7.5779 & 2.7528 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=113019&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.3782[/C][C]-0.4256[/C][C]0[/C][C]4.6171[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]46[/C][C]0.3186[/C][C]-0.9838[/C][C]0.7047[/C][C]36.7364[/C][C]20.6767[/C][C]4.5472[/C][/ROW]
[ROW][C]47[/C][C]0.3071[/C][C]-0.6179[/C][C]0.6757[/C][C]16.3382[/C][C]19.2306[/C][C]4.3853[/C][/ROW]
[ROW][C]48[/C][C]0.2861[/C][C]-0.082[/C][C]0.5273[/C][C]0.358[/C][C]14.5124[/C][C]3.8095[/C][/ROW]
[ROW][C]49[/C][C]0.1835[/C][C]-0.108[/C][C]0.4434[/C][C]1.5553[/C][C]11.921[/C][C]3.4527[/C][/ROW]
[ROW][C]50[/C][C]0.1343[/C][C]-0.2968[/C][C]0.419[/C][C]22.3361[/C][C]13.6568[/C][C]3.6955[/C][/ROW]
[ROW][C]51[/C][C]0.1283[/C][C]0.0355[/C][C]0.3642[/C][C]0.3551[/C][C]11.7566[/C][C]3.4288[/C][/ROW]
[ROW][C]52[/C][C]0.1192[/C][C]0.1289[/C][C]0.3348[/C][C]5.4824[/C][C]10.9723[/C][C]3.3125[/C][/ROW]
[ROW][C]53[/C][C]0.1204[/C][C]-0.057[/C][C]0.3039[/C][C]1.0564[/C][C]9.8706[/C][C]3.1417[/C][/ROW]
[ROW][C]54[/C][C]0.1499[/C][C]-0.0219[/C][C]0.2757[/C][C]0.1009[/C][C]8.8936[/C][C]2.9822[/C][/ROW]
[ROW][C]55[/C][C]0.2027[/C][C]-0.0141[/C][C]0.2519[/C][C]0.0228[/C][C]8.0872[/C][C]2.8438[/C][/ROW]
[ROW][C]56[/C][C]0.2906[/C][C]-0.1873[/C][C]0.2466[/C][C]1.9762[/C][C]7.5779[/C][C]2.7528[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=113019&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=113019&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.3782-0.425604.617100
460.3186-0.98380.704736.736420.67674.5472
470.3071-0.61790.675716.338219.23064.3853
480.2861-0.0820.52730.35814.51243.8095
490.1835-0.1080.44341.555311.9213.4527
500.1343-0.29680.41922.336113.65683.6955
510.12830.03550.36420.355111.75663.4288
520.11920.12890.33485.482410.97233.3125
530.1204-0.0570.30391.05649.87063.1417
540.1499-0.02190.27570.10098.89362.9822
550.2027-0.01410.25190.02288.08722.8438
560.2906-0.18730.24661.97627.57792.7528



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