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, 18 Dec 2012 14:34:23 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2012/Dec/18/t1355859281at4hmo3806johaw.htm/, Retrieved Thu, 28 Mar 2024 12:23:35 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=201606, Retrieved Thu, 28 Mar 2024 12:23:35 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact98
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   [ARIMA Backward Selection] [] [2011-12-06 19:59:13] [b98453cac15ba1066b407e146608df68]
- R PD    [ARIMA Backward Selection] [Maandelijks geboo...] [2012-12-15 10:01:40] [dc1c1ef052cd9b8b4f9db3f2b24d140d]
-   P       [ARIMA Backward Selection] [paper - ARIMA] [2012-12-18 19:20:35] [00d51cc5abcfaf80a667f39a85fc0ddc]
- RMP           [ARIMA Forecasting] [Paper - ARIMA For...] [2012-12-18 19:34:23] [0ab7a1f5c5e2896cc7067de738ff1e9d] [Current]
Feedback Forum

Post a new message
Dataseries X:
9769
9321
9939
9336
10195
9464
10010
10213
9563
9890
9305
9391
9928
8686
9843
9627
10074
9503
10119
10000
9313
9866
9172
9241
9659
8904
9755
9080
9435
8971
10063
9793
9454
9759
8820
9403
9676
8642
9402
9610
9294
9448
10319
9548
9801
9596
8923
9746
9829
9125
9782
9441
9162
9915
10444
10209
9985
9842
9429
10132
9849
9172
10313
9819
9955
10048
10082
10541
10208
10233
9439
9963
10158
9225
10474
9757
10490
10281
10444
10640
10695
10786
9832
9747
10411
9511
10402
9701
10540
10112
10915
11183
10384
10834
9886
10216
10943
9867
10203
10837
10573
10647
11502
10656
10866
10835
9945
10331
10718
9462
10579
10633
10346
10757
11207
11013
11015
10765
10042
10661




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net

\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 & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=201606&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]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=201606&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=201606&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'Gertrude Mary Cox' @ cox.wessa.net







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[108])
9610216-------
9710943-------
989867-------
9910203-------
10010837-------
10110573-------
10210647-------
10311502-------
10410656-------
10510866-------
10610835-------
1079945-------
10810331-------
1091071810865.075810288.775811494.81630.32360.95180.40420.9518
11094629851.23729357.362410388.17950.07778e-040.47710.0399
1111057910622.490810053.714111244.55750.44550.99990.90690.8208
1121063310526.00159957.99211147.68360.36790.43360.16340.7307
1131034610687.463110097.417711334.67590.15060.56550.63560.8598
1141075710570.55199982.92911215.53920.28550.75250.40810.7667
1151120711302.994710641.717712032.55930.39820.92880.29650.9955
1161101310964.888210326.673211668.63740.44670.25010.80520.9613
1171101510783.846710154.74111477.71340.25690.25870.40820.8996
1181076510901.876310254.603811617.08560.35380.37830.57270.9411
1191004210038.29849463.510671.06470.49540.01220.61370.1823
1201066110445.30389827.001711128.28670.2680.87640.62860.6286

