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, 06 Dec 2011 03:24:20 -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/2011/Dec/06/t1323159875h888n7ffs1x2wsp.htm/, Retrieved Sun, 28 Apr 2024 19:37:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=151376, Retrieved Sun, 28 Apr 2024 19:37:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact132
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]
- RMP   [Standard Deviation-Mean Plot] [Unemployment] [2010-11-29 10:34:47] [b98453cac15ba1066b407e146608df68]
- RMP     [ARIMA Backward Selection] [Unemployment] [2010-11-29 17:10:28] [b98453cac15ba1066b407e146608df68]
-   P       [ARIMA Backward Selection] [WS9] [2011-12-01 14:57:06] [088a244c534fec2347300624359db3c1]
- RM          [ARIMA Forecasting] [WS9] [2011-12-01 15:11:31] [088a244c534fec2347300624359db3c1]
- R PD          [ARIMA Forecasting] [WS 9 Arima Foreca...] [2011-12-03 16:46:10] [4f1f864fb932bb9c9d0c6cb0c11f4a44]
-   P             [ARIMA Forecasting] [WS 9 Arima foreca...] [2011-12-05 15:36:56] [4f1f864fb932bb9c9d0c6cb0c11f4a44]
-                     [ARIMA Forecasting] [arima forecast ws9] [2011-12-06 08:24:20] [76a85a4cc6ea7903d92a0f5b9d2872d3] [Current]
-   P                   [ARIMA Forecasting] [arima forecast paper] [2011-12-16 16:19:32] [74be16979710d4c4e7c6647856088456]
Feedback Forum

Post a new message
Dataseries X:
117541.78
116587
116809
122819.55
116955
117186
117265
117536
117781
117928
120437.52
121753.21
119369.88
118622
118885
124998.3
119369
119647
119879
120075
120295
120538
123250.68
124631.03
122443.31
121532
121844
128241.75
122391
122644
122927
122909
123417
123756
126540.18
128088.74
125874.28
124817
124961
131499.9
125639
125851
125970
126322
126540
126733
129557.34
131179.77
128754.8
127890
127996
134790.6
128585
128851
129142
129334
129536
129944
132842.76
134447.96
132088.81
130902
131374
138243
131885
131839
132002
132005
132127
132116
134993.94
136459.55




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151376&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'George Udny Yule' @ yule.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[60])
48131179.77-------
49128754.8-------
50127890-------
51127996-------
52134790.6-------
53128585-------
54128851-------
55129142-------
56129334-------
57129536-------
58129944-------
59132842.76-------
60134447.96-------
61132088.81132022.99131697.7093132348.27070.3458010
62130902131158.19130698.1736131618.20640.1375010
63131374131264.19130700.7872131827.59280.35120.896210
64138243138058.79137408.2285138709.35150.2895111
65131885131853.19131125.8402132580.53980.4658010
66131839132119.19131322.4182132915.96180.24530.717710
67132002132410.19131549.5781133270.80190.17630.903310
68132005132602.19131682.1571133522.22290.10160.899510
69132127132804.19131828.3478133780.03220.08690.945815e-04
70132116133212.19132183.562134240.8180.01840.980710.0093
71134993.94136110.95135032.1158137189.78420.0212110.9987
72136459.55137716.15136589.3445138842.95550.0144111

