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, 28 Dec 2009 15:43:50 -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/2009/Dec/28/t1262040375weustysrzbxl0ic.htm/, Retrieved Sun, 05 May 2024 01:51:54 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=71061, Retrieved Sun, 05 May 2024 01:51:54 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsPaper - Arima forecasting
Estimated Impact118
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Bivariate Data Series] [Bivariate dataset] [2008-01-05 23:51:08] [74be16979710d4c4e7c6647856088456]
F RMPD  [Univariate Explorative Data Analysis] [Colombia Coffee] [2008-01-07 14:21:11] [74be16979710d4c4e7c6647856088456]
F RMPD    [Univariate Data Series] [] [2009-10-14 08:30:28] [74be16979710d4c4e7c6647856088456]
- RMPD      [ARIMA Forecasting] [Paper] [2009-12-21 21:25:49] [0df1a6455bedfaf424729b1e006090d0]
- R PD          [ARIMA Forecasting] [Paper - Arima For...] [2009-12-28 22:43:50] [a53416c107f5e7e1e12bb9940270d09d] [Current]
Feedback Forum

Post a new message
Dataseries X:
2,3
2,3
2,6
3,1
2,8
2,5
2,9
3,1
3,1
3,2
2,5
2,6
2,9
2,6
2,4
1,7
2
2,2
1,9
1,6
1,6
1,2
1,2
1,5
1,6
1,7
1,8
1,8
1,8
1,3
1,3
1,4
1,1
1,5
2,2
2,9
3,1
3,5
3,6
4,4
4,2
5,2
5,8
5,9
5,4
5,5
4,7
3,1
2,6
2,3
1,9
0,6
0,6
-0,4
-1,1
-1,7
-0,8
-1,2
-1
-0,1




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71061&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 time4 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[48])
362.9-------
373.1-------
383.5-------
393.6-------
404.4-------
414.2-------
425.2-------
435.8-------
445.9-------
455.4-------
465.5-------
474.7-------
483.1-------
492.62.68162.02363.33970.40390.10640.10640.1064
502.32.19741.16483.23010.42280.22240.00670.0433
511.91.98960.63243.34680.44850.3270.010.0544
520.61.3394-0.30772.98640.18950.25231e-040.0181
530.61.4575-0.45163.36660.18930.81070.00240.0459
54-0.40.9383-1.21013.08660.11110.62121e-040.0243
55-1.10.477-1.89162.84570.0960.76600.015
56-1.70.345-2.22812.91810.05970.864500.0179
57-0.80.8641-1.93.62830.1190.96556e-040.0564
58-1.20.5873-2.35653.53110.1170.82225e-040.0472
59-10.836-2.27773.94970.12390.90.00750.0771
60-0.11.6843-1.59094.95940.14280.94590.19840.1984