\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[108]) \tabularnewline
96 & 10216 & - & - & - & - & - & - & - \tabularnewline
97 & 10943 & - & - & - & - & - & - & - \tabularnewline
98 & 9867 & - & - & - & - & - & - & - \tabularnewline
99 & 10203 & - & - & - & - & - & - & - \tabularnewline
100 & 10837 & - & - & - & - & - & - & - \tabularnewline
101 & 10573 & - & - & - & - & - & - & - \tabularnewline
102 & 10647 & - & - & - & - & - & - & - \tabularnewline
103 & 11502 & - & - & - & - & - & - & - \tabularnewline
104 & 10656 & - & - & - & - & - & - & - \tabularnewline
105 & 10866 & - & - & - & - & - & - & - \tabularnewline
106 & 10835 & - & - & - & - & - & - & - \tabularnewline
107 & 9945 & - & - & - & - & - & - & - \tabularnewline
108 & 10331 & - & - & - & - & - & - & - \tabularnewline
109 & 10718 & 10865.0758 & 10288.7758 & 11494.8163 & 0.3236 & 0.9518 & 0.4042 & 0.9518 \tabularnewline
110 & 9462 & 9851.2372 & 9357.3624 & 10388.1795 & 0.0777 & 8e-04 & 0.4771 & 0.0399 \tabularnewline
111 & 10579 & 10622.4908 & 10053.7141 & 11244.5575 & 0.4455 & 0.9999 & 0.9069 & 0.8208 \tabularnewline
112 & 10633 & 10526.0015 & 9957.992 & 11147.6836 & 0.3679 & 0.4336 & 0.1634 & 0.7307 \tabularnewline
113 & 10346 & 10687.4631 & 10097.4177 & 11334.6759 & 0.1506 & 0.5655 & 0.6356 & 0.8598 \tabularnewline
114 & 10757 & 10570.5519 & 9982.929 & 11215.5392 & 0.2855 & 0.7525 & 0.4081 & 0.7667 \tabularnewline
115 & 11207 & 11302.9947 & 10641.7177 & 12032.5593 & 0.3982 & 0.9288 & 0.2965 & 0.9955 \tabularnewline
116 & 11013 & 10964.8882 & 10326.6732 & 11668.6374 & 0.4467 & 0.2501 & 0.8052 & 0.9613 \tabularnewline
117 & 11015 & 10783.8467 & 10154.741 & 11477.7134 & 0.2569 & 0.2587 & 0.4082 & 0.8996 \tabularnewline
118 & 10765 & 10901.8763 & 10254.6038 & 11617.0856 & 0.3538 & 0.3783 & 0.5727 & 0.9411 \tabularnewline
119 & 10042 & 10038.2984 & 9463.5 & 10671.0647 & 0.4954 & 0.0122 & 0.6137 & 0.1823 \tabularnewline
120 & 10661 & 10445.3038 & 9827.0017 & 11128.2867 & 0.268 & 0.8764 & 0.6286 & 0.6286 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=201606&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[108])[/C][/ROW]
[ROW][C]96[/C][C]10216[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]10943[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]9867[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]10203[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]10837[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]10573[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]10647[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]11502[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]10656[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]10866[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]10835[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]9945[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]10331[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]10718[/C][C]10865.0758[/C][C]10288.7758[/C][C]11494.8163[/C][C]0.3236[/C][C]0.9518[/C][C]0.4042[/C][C]0.9518[/C][/ROW]
[ROW][C]110[/C][C]9462[/C][C]9851.2372[/C][C]9357.3624[/C][C]10388.1795[/C][C]0.0777[/C][C]8e-04[/C][C]0.4771[/C][C]0.0399[/C][/ROW]
[ROW][C]111[/C][C]10579[/C][C]10622.4908[/C][C]10053.7141[/C][C]11244.5575[/C][C]0.4455[/C][C]0.9999[/C][C]0.9069[/C][C]0.8208[/C][/ROW]
[ROW][C]112[/C][C]10633[/C][C]10526.0015[/C][C]9957.992[/C][C]11147.6836[/C][C]0.3679[/C][C]0.4336[/C][C]0.1634[/C][C]0.7307[/C][/ROW]
[ROW][C]113[/C][C]10346[/C][C]10687.4631[/C][C]10097.4177[/C][C]11334.6759[/C][C]0.1506[/C][C]0.5655[/C][C]0.6356[/C][C]0.8598[/C][/ROW]
[ROW][C]114[/C][C]10757[/C][C]10570.5519[/C][C]9982.929[/C][C]11215.5392[/C][C]0.2855[/C][C]0.7525[/C][C]0.4081[/C][C]0.7667[/C][/ROW]
[ROW][C]115[/C][C]11207[/C][C]11302.9947[/C][C]10641.7177[/C][C]12032.5593[/C][C]0.3982[/C][C]0.9288[/C][C]0.2965[/C][C]0.9955[/C][/ROW]
[ROW][C]116[/C][C]11013[/C][C]10964.8882[/C][C]10326.6732[/C][C]11668.6374[/C][C]0.4467[/C][C]0.2501[/C][C]0.8052[/C][C]0.9613[/C][/ROW]
[ROW][C]117[/C][C]11015[/C][C]10783.8467[/C][C]10154.741[/C][C]11477.7134[/C][C]0.2569[/C][C]0.2587[/C][C]0.4082[/C][C]0.8996[/C][/ROW]
[ROW][C]118[/C][C]10765[/C][C]10901.8763[/C][C]10254.6038[/C][C]11617.0856[/C][C]0.3538[/C][C]0.3783[/C][C]0.5727[/C][C]0.9411[/C][/ROW]
[ROW][C]119[/C][C]10042[/C][C]10038.2984[/C][C]9463.5[/C][C]10671.0647[/C][C]0.4954[/C][C]0.0122[/C][C]0.6137[/C][C]0.1823[/C][/ROW]
[ROW][C]120[/C][C]10661[/C][C]10445.3038[/C][C]9827.0017[/C][C]11128.2867[/C][C]0.268[/C][C]0.8764[/C][C]0.6286[/C][C]0.6286[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=201606&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=201606&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[108])
9610216-------
9710943-------
989867-------
9910203-------
10010837-------
10110573-------
10210647-------
10311502-------
10410656-------
10510866-------
10610835-------
1079945-------
10810331-------
1091071810865.075810288.775811494.81630.32360.95180.40420.9518
11094629851.23729357.362410388.17950.07778e-040.47710.0399
1111057910622.490810053.714111244.55750.44550.99990.90690.8208
1121063310526.00159957.99211147.68360.36790.43360.16340.7307
1131034610687.463110097.417711334.67590.15060.56550.63560.8598
1141075710570.55199982.92911215.53920.28550.75250.40810.7667
1151120711302.994710641.717712032.55930.39820.92880.29650.9955
1161101310964.888210326.673211668.63740.44670.25010.80520.9613
1171101510783.846710154.74111477.71340.25690.25870.40820.8996
1181076510901.876310254.603811617.08560.35380.37830.57270.9411
1191004210038.29849463.510671.06470.49540.01220.61370.1823
1201066110445.30389827.001711128.28670.2680.87640.62860.6286







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1090.0296-0.0135021631.291400
1100.0278-0.03950.0265151505.574286568.4328294.2251
1110.0299-0.00410.0191891.452258342.7726241.5425
1120.03010.01020.016811448.675246619.2483215.9149
1130.0309-0.03190.0199116597.059760614.8105246.2008
1140.03110.01760.019534762.901556306.159237.2892
1150.0329-0.00850.01799214.990549578.8493222.6631
1160.03270.00440.01622314.74943670.8367208.9757
1170.03280.02140.016853431.84844755.3935211.5547
1180.0335-0.01260.016418735.117842153.366205.3128
1190.03224e-040.014913.701938322.4874195.7613
1200.03340.02070.015446524.865339006.0189197.4994

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
109 & 0.0296 & -0.0135 & 0 & 21631.2914 & 0 & 0 \tabularnewline
110 & 0.0278 & -0.0395 & 0.0265 & 151505.5742 & 86568.4328 & 294.2251 \tabularnewline
111 & 0.0299 & -0.0041 & 0.019 & 1891.4522 & 58342.7726 & 241.5425 \tabularnewline
112 & 0.0301 & 0.0102 & 0.0168 & 11448.6752 & 46619.2483 & 215.9149 \tabularnewline
113 & 0.0309 & -0.0319 & 0.0199 & 116597.0597 & 60614.8105 & 246.2008 \tabularnewline
114 & 0.0311 & 0.0176 & 0.0195 & 34762.9015 & 56306.159 & 237.2892 \tabularnewline
115 & 0.0329 & -0.0085 & 0.0179 & 9214.9905 & 49578.8493 & 222.6631 \tabularnewline
116 & 0.0327 & 0.0044 & 0.0162 & 2314.749 & 43670.8367 & 208.9757 \tabularnewline
117 & 0.0328 & 0.0214 & 0.0168 & 53431.848 & 44755.3935 & 211.5547 \tabularnewline
118 & 0.0335 & -0.0126 & 0.0164 & 18735.1178 & 42153.366 & 205.3128 \tabularnewline
119 & 0.0322 & 4e-04 & 0.0149 & 13.7019 & 38322.4874 & 195.7613 \tabularnewline
120 & 0.0334 & 0.0207 & 0.0154 & 46524.8653 & 39006.0189 & 197.4994 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=201606&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]109[/C][C]0.0296[/C][C]-0.0135[/C][C]0[/C][C]21631.2914[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]110[/C][C]0.0278[/C][C]-0.0395[/C][C]0.0265[/C][C]151505.5742[/C][C]86568.4328[/C][C]294.2251[/C][/ROW]
[ROW][C]111[/C][C]0.0299[/C][C]-0.0041[/C][C]0.019[/C][C]1891.4522[/C][C]58342.7726[/C][C]241.5425[/C][/ROW]
[ROW][C]112[/C][C]0.0301[/C][C]0.0102[/C][C]0.0168[/C][C]11448.6752[/C][C]46619.2483[/C][C]215.9149[/C][/ROW]
[ROW][C]113[/C][C]0.0309[/C][C]-0.0319[/C][C]0.0199[/C][C]116597.0597[/C][C]60614.8105[/C][C]246.2008[/C][/ROW]
[ROW][C]114[/C][C]0.0311[/C][C]0.0176[/C][C]0.0195[/C][C]34762.9015[/C][C]56306.159[/C][C]237.2892[/C][/ROW]
[ROW][C]115[/C][C]0.0329[/C][C]-0.0085[/C][C]0.0179[/C][C]9214.9905[/C][C]49578.8493[/C][C]222.6631[/C][/ROW]
[ROW][C]116[/C][C]0.0327[/C][C]0.0044[/C][C]0.0162[/C][C]2314.749[/C][C]43670.8367[/C][C]208.9757[/C][/ROW]
[ROW][C]117[/C][C]0.0328[/C][C]0.0214[/C][C]0.0168[/C][C]53431.848[/C][C]44755.3935[/C][C]211.5547[/C][/ROW]
[ROW][C]118[/C][C]0.0335[/C][C]-0.0126[/C][C]0.0164[/C][C]18735.1178[/C][C]42153.366[/C][C]205.3128[/C][/ROW]
[ROW][C]119[/C][C]0.0322[/C][C]4e-04[/C][C]0.0149[/C][C]13.7019[/C][C]38322.4874[/C][C]195.7613[/C][/ROW]
[ROW][C]120[/C][C]0.0334[/C][C]0.0207[/C][C]0.0154[/C][C]46524.8653[/C][C]39006.0189[/C][C]197.4994[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=201606&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=201606&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
1090.0296-0.0135021631.291400
1100.0278-0.03950.0265151505.574286568.4328294.2251
1110.0299-0.00410.0191891.452258342.7726241.5425
1120.03010.01020.016811448.675246619.2483215.9149
1130.0309-0.03190.0199116597.059760614.8105246.2008
1140.03110.01760.019534762.901556306.159237.2892
1150.0329-0.00850.01799214.990549578.8493222.6631
1160.03270.00440.01622314.74943670.8367208.9757
1170.03280.02140.016853431.84844755.3935211.5547
1180.0335-0.01260.016418735.117842153.366205.3128
1190.03224e-040.014913.701938322.4874195.7613
1200.03340.02070.015446524.865339006.0189197.4994



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