\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[60]) \tabularnewline
48 & 131179.77 & - & - & - & - & - & - & - \tabularnewline
49 & 128754.8 & - & - & - & - & - & - & - \tabularnewline
50 & 127890 & - & - & - & - & - & - & - \tabularnewline
51 & 127996 & - & - & - & - & - & - & - \tabularnewline
52 & 134790.6 & - & - & - & - & - & - & - \tabularnewline
53 & 128585 & - & - & - & - & - & - & - \tabularnewline
54 & 128851 & - & - & - & - & - & - & - \tabularnewline
55 & 129142 & - & - & - & - & - & - & - \tabularnewline
56 & 129334 & - & - & - & - & - & - & - \tabularnewline
57 & 129536 & - & - & - & - & - & - & - \tabularnewline
58 & 129944 & - & - & - & - & - & - & - \tabularnewline
59 & 132842.76 & - & - & - & - & - & - & - \tabularnewline
60 & 134447.96 & - & - & - & - & - & - & - \tabularnewline
61 & 132088.81 & 132022.99 & 131697.7093 & 132348.2707 & 0.3458 & 0 & 1 & 0 \tabularnewline
62 & 130902 & 131158.19 & 130698.1736 & 131618.2064 & 0.1375 & 0 & 1 & 0 \tabularnewline
63 & 131374 & 131264.19 & 130700.7872 & 131827.5928 & 0.3512 & 0.8962 & 1 & 0 \tabularnewline
64 & 138243 & 138058.79 & 137408.2285 & 138709.3515 & 0.2895 & 1 & 1 & 1 \tabularnewline
65 & 131885 & 131853.19 & 131125.8402 & 132580.5398 & 0.4658 & 0 & 1 & 0 \tabularnewline
66 & 131839 & 132119.19 & 131322.4182 & 132915.9618 & 0.2453 & 0.7177 & 1 & 0 \tabularnewline
67 & 132002 & 132410.19 & 131549.5781 & 133270.8019 & 0.1763 & 0.9033 & 1 & 0 \tabularnewline
68 & 132005 & 132602.19 & 131682.1571 & 133522.2229 & 0.1016 & 0.8995 & 1 & 0 \tabularnewline
69 & 132127 & 132804.19 & 131828.3478 & 133780.0322 & 0.0869 & 0.9458 & 1 & 5e-04 \tabularnewline
70 & 132116 & 133212.19 & 132183.562 & 134240.818 & 0.0184 & 0.9807 & 1 & 0.0093 \tabularnewline
71 & 134993.94 & 136110.95 & 135032.1158 & 137189.7842 & 0.0212 & 1 & 1 & 0.9987 \tabularnewline
72 & 136459.55 & 137716.15 & 136589.3445 & 138842.9555 & 0.0144 & 1 & 1 & 1 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151376&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[60])[/C][/ROW]
[ROW][C]48[/C][C]131179.77[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]128754.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]127890[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]127996[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]134790.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]128585[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]128851[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]129142[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]129334[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]129536[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]129944[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]132842.76[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]134447.96[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]132088.81[/C][C]132022.99[/C][C]131697.7093[/C][C]132348.2707[/C][C]0.3458[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[ROW][C]62[/C][C]130902[/C][C]131158.19[/C][C]130698.1736[/C][C]131618.2064[/C][C]0.1375[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[ROW][C]63[/C][C]131374[/C][C]131264.19[/C][C]130700.7872[/C][C]131827.5928[/C][C]0.3512[/C][C]0.8962[/C][C]1[/C][C]0[/C][/ROW]
[ROW][C]64[/C][C]138243[/C][C]138058.79[/C][C]137408.2285[/C][C]138709.3515[/C][C]0.2895[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]65[/C][C]131885[/C][C]131853.19[/C][C]131125.8402[/C][C]132580.5398[/C][C]0.4658[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[ROW][C]66[/C][C]131839[/C][C]132119.19[/C][C]131322.4182[/C][C]132915.9618[/C][C]0.2453[/C][C]0.7177[/C][C]1[/C][C]0[/C][/ROW]
[ROW][C]67[/C][C]132002[/C][C]132410.19[/C][C]131549.5781[/C][C]133270.8019[/C][C]0.1763[/C][C]0.9033[/C][C]1[/C][C]0[/C][/ROW]
[ROW][C]68[/C][C]132005[/C][C]132602.19[/C][C]131682.1571[/C][C]133522.2229[/C][C]0.1016[/C][C]0.8995[/C][C]1[/C][C]0[/C][/ROW]
[ROW][C]69[/C][C]132127[/C][C]132804.19[/C][C]131828.3478[/C][C]133780.0322[/C][C]0.0869[/C][C]0.9458[/C][C]1[/C][C]5e-04[/C][/ROW]
[ROW][C]70[/C][C]132116[/C][C]133212.19[/C][C]132183.562[/C][C]134240.818[/C][C]0.0184[/C][C]0.9807[/C][C]1[/C][C]0.0093[/C][/ROW]
[ROW][C]71[/C][C]134993.94[/C][C]136110.95[/C][C]135032.1158[/C][C]137189.7842[/C][C]0.0212[/C][C]1[/C][C]1[/C][C]0.9987[/C][/ROW]
[ROW][C]72[/C][C]136459.55[/C][C]137716.15[/C][C]136589.3445[/C][C]138842.9555[/C][C]0.0144[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151376&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151376&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[60])
48131179.77-------
49128754.8-------
50127890-------
51127996-------
52134790.6-------
53128585-------
54128851-------
55129142-------
56129334-------
57129536-------
58129944-------
59132842.76-------
60134447.96-------
61132088.81132022.99131697.7093132348.27070.3458010
62130902131158.19130698.1736131618.20640.1375010
63131374131264.19130700.7872131827.59280.35120.896210
64138243138058.79137408.2285138709.35150.2895111
65131885131853.19131125.8402132580.53980.4658010
66131839132119.19131322.4182132915.96180.24530.717710
67132002132410.19131549.5781133270.80190.17630.903310
68132005132602.19131682.1571133522.22290.10160.899510
69132127132804.19131828.3478133780.03220.08690.945815e-04
70132116133212.19132183.562134240.8180.01840.980710.0093
71134993.94136110.95135032.1158137189.78420.0212110.9987
72136459.55137716.15136589.3445138842.95550.0144111







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
610.00135e-0404332.272400
620.0018-0.0020.001265633.316134982.7943187.0369
630.00228e-040.001112058.236127341.2749165.352
640.00240.00130.001233933.324128989.2872170.2624
650.00282e-040.0011011.876123393.805152.9503
660.0031-0.00210.001278506.436132579.2435180.4972
670.0033-0.00310.0014166619.076151727.791227.4374
680.0035-0.00450.0018356635.896189841.3041299.7354
690.0037-0.00510.0022458586.2961130812.9699361.6808
700.0039-0.00820.00281201632.5161237894.9245487.7447
710.004-0.00820.00331247711.3401329696.4169574.192
720.0042-0.00910.00381579043.56433808.6788658.6415

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & 0.0013 & 5e-04 & 0 & 4332.2724 & 0 & 0 \tabularnewline
62 & 0.0018 & -0.002 & 0.0012 & 65633.3161 & 34982.7943 & 187.0369 \tabularnewline
63 & 0.0022 & 8e-04 & 0.0011 & 12058.2361 & 27341.2749 & 165.352 \tabularnewline
64 & 0.0024 & 0.0013 & 0.0012 & 33933.3241 & 28989.2872 & 170.2624 \tabularnewline
65 & 0.0028 & 2e-04 & 0.001 & 1011.8761 & 23393.805 & 152.9503 \tabularnewline
66 & 0.0031 & -0.0021 & 0.0012 & 78506.4361 & 32579.2435 & 180.4972 \tabularnewline
67 & 0.0033 & -0.0031 & 0.0014 & 166619.0761 & 51727.791 & 227.4374 \tabularnewline
68 & 0.0035 & -0.0045 & 0.0018 & 356635.8961 & 89841.3041 & 299.7354 \tabularnewline
69 & 0.0037 & -0.0051 & 0.0022 & 458586.2961 & 130812.9699 & 361.6808 \tabularnewline
70 & 0.0039 & -0.0082 & 0.0028 & 1201632.5161 & 237894.9245 & 487.7447 \tabularnewline
71 & 0.004 & -0.0082 & 0.0033 & 1247711.3401 & 329696.4169 & 574.192 \tabularnewline
72 & 0.0042 & -0.0091 & 0.0038 & 1579043.56 & 433808.6788 & 658.6415 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151376&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]61[/C][C]0.0013[/C][C]5e-04[/C][C]0[/C][C]4332.2724[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]62[/C][C]0.0018[/C][C]-0.002[/C][C]0.0012[/C][C]65633.3161[/C][C]34982.7943[/C][C]187.0369[/C][/ROW]
[ROW][C]63[/C][C]0.0022[/C][C]8e-04[/C][C]0.0011[/C][C]12058.2361[/C][C]27341.2749[/C][C]165.352[/C][/ROW]
[ROW][C]64[/C][C]0.0024[/C][C]0.0013[/C][C]0.0012[/C][C]33933.3241[/C][C]28989.2872[/C][C]170.2624[/C][/ROW]
[ROW][C]65[/C][C]0.0028[/C][C]2e-04[/C][C]0.001[/C][C]1011.8761[/C][C]23393.805[/C][C]152.9503[/C][/ROW]
[ROW][C]66[/C][C]0.0031[/C][C]-0.0021[/C][C]0.0012[/C][C]78506.4361[/C][C]32579.2435[/C][C]180.4972[/C][/ROW]
[ROW][C]67[/C][C]0.0033[/C][C]-0.0031[/C][C]0.0014[/C][C]166619.0761[/C][C]51727.791[/C][C]227.4374[/C][/ROW]
[ROW][C]68[/C][C]0.0035[/C][C]-0.0045[/C][C]0.0018[/C][C]356635.8961[/C][C]89841.3041[/C][C]299.7354[/C][/ROW]
[ROW][C]69[/C][C]0.0037[/C][C]-0.0051[/C][C]0.0022[/C][C]458586.2961[/C][C]130812.9699[/C][C]361.6808[/C][/ROW]
[ROW][C]70[/C][C]0.0039[/C][C]-0.0082[/C][C]0.0028[/C][C]1201632.5161[/C][C]237894.9245[/C][C]487.7447[/C][/ROW]
[ROW][C]71[/C][C]0.004[/C][C]-0.0082[/C][C]0.0033[/C][C]1247711.3401[/C][C]329696.4169[/C][C]574.192[/C][/ROW]
[ROW][C]72[/C][C]0.0042[/C][C]-0.0091[/C][C]0.0038[/C][C]1579043.56[/C][C]433808.6788[/C][C]658.6415[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151376&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151376&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
610.00135e-0404332.272400
620.0018-0.0020.001265633.316134982.7943187.0369
630.00228e-040.001112058.236127341.2749165.352
640.00240.00130.001233933.324128989.2872170.2624
650.00282e-040.0011011.876123393.805152.9503
660.0031-0.00210.001278506.436132579.2435180.4972
670.0033-0.00310.0014166619.076151727.791227.4374
680.0035-0.00450.0018356635.896189841.3041299.7354
690.0037-0.00510.0022458586.2961130812.9699361.6808
700.0039-0.00820.00281201632.5161237894.9245487.7447
710.004-0.00820.00331247711.3401329696.4169574.192
720.0042-0.00910.00381579043.56433808.6788658.6415



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