\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 & 2.9 & - & - & - & - & - & - & - \tabularnewline
37 & 3.1 & - & - & - & - & - & - & - \tabularnewline
38 & 3.5 & - & - & - & - & - & - & - \tabularnewline
39 & 3.6 & - & - & - & - & - & - & - \tabularnewline
40 & 4.4 & - & - & - & - & - & - & - \tabularnewline
41 & 4.2 & - & - & - & - & - & - & - \tabularnewline
42 & 5.2 & - & - & - & - & - & - & - \tabularnewline
43 & 5.8 & - & - & - & - & - & - & - \tabularnewline
44 & 5.9 & - & - & - & - & - & - & - \tabularnewline
45 & 5.4 & - & - & - & - & - & - & - \tabularnewline
46 & 5.5 & - & - & - & - & - & - & - \tabularnewline
47 & 4.7 & - & - & - & - & - & - & - \tabularnewline
48 & 3.1 & - & - & - & - & - & - & - \tabularnewline
49 & 2.6 & 2.6816 & 2.0236 & 3.3397 & 0.4039 & 0.1064 & 0.1064 & 0.1064 \tabularnewline
50 & 2.3 & 2.1974 & 1.1648 & 3.2301 & 0.4228 & 0.2224 & 0.0067 & 0.0433 \tabularnewline
51 & 1.9 & 1.9896 & 0.6324 & 3.3468 & 0.4485 & 0.327 & 0.01 & 0.0544 \tabularnewline
52 & 0.6 & 1.3394 & -0.3077 & 2.9864 & 0.1895 & 0.2523 & 1e-04 & 0.0181 \tabularnewline
53 & 0.6 & 1.4575 & -0.4516 & 3.3666 & 0.1893 & 0.8107 & 0.0024 & 0.0459 \tabularnewline
54 & -0.4 & 0.9383 & -1.2101 & 3.0866 & 0.1111 & 0.6212 & 1e-04 & 0.0243 \tabularnewline
55 & -1.1 & 0.477 & -1.8916 & 2.8457 & 0.096 & 0.766 & 0 & 0.015 \tabularnewline
56 & -1.7 & 0.345 & -2.2281 & 2.9181 & 0.0597 & 0.8645 & 0 & 0.0179 \tabularnewline
57 & -0.8 & 0.8641 & -1.9 & 3.6283 & 0.119 & 0.9655 & 6e-04 & 0.0564 \tabularnewline
58 & -1.2 & 0.5873 & -2.3565 & 3.5311 & 0.117 & 0.8222 & 5e-04 & 0.0472 \tabularnewline
59 & -1 & 0.836 & -2.2777 & 3.9497 & 0.1239 & 0.9 & 0.0075 & 0.0771 \tabularnewline
60 & -0.1 & 1.6843 & -1.5909 & 4.9594 & 0.1428 & 0.9459 & 0.1984 & 0.1984 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71061&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]2.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]3.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]3.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]3.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]4.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]4.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]5.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]5.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]5.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]5.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]5.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]4.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]3.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]2.6[/C][C]2.6816[/C][C]2.0236[/C][C]3.3397[/C][C]0.4039[/C][C]0.1064[/C][C]0.1064[/C][C]0.1064[/C][/ROW]
[ROW][C]50[/C][C]2.3[/C][C]2.1974[/C][C]1.1648[/C][C]3.2301[/C][C]0.4228[/C][C]0.2224[/C][C]0.0067[/C][C]0.0433[/C][/ROW]
[ROW][C]51[/C][C]1.9[/C][C]1.9896[/C][C]0.6324[/C][C]3.3468[/C][C]0.4485[/C][C]0.327[/C][C]0.01[/C][C]0.0544[/C][/ROW]
[ROW][C]52[/C][C]0.6[/C][C]1.3394[/C][C]-0.3077[/C][C]2.9864[/C][C]0.1895[/C][C]0.2523[/C][C]1e-04[/C][C]0.0181[/C][/ROW]
[ROW][C]53[/C][C]0.6[/C][C]1.4575[/C][C]-0.4516[/C][C]3.3666[/C][C]0.1893[/C][C]0.8107[/C][C]0.0024[/C][C]0.0459[/C][/ROW]
[ROW][C]54[/C][C]-0.4[/C][C]0.9383[/C][C]-1.2101[/C][C]3.0866[/C][C]0.1111[/C][C]0.6212[/C][C]1e-04[/C][C]0.0243[/C][/ROW]
[ROW][C]55[/C][C]-1.1[/C][C]0.477[/C][C]-1.8916[/C][C]2.8457[/C][C]0.096[/C][C]0.766[/C][C]0[/C][C]0.015[/C][/ROW]
[ROW][C]56[/C][C]-1.7[/C][C]0.345[/C][C]-2.2281[/C][C]2.9181[/C][C]0.0597[/C][C]0.8645[/C][C]0[/C][C]0.0179[/C][/ROW]
[ROW][C]57[/C][C]-0.8[/C][C]0.8641[/C][C]-1.9[/C][C]3.6283[/C][C]0.119[/C][C]0.9655[/C][C]6e-04[/C][C]0.0564[/C][/ROW]
[ROW][C]58[/C][C]-1.2[/C][C]0.5873[/C][C]-2.3565[/C][C]3.5311[/C][C]0.117[/C][C]0.8222[/C][C]5e-04[/C][C]0.0472[/C][/ROW]
[ROW][C]59[/C][C]-1[/C][C]0.836[/C][C]-2.2777[/C][C]3.9497[/C][C]0.1239[/C][C]0.9[/C][C]0.0075[/C][C]0.0771[/C][/ROW]
[ROW][C]60[/C][C]-0.1[/C][C]1.6843[/C][C]-1.5909[/C][C]4.9594[/C][C]0.1428[/C][C]0.9459[/C][C]0.1984[/C][C]0.1984[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71061&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71061&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])
362.9-------
373.1-------
383.5-------
393.6-------
404.4-------
414.2-------
425.2-------
435.8-------
445.9-------
455.4-------
465.5-------
474.7-------
483.1-------
492.62.68162.02363.33970.40390.10640.10640.1064
502.32.19741.16483.23010.42280.22240.00670.0433
511.91.98960.63243.34680.44850.3270.010.0544
520.61.3394-0.30772.98640.18950.25231e-040.0181
530.61.4575-0.45163.36660.18930.81070.00240.0459
54-0.40.9383-1.21013.08660.11110.62121e-040.0243
55-1.10.477-1.89162.84570.0960.76600.015
56-1.70.345-2.22812.91810.05970.864500.0179
57-0.80.8641-1.93.62830.1190.96556e-040.0564
58-1.20.5873-2.35653.53110.1170.82225e-040.0472
59-10.836-2.27773.94970.12390.90.00750.0771
60-0.11.6843-1.59094.95940.14280.94590.19840.1984







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.1252-0.030400.006700
500.23980.04670.03860.01050.00860.0927
510.348-0.0450.04070.0080.00840.0917
520.6274-0.5520.16850.54670.1430.3781
530.6683-0.58830.25250.73530.26140.5113
541.1682-1.42630.44811.7910.51640.7186
552.5334-3.30590.85642.48710.79790.8932
563.8056-5.9281.49034.18191.22091.1049
571.632-1.92581.53872.76931.39291.1802
582.5575-3.04331.68923.19441.57311.2542
591.9004-2.19621.73533.37071.73651.3178
600.9921-1.05941.6793.18361.85711.3628

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.1252 & -0.0304 & 0 & 0.0067 & 0 & 0 \tabularnewline
50 & 0.2398 & 0.0467 & 0.0386 & 0.0105 & 0.0086 & 0.0927 \tabularnewline
51 & 0.348 & -0.045 & 0.0407 & 0.008 & 0.0084 & 0.0917 \tabularnewline
52 & 0.6274 & -0.552 & 0.1685 & 0.5467 & 0.143 & 0.3781 \tabularnewline
53 & 0.6683 & -0.5883 & 0.2525 & 0.7353 & 0.2614 & 0.5113 \tabularnewline
54 & 1.1682 & -1.4263 & 0.4481 & 1.791 & 0.5164 & 0.7186 \tabularnewline
55 & 2.5334 & -3.3059 & 0.8564 & 2.4871 & 0.7979 & 0.8932 \tabularnewline
56 & 3.8056 & -5.928 & 1.4903 & 4.1819 & 1.2209 & 1.1049 \tabularnewline
57 & 1.632 & -1.9258 & 1.5387 & 2.7693 & 1.3929 & 1.1802 \tabularnewline
58 & 2.5575 & -3.0433 & 1.6892 & 3.1944 & 1.5731 & 1.2542 \tabularnewline
59 & 1.9004 & -2.1962 & 1.7353 & 3.3707 & 1.7365 & 1.3178 \tabularnewline
60 & 0.9921 & -1.0594 & 1.679 & 3.1836 & 1.8571 & 1.3628 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71061&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.1252[/C][C]-0.0304[/C][C]0[/C][C]0.0067[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.2398[/C][C]0.0467[/C][C]0.0386[/C][C]0.0105[/C][C]0.0086[/C][C]0.0927[/C][/ROW]
[ROW][C]51[/C][C]0.348[/C][C]-0.045[/C][C]0.0407[/C][C]0.008[/C][C]0.0084[/C][C]0.0917[/C][/ROW]
[ROW][C]52[/C][C]0.6274[/C][C]-0.552[/C][C]0.1685[/C][C]0.5467[/C][C]0.143[/C][C]0.3781[/C][/ROW]
[ROW][C]53[/C][C]0.6683[/C][C]-0.5883[/C][C]0.2525[/C][C]0.7353[/C][C]0.2614[/C][C]0.5113[/C][/ROW]
[ROW][C]54[/C][C]1.1682[/C][C]-1.4263[/C][C]0.4481[/C][C]1.791[/C][C]0.5164[/C][C]0.7186[/C][/ROW]
[ROW][C]55[/C][C]2.5334[/C][C]-3.3059[/C][C]0.8564[/C][C]2.4871[/C][C]0.7979[/C][C]0.8932[/C][/ROW]
[ROW][C]56[/C][C]3.8056[/C][C]-5.928[/C][C]1.4903[/C][C]4.1819[/C][C]1.2209[/C][C]1.1049[/C][/ROW]
[ROW][C]57[/C][C]1.632[/C][C]-1.9258[/C][C]1.5387[/C][C]2.7693[/C][C]1.3929[/C][C]1.1802[/C][/ROW]
[ROW][C]58[/C][C]2.5575[/C][C]-3.0433[/C][C]1.6892[/C][C]3.1944[/C][C]1.5731[/C][C]1.2542[/C][/ROW]
[ROW][C]59[/C][C]1.9004[/C][C]-2.1962[/C][C]1.7353[/C][C]3.3707[/C][C]1.7365[/C][C]1.3178[/C][/ROW]
[ROW][C]60[/C][C]0.9921[/C][C]-1.0594[/C][C]1.679[/C][C]3.1836[/C][C]1.8571[/C][C]1.3628[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71061&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71061&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.1252-0.030400.006700
500.23980.04670.03860.01050.00860.0927
510.348-0.0450.04070.0080.00840.0917
520.6274-0.5520.16850.54670.1430.3781
530.6683-0.58830.25250.73530.26140.5113
541.1682-1.42630.44811.7910.51640.7186
552.5334-3.30590.85642.48710.79790.8932
563.8056-5.9281.49034.18191.22091.1049
571.632-1.92581.53872.76931.39291.1802
582.5575-3.04331.68923.19441.57311.2542
591.9004-2.19621.73533.37071.73651.3178
600.9921-1.05941.6793.18361.85711.3628



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