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 computationSun, 16 Dec 2012 16:22:12 -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/16/t1355693022rw6h736fkc439ez.htm/, Retrieved Thu, 31 Oct 2024 23:22:21 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=200613, Retrieved Thu, 31 Oct 2024 23:22:21 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact162
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]
- R               [ARIMA Forecasting] [ARIMA model (fore...] [2012-11-24 16:42:59] [0dc867bfbaab36a894719867823e3cb9]
- R P                 [ARIMA Forecasting] [Arima forecasting] [2012-12-16 21:22:12] [447cab31e466d1c88f957d20e303ed40] [Current]
Feedback Forum

Post a new message
Dataseries X:
9700
9081
9084
9743
8587
9731
9563
9998
9437
10038
9918
9252
9737
9035
9133
9487
8700
9627
8947
9283
8829
9947
9628
9318
9605
8640
9214
9567
8547
9185
9470
9123
9278
10170
9434
9655
9429
8739
9552
9687
9019
9672
9206
9069
9788
10312
10105
9863
9656
9295
9946
9701
9049
10190
9706
9765
9893
9994
10433
10073
10112
9266
9820
10097
9115
10411
9678
10408
10153
10368
10581
10597
10680
9738
9556




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=200613&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' @ jenkins.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[63])
519946-------
529701-------
539049-------
5410190-------
559705.99999999999-------
569764.99999999999-------
579893-------
589993.99999999999-------
5910433-------
6010073-------
6110112-------
629266-------
639820-------
64100979920.44339373.525810499.27180.2750.63310.77130.6331
6591159112.33748601.85129653.1190.49622e-040.59080.0052
661041110156.72699579.327310768.92960.20780.99960.45760.8595
6796789764.68179202.064610361.69740.3880.01690.57640.4279
68104089846.20589271.86510456.12380.03550.70560.60290.5336
69101539862.35219280.538410480.64080.17840.04180.46130.5534
701036810258.67389647.18110908.92650.37090.6250.78750.907
711058110358.82159735.469511022.08610.25570.48920.41320.9443
721059710008.22419400.708910654.99970.03720.04130.42220.7158
731068010083.34169470.058710736.34090.03670.06160.46570.7854
7497389302.80428732.57919910.26430.080100.54730.0476
7595569776.53729172.933610419.85950.25080.54670.44730.4473

\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[63]) \tabularnewline
51 & 9946 & - & - & - & - & - & - & - \tabularnewline
52 & 9701 & - & - & - & - & - & - & - \tabularnewline
53 & 9049 & - & - & - & - & - & - & - \tabularnewline
54 & 10190 & - & - & - & - & - & - & - \tabularnewline
55 & 9705.99999999999 & - & - & - & - & - & - & - \tabularnewline
56 & 9764.99999999999 & - & - & - & - & - & - & - \tabularnewline
57 & 9893 & - & - & - & - & - & - & - \tabularnewline
58 & 9993.99999999999 & - & - & - & - & - & - & - \tabularnewline
59 & 10433 & - & - & - & - & - & - & - \tabularnewline
60 & 10073 & - & - & - & - & - & - & - \tabularnewline
61 & 10112 & - & - & - & - & - & - & - \tabularnewline
62 & 9266 & - & - & - & - & - & - & - \tabularnewline
63 & 9820 & - & - & - & - & - & - & - \tabularnewline
64 & 10097 & 9920.4433 & 9373.5258 & 10499.2718 & 0.275 & 0.6331 & 0.7713 & 0.6331 \tabularnewline
65 & 9115 & 9112.3374 & 8601.8512 & 9653.119 & 0.4962 & 2e-04 & 0.5908 & 0.0052 \tabularnewline
66 & 10411 & 10156.7269 & 9579.3273 & 10768.9296 & 0.2078 & 0.9996 & 0.4576 & 0.8595 \tabularnewline
67 & 9678 & 9764.6817 & 9202.0646 & 10361.6974 & 0.388 & 0.0169 & 0.5764 & 0.4279 \tabularnewline
68 & 10408 & 9846.2058 & 9271.865 & 10456.1238 & 0.0355 & 0.7056 & 0.6029 & 0.5336 \tabularnewline
69 & 10153 & 9862.3521 & 9280.5384 & 10480.6408 & 0.1784 & 0.0418 & 0.4613 & 0.5534 \tabularnewline
70 & 10368 & 10258.6738 & 9647.181 & 10908.9265 & 0.3709 & 0.625 & 0.7875 & 0.907 \tabularnewline
71 & 10581 & 10358.8215 & 9735.4695 & 11022.0861 & 0.2557 & 0.4892 & 0.4132 & 0.9443 \tabularnewline
72 & 10597 & 10008.2241 & 9400.7089 & 10654.9997 & 0.0372 & 0.0413 & 0.4222 & 0.7158 \tabularnewline
73 & 10680 & 10083.3416 & 9470.0587 & 10736.3409 & 0.0367 & 0.0616 & 0.4657 & 0.7854 \tabularnewline
74 & 9738 & 9302.8042 & 8732.5791 & 9910.2643 & 0.0801 & 0 & 0.5473 & 0.0476 \tabularnewline
75 & 9556 & 9776.5372 & 9172.9336 & 10419.8595 & 0.2508 & 0.5467 & 0.4473 & 0.4473 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=200613&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[63])[/C][/ROW]
[ROW][C]51[/C][C]9946[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]9701[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]9049[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]10190[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]9705.99999999999[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]9764.99999999999[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]9893[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]9993.99999999999[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]10433[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]10073[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]10112[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]9266[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]9820[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]10097[/C][C]9920.4433[/C][C]9373.5258[/C][C]10499.2718[/C][C]0.275[/C][C]0.6331[/C][C]0.7713[/C][C]0.6331[/C][/ROW]
[ROW][C]65[/C][C]9115[/C][C]9112.3374[/C][C]8601.8512[/C][C]9653.119[/C][C]0.4962[/C][C]2e-04[/C][C]0.5908[/C][C]0.0052[/C][/ROW]
[ROW][C]66[/C][C]10411[/C][C]10156.7269[/C][C]9579.3273[/C][C]10768.9296[/C][C]0.2078[/C][C]0.9996[/C][C]0.4576[/C][C]0.8595[/C][/ROW]
[ROW][C]67[/C][C]9678[/C][C]9764.6817[/C][C]9202.0646[/C][C]10361.6974[/C][C]0.388[/C][C]0.0169[/C][C]0.5764[/C][C]0.4279[/C][/ROW]
[ROW][C]68[/C][C]10408[/C][C]9846.2058[/C][C]9271.865[/C][C]10456.1238[/C][C]0.0355[/C][C]0.7056[/C][C]0.6029[/C][C]0.5336[/C][/ROW]
[ROW][C]69[/C][C]10153[/C][C]9862.3521[/C][C]9280.5384[/C][C]10480.6408[/C][C]0.1784[/C][C]0.0418[/C][C]0.4613[/C][C]0.5534[/C][/ROW]
[ROW][C]70[/C][C]10368[/C][C]10258.6738[/C][C]9647.181[/C][C]10908.9265[/C][C]0.3709[/C][C]0.625[/C][C]0.7875[/C][C]0.907[/C][/ROW]
[ROW][C]71[/C][C]10581[/C][C]10358.8215[/C][C]9735.4695[/C][C]11022.0861[/C][C]0.2557[/C][C]0.4892[/C][C]0.4132[/C][C]0.9443[/C][/ROW]
[ROW][C]72[/C][C]10597[/C][C]10008.2241[/C][C]9400.7089[/C][C]10654.9997[/C][C]0.0372[/C][C]0.0413[/C][C]0.4222[/C][C]0.7158[/C][/ROW]
[ROW][C]73[/C][C]10680[/C][C]10083.3416[/C][C]9470.0587[/C][C]10736.3409[/C][C]0.0367[/C][C]0.0616[/C][C]0.4657[/C][C]0.7854[/C][/ROW]
[ROW][C]74[/C][C]9738[/C][C]9302.8042[/C][C]8732.5791[/C][C]9910.2643[/C][C]0.0801[/C][C]0[/C][C]0.5473[/C][C]0.0476[/C][/ROW]
[ROW][C]75[/C][C]9556[/C][C]9776.5372[/C][C]9172.9336[/C][C]10419.8595[/C][C]0.2508[/C][C]0.5467[/C][C]0.4473[/C][C]0.4473[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=200613&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=200613&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[63])
519946-------
529701-------
539049-------
5410190-------
559705.99999999999-------
569764.99999999999-------
579893-------
589993.99999999999-------
5910433-------
6010073-------
6110112-------
629266-------
639820-------
64100979920.44339373.525810499.27180.2750.63310.77130.6331
6591159112.33748601.85129653.1190.49622e-040.59080.0052
661041110156.72699579.327310768.92960.20780.99960.45760.8595
6796789764.68179202.064610361.69740.3880.01690.57640.4279
68104089846.20589271.86510456.12380.03550.70560.60290.5336
69101539862.35219280.538410480.64080.17840.04180.46130.5534
701036810258.67389647.18110908.92650.37090.6250.78750.907
711058110358.82159735.469511022.08610.25570.48920.41320.9443
721059710008.22419400.708910654.99970.03720.04130.42220.7158
731068010083.34169470.058710736.34090.03670.06160.46570.7854
7497389302.80428732.57919910.26430.080100.54730.0476
7595569776.53729172.933610419.85950.25080.54670.44730.4473







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
640.02980.0178031172.272200
650.03033e-040.0097.089215589.6807124.8586
660.03080.0250.014464654.820131944.7272178.7309
670.0312-0.00890.0137513.716725836.9745160.7388
680.03160.05710.0218315612.718383792.1233289.4687
690.0320.02950.023184476.192983906.1349289.6656
700.03230.01070.021311952.21273627.003271.343
710.03270.02140.021349363.269170594.0363265.6954
720.0330.05880.0255346657.0149101267.7006318.2259
730.0330.05920.0289356001.2314126741.0537356.0071
740.03330.04680.0305189395.342132436.8981363.9188
750.0336-0.02260.029848636.6515125453.5442354.1942

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
64 & 0.0298 & 0.0178 & 0 & 31172.2722 & 0 & 0 \tabularnewline
65 & 0.0303 & 3e-04 & 0.009 & 7.0892 & 15589.6807 & 124.8586 \tabularnewline
66 & 0.0308 & 0.025 & 0.0144 & 64654.8201 & 31944.7272 & 178.7309 \tabularnewline
67 & 0.0312 & -0.0089 & 0.013 & 7513.7167 & 25836.9745 & 160.7388 \tabularnewline
68 & 0.0316 & 0.0571 & 0.0218 & 315612.7183 & 83792.1233 & 289.4687 \tabularnewline
69 & 0.032 & 0.0295 & 0.0231 & 84476.1929 & 83906.1349 & 289.6656 \tabularnewline
70 & 0.0323 & 0.0107 & 0.0213 & 11952.212 & 73627.003 & 271.343 \tabularnewline
71 & 0.0327 & 0.0214 & 0.0213 & 49363.2691 & 70594.0363 & 265.6954 \tabularnewline
72 & 0.033 & 0.0588 & 0.0255 & 346657.0149 & 101267.7006 & 318.2259 \tabularnewline
73 & 0.033 & 0.0592 & 0.0289 & 356001.2314 & 126741.0537 & 356.0071 \tabularnewline
74 & 0.0333 & 0.0468 & 0.0305 & 189395.342 & 132436.8981 & 363.9188 \tabularnewline
75 & 0.0336 & -0.0226 & 0.0298 & 48636.6515 & 125453.5442 & 354.1942 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=200613&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]64[/C][C]0.0298[/C][C]0.0178[/C][C]0[/C][C]31172.2722[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]65[/C][C]0.0303[/C][C]3e-04[/C][C]0.009[/C][C]7.0892[/C][C]15589.6807[/C][C]124.8586[/C][/ROW]
[ROW][C]66[/C][C]0.0308[/C][C]0.025[/C][C]0.0144[/C][C]64654.8201[/C][C]31944.7272[/C][C]178.7309[/C][/ROW]
[ROW][C]67[/C][C]0.0312[/C][C]-0.0089[/C][C]0.013[/C][C]7513.7167[/C][C]25836.9745[/C][C]160.7388[/C][/ROW]
[ROW][C]68[/C][C]0.0316[/C][C]0.0571[/C][C]0.0218[/C][C]315612.7183[/C][C]83792.1233[/C][C]289.4687[/C][/ROW]
[ROW][C]69[/C][C]0.032[/C][C]0.0295[/C][C]0.0231[/C][C]84476.1929[/C][C]83906.1349[/C][C]289.6656[/C][/ROW]
[ROW][C]70[/C][C]0.0323[/C][C]0.0107[/C][C]0.0213[/C][C]11952.212[/C][C]73627.003[/C][C]271.343[/C][/ROW]
[ROW][C]71[/C][C]0.0327[/C][C]0.0214[/C][C]0.0213[/C][C]49363.2691[/C][C]70594.0363[/C][C]265.6954[/C][/ROW]
[ROW][C]72[/C][C]0.033[/C][C]0.0588[/C][C]0.0255[/C][C]346657.0149[/C][C]101267.7006[/C][C]318.2259[/C][/ROW]
[ROW][C]73[/C][C]0.033[/C][C]0.0592[/C][C]0.0289[/C][C]356001.2314[/C][C]126741.0537[/C][C]356.0071[/C][/ROW]
[ROW][C]74[/C][C]0.0333[/C][C]0.0468[/C][C]0.0305[/C][C]189395.342[/C][C]132436.8981[/C][C]363.9188[/C][/ROW]
[ROW][C]75[/C][C]0.0336[/C][C]-0.0226[/C][C]0.0298[/C][C]48636.6515[/C][C]125453.5442[/C][C]354.1942[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=200613&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=200613&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
640.02980.0178031172.272200
650.03033e-040.0097.089215589.6807124.8586
660.03080.0250.014464654.820131944.7272178.7309
670.0312-0.00890.0137513.716725836.9745160.7388
680.03160.05710.0218315612.718383792.1233289.4687
690.0320.02950.023184476.192983906.1349289.6656
700.03230.01070.021311952.21273627.003271.343
710.03270.02140.021349363.269170594.0363265.6954
720.0330.05880.0255346657.0149101267.7006318.2259
730.0330.05920.0289356001.2314126741.0537356.0071
740.03330.04680.0305189395.342132436.8981363.9188
750.0336-0.02260.029848636.6515125453.5442354.1942



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