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 computationFri, 23 Dec 2011 05:40:05 -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/23/t1324636931jfc8pzvyboamzor.htm/, Retrieved Fri, 29 Mar 2024 15:32:42 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=160256, Retrieved Fri, 29 Mar 2024 15:32:42 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact112
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Multiple Regression] [HPC Retail Sales] [2008-03-08 13:40:54] [1c0f2c85e8a48e42648374b3bcceca26]
- RMPD  [Multiple Regression] [WS8 - Multiple Re...] [2010-11-29 21:09:57] [1f5baf2b24e732d76900bb8178fc04e7]
-         [Multiple Regression] [WS8 Multiple Regr...] [2010-11-30 10:52:15] [afe9379cca749d06b3d6872e02cc47ed]
- R         [Multiple Regression] [Workshop 8 Regres...] [2011-11-25 08:53:50] [3deae35ae8526e36953f595ad65f3a1f]
- RMP         [(Partial) Autocorrelation Function] [Autocorrelation] [2011-12-07 12:52:30] [9401a40688cf36283be626153bc5a38b]
- RMP           [Spectral Analysis] [Spectral Analysis] [2011-12-07 13:11:32] [9401a40688cf36283be626153bc5a38b]
- RMP             [ARIMA Backward Selection] [ARIMA Backward Se...] [2011-12-07 14:02:26] [9401a40688cf36283be626153bc5a38b]
- RMP                 [ARIMA Forecasting] [ARIMA forecasting] [2011-12-23 10:40:05] [7524f34f9c6610426249911bb0d7f59b] [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 time1 seconds
R Server'Herman Ole Andreas Wold' @ wold.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 & 1 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ wold.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160256&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]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ wold.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160256&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160256&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 time1 seconds
R Server'Herman Ole Andreas Wold' @ wold.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.00000000001-------
529701.00000000001-------
539049-------
5410190-------
559706-------
569765.00000000001-------
579893-------
589994-------
5910433-------
6010073-------
6110112-------
629266.00000000001-------
639820.00000000001-------
64100979657.84759034.266110329.10260.09990.31790.44990.3179
6591159034.97078422.10449697.2520.40648e-040.48340.0101
661041110184.3959481.063310945.54580.27980.99710.49420.826
6796789704.1389036.55610426.37140.47170.02750.4980.3766
68104089764.34319092.155510491.60030.04140.5920.49930.4404
69101539892.76659210.87410630.60030.24470.08550.49980.5766
70103689993.91739304.377710740.08550.16290.3380.49990.6761
711058110432.96969710.156311215.41030.35540.56460.50.9377
721059710072.98989377.467710825.67860.08620.09290.50.745
731068010111.99649413.521610867.90380.07040.10430.50.7755
7497389265.99898631.31389952.39920.088900.50.0568
7595569819.99969143.601910551.84530.23980.58690.50.5

\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.00000000001 & - & - & - & - & - & - & - \tabularnewline
52 & 9701.00000000001 & - & - & - & - & - & - & - \tabularnewline
53 & 9049 & - & - & - & - & - & - & - \tabularnewline
54 & 10190 & - & - & - & - & - & - & - \tabularnewline
55 & 9706 & - & - & - & - & - & - & - \tabularnewline
56 & 9765.00000000001 & - & - & - & - & - & - & - \tabularnewline
57 & 9893 & - & - & - & - & - & - & - \tabularnewline
58 & 9994 & - & - & - & - & - & - & - \tabularnewline
59 & 10433 & - & - & - & - & - & - & - \tabularnewline
60 & 10073 & - & - & - & - & - & - & - \tabularnewline
61 & 10112 & - & - & - & - & - & - & - \tabularnewline
62 & 9266.00000000001 & - & - & - & - & - & - & - \tabularnewline
63 & 9820.00000000001 & - & - & - & - & - & - & - \tabularnewline
64 & 10097 & 9657.8475 & 9034.2661 & 10329.1026 & 0.0999 & 0.3179 & 0.4499 & 0.3179 \tabularnewline
65 & 9115 & 9034.9707 & 8422.1044 & 9697.252 & 0.4064 & 8e-04 & 0.4834 & 0.0101 \tabularnewline
66 & 10411 & 10184.395 & 9481.0633 & 10945.5458 & 0.2798 & 0.9971 & 0.4942 & 0.826 \tabularnewline
67 & 9678 & 9704.138 & 9036.556 & 10426.3714 & 0.4717 & 0.0275 & 0.498 & 0.3766 \tabularnewline
68 & 10408 & 9764.3431 & 9092.1555 & 10491.6003 & 0.0414 & 0.592 & 0.4993 & 0.4404 \tabularnewline
69 & 10153 & 9892.7665 & 9210.874 & 10630.6003 & 0.2447 & 0.0855 & 0.4998 & 0.5766 \tabularnewline
70 & 10368 & 9993.9173 & 9304.3777 & 10740.0855 & 0.1629 & 0.338 & 0.4999 & 0.6761 \tabularnewline
71 & 10581 & 10432.9696 & 9710.1563 & 11215.4103 & 0.3554 & 0.5646 & 0.5 & 0.9377 \tabularnewline
72 & 10597 & 10072.9898 & 9377.4677 & 10825.6786 & 0.0862 & 0.0929 & 0.5 & 0.745 \tabularnewline
73 & 10680 & 10111.9964 & 9413.5216 & 10867.9038 & 0.0704 & 0.1043 & 0.5 & 0.7755 \tabularnewline
74 & 9738 & 9265.9989 & 8631.3138 & 9952.3992 & 0.0889 & 0 & 0.5 & 0.0568 \tabularnewline
75 & 9556 & 9819.9996 & 9143.6019 & 10551.8453 & 0.2398 & 0.5869 & 0.5 & 0.5 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160256&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.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]9701.00000000001[/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]9706[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]9765.00000000001[/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]9994[/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.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]9820.00000000001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]10097[/C][C]9657.8475[/C][C]9034.2661[/C][C]10329.1026[/C][C]0.0999[/C][C]0.3179[/C][C]0.4499[/C][C]0.3179[/C][/ROW]
[ROW][C]65[/C][C]9115[/C][C]9034.9707[/C][C]8422.1044[/C][C]9697.252[/C][C]0.4064[/C][C]8e-04[/C][C]0.4834[/C][C]0.0101[/C][/ROW]
[ROW][C]66[/C][C]10411[/C][C]10184.395[/C][C]9481.0633[/C][C]10945.5458[/C][C]0.2798[/C][C]0.9971[/C][C]0.4942[/C][C]0.826[/C][/ROW]
[ROW][C]67[/C][C]9678[/C][C]9704.138[/C][C]9036.556[/C][C]10426.3714[/C][C]0.4717[/C][C]0.0275[/C][C]0.498[/C][C]0.3766[/C][/ROW]
[ROW][C]68[/C][C]10408[/C][C]9764.3431[/C][C]9092.1555[/C][C]10491.6003[/C][C]0.0414[/C][C]0.592[/C][C]0.4993[/C][C]0.4404[/C][/ROW]
[ROW][C]69[/C][C]10153[/C][C]9892.7665[/C][C]9210.874[/C][C]10630.6003[/C][C]0.2447[/C][C]0.0855[/C][C]0.4998[/C][C]0.5766[/C][/ROW]
[ROW][C]70[/C][C]10368[/C][C]9993.9173[/C][C]9304.3777[/C][C]10740.0855[/C][C]0.1629[/C][C]0.338[/C][C]0.4999[/C][C]0.6761[/C][/ROW]
[ROW][C]71[/C][C]10581[/C][C]10432.9696[/C][C]9710.1563[/C][C]11215.4103[/C][C]0.3554[/C][C]0.5646[/C][C]0.5[/C][C]0.9377[/C][/ROW]
[ROW][C]72[/C][C]10597[/C][C]10072.9898[/C][C]9377.4677[/C][C]10825.6786[/C][C]0.0862[/C][C]0.0929[/C][C]0.5[/C][C]0.745[/C][/ROW]
[ROW][C]73[/C][C]10680[/C][C]10111.9964[/C][C]9413.5216[/C][C]10867.9038[/C][C]0.0704[/C][C]0.1043[/C][C]0.5[/C][C]0.7755[/C][/ROW]
[ROW][C]74[/C][C]9738[/C][C]9265.9989[/C][C]8631.3138[/C][C]9952.3992[/C][C]0.0889[/C][C]0[/C][C]0.5[/C][C]0.0568[/C][/ROW]
[ROW][C]75[/C][C]9556[/C][C]9819.9996[/C][C]9143.6019[/C][C]10551.8453[/C][C]0.2398[/C][C]0.5869[/C][C]0.5[/C][C]0.5[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160256&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160256&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.00000000001-------
529701.00000000001-------
539049-------
5410190-------
559706-------
569765.00000000001-------
579893-------
589994-------
5910433-------
6010073-------
6110112-------
629266.00000000001-------
639820.00000000001-------
64100979657.84759034.266110329.10260.09990.31790.44990.3179
6591159034.97078422.10449697.2520.40648e-040.48340.0101
661041110184.3959481.063310945.54580.27980.99710.49420.826
6796789704.1389036.55610426.37140.47170.02750.4980.3766
68104089764.34319092.155510491.60030.04140.5920.49930.4404
69101539892.76659210.87410630.60030.24470.08550.49980.5766
70103689993.91739304.377710740.08550.16290.3380.49990.6761
711058110432.96969710.156311215.41030.35540.56460.50.9377
721059710072.98989377.467710825.67860.08620.09290.50.745
731068010111.99649413.521610867.90380.07040.10430.50.7755
7497389265.99898631.31389952.39920.088900.50.0568
7595569819.99969143.601910551.84530.23980.58690.50.5







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
640.03550.04550192854.897800
650.03740.00890.02726404.681799629.7898315.6419
660.03810.02230.025551349.835183536.4715289.0268
670.038-0.00270.0198683.193262823.152250.6455
680.0380.06590.029414294.1777133117.3571364.8525
690.03810.02630.028667721.4752122218.0435349.597
700.03810.03740.0298139937.8967124749.4511353.1989
710.03830.01420.027921912.9984111894.8945334.5069
720.03810.0520.0306274586.7397129971.7662360.516
730.03810.05620.0331322628.0966149237.3992386.3126
740.03780.05090.0347222785.0836155923.5523394.8716
750.038-0.02690.034169695.7736148737.9041385.6655

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
64 & 0.0355 & 0.0455 & 0 & 192854.8978 & 0 & 0 \tabularnewline
65 & 0.0374 & 0.0089 & 0.0272 & 6404.6817 & 99629.7898 & 315.6419 \tabularnewline
66 & 0.0381 & 0.0223 & 0.0255 & 51349.8351 & 83536.4715 & 289.0268 \tabularnewline
67 & 0.038 & -0.0027 & 0.0198 & 683.1932 & 62823.152 & 250.6455 \tabularnewline
68 & 0.038 & 0.0659 & 0.029 & 414294.1777 & 133117.3571 & 364.8525 \tabularnewline
69 & 0.0381 & 0.0263 & 0.0286 & 67721.4752 & 122218.0435 & 349.597 \tabularnewline
70 & 0.0381 & 0.0374 & 0.0298 & 139937.8967 & 124749.4511 & 353.1989 \tabularnewline
71 & 0.0383 & 0.0142 & 0.0279 & 21912.9984 & 111894.8945 & 334.5069 \tabularnewline
72 & 0.0381 & 0.052 & 0.0306 & 274586.7397 & 129971.7662 & 360.516 \tabularnewline
73 & 0.0381 & 0.0562 & 0.0331 & 322628.0966 & 149237.3992 & 386.3126 \tabularnewline
74 & 0.0378 & 0.0509 & 0.0347 & 222785.0836 & 155923.5523 & 394.8716 \tabularnewline
75 & 0.038 & -0.0269 & 0.0341 & 69695.7736 & 148737.9041 & 385.6655 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=160256&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.0355[/C][C]0.0455[/C][C]0[/C][C]192854.8978[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]65[/C][C]0.0374[/C][C]0.0089[/C][C]0.0272[/C][C]6404.6817[/C][C]99629.7898[/C][C]315.6419[/C][/ROW]
[ROW][C]66[/C][C]0.0381[/C][C]0.0223[/C][C]0.0255[/C][C]51349.8351[/C][C]83536.4715[/C][C]289.0268[/C][/ROW]
[ROW][C]67[/C][C]0.038[/C][C]-0.0027[/C][C]0.0198[/C][C]683.1932[/C][C]62823.152[/C][C]250.6455[/C][/ROW]
[ROW][C]68[/C][C]0.038[/C][C]0.0659[/C][C]0.029[/C][C]414294.1777[/C][C]133117.3571[/C][C]364.8525[/C][/ROW]
[ROW][C]69[/C][C]0.0381[/C][C]0.0263[/C][C]0.0286[/C][C]67721.4752[/C][C]122218.0435[/C][C]349.597[/C][/ROW]
[ROW][C]70[/C][C]0.0381[/C][C]0.0374[/C][C]0.0298[/C][C]139937.8967[/C][C]124749.4511[/C][C]353.1989[/C][/ROW]
[ROW][C]71[/C][C]0.0383[/C][C]0.0142[/C][C]0.0279[/C][C]21912.9984[/C][C]111894.8945[/C][C]334.5069[/C][/ROW]
[ROW][C]72[/C][C]0.0381[/C][C]0.052[/C][C]0.0306[/C][C]274586.7397[/C][C]129971.7662[/C][C]360.516[/C][/ROW]
[ROW][C]73[/C][C]0.0381[/C][C]0.0562[/C][C]0.0331[/C][C]322628.0966[/C][C]149237.3992[/C][C]386.3126[/C][/ROW]
[ROW][C]74[/C][C]0.0378[/C][C]0.0509[/C][C]0.0347[/C][C]222785.0836[/C][C]155923.5523[/C][C]394.8716[/C][/ROW]
[ROW][C]75[/C][C]0.038[/C][C]-0.0269[/C][C]0.0341[/C][C]69695.7736[/C][C]148737.9041[/C][C]385.6655[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=160256&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=160256&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.03550.04550192854.897800
650.03740.00890.02726404.681799629.7898315.6419
660.03810.02230.025551349.835183536.4715289.0268
670.038-0.00270.0198683.193262823.152250.6455
680.0380.06590.029414294.1777133117.3571364.8525
690.03810.02630.028667721.4752122218.0435349.597
700.03810.03740.0298139937.8967124749.4511353.1989
710.03830.01420.027921912.9984111894.8945334.5069
720.03810.0520.0306274586.7397129971.7662360.516
730.03810.05620.0331322628.0966149237.3992386.3126
740.03780.05090.0347222785.0836155923.5523394.8716
750.038-0.02690.034169695.7736148737.9041385.6655



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