Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 17 Dec 2008 00:41:12 -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/2008/Dec/17/t1229499697rb48wyp6chvvtp0.htm/, Retrieved Sun, 19 May 2024 05:34:52 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=34265, Retrieved Sun, 19 May 2024 05:34:52 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact188
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F       [ARIMA Forecasting] [] [2008-12-17 07:41:12] [ee5aee65e0c44ac54c8097a6e28e37f4] [Current]
Feedback Forum
2008-12-22 15:44:15 [Gert-Jan Geudens] [reply
Step 1 is correct. De laatste kolommen zijn echter niet besproken.
P(F[t]>Y[t-s]) = Dit is de kans dat de waarde die we voorspellen, groter is dan de werkelijke waarde van dezelfde maand van het jaar voorheen.

P(F[t]>Y[48]) = Dit is de kans dat we een grotere waarde dan de laatste gekende waarde gaan krijgen

Step 2 : Geen antwoord gegeven
Step 3 : Geen antwoord gegeven
Step 4 : Geen antwoord gegeven
Step 5 : Geen antwoord gegeven
2008-12-23 17:10:51 [Glenn Maras] [reply
De berekeningen zijn correct uitgevoerd maar de vragen zijn niet opgelost. Er zijn alleen enkele dingen opgeschreven die in de tabel staan en wat ze juist betekenenmaar de vragen zijn niet beantwoord.

Post a new message
Dataseries X:
9.984
9.732
9.103
9.155
9.308
9.394
9.948
10.177
10.002
9.728
10.002
10.063
10.018
9.960
10.236
10.893
10.756
10.940
10.997
10.827
10.166
10.186
10.457
10.368
10.244
10.511
10.812
10.738
10.171
9.721
9.897
9.828
9.924
10.371
10.846
10.413
10.709
10.662
10.570
10.297
10.635
10.872
10.296
10.383
10.431
10.574
10.653
10.805
10.872
10.625
10.407
10.463
10.556
10.646
10.702
11.353
11.346
11.451
11.964
12.574
13.031
13.812
14.544
14.931
14.886
16.005
17.064
15.168
16.050
15.839
15.137
14.954
15.648
15.305
15.579
16.348
15.928
16.171
15.937
15.713
15.594
15.683
16.438
17.032
17.696
17.745
19.394
20.148
20.108
18.584
18.441
18.391
19.178
18.079
18.483
19.644
19.195




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34265&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'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[85])
7315.648-------
7415.305-------
7515.579-------
7616.348-------
7715.928-------
7816.171-------
7915.937-------
8015.713-------
8115.594-------
8215.683-------
8316.438-------
8417.032-------
8517.696-------
8617.74517.958216.645519.43250.38840.63630.99980.6363
8719.39417.674615.763419.95550.06980.47590.96410.4927
8820.14817.693615.406320.53090.0450.12010.82370.4993
8920.10817.613514.990220.99090.07390.07070.8360.4809
9018.58417.599514.718121.41790.30670.09890.76830.4802
9118.44117.474114.368221.70780.32720.30370.76160.4591
9218.39117.679614.310822.39460.38370.37580.79320.4973
9319.17817.565914.022522.6440.26690.37510.77670.48
9418.07917.606813.874423.07570.43280.28670.75470.4872
9518.48317.460513.600123.23220.36420.41680.63580.4681
9619.64417.407213.41123.49710.23580.36460.54810.463
9719.19517.210613.131123.53470.26930.22540.44020.4402

\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[85]) \tabularnewline
73 & 15.648 & - & - & - & - & - & - & - \tabularnewline
74 & 15.305 & - & - & - & - & - & - & - \tabularnewline
75 & 15.579 & - & - & - & - & - & - & - \tabularnewline
76 & 16.348 & - & - & - & - & - & - & - \tabularnewline
77 & 15.928 & - & - & - & - & - & - & - \tabularnewline
78 & 16.171 & - & - & - & - & - & - & - \tabularnewline
79 & 15.937 & - & - & - & - & - & - & - \tabularnewline
80 & 15.713 & - & - & - & - & - & - & - \tabularnewline
81 & 15.594 & - & - & - & - & - & - & - \tabularnewline
82 & 15.683 & - & - & - & - & - & - & - \tabularnewline
83 & 16.438 & - & - & - & - & - & - & - \tabularnewline
84 & 17.032 & - & - & - & - & - & - & - \tabularnewline
85 & 17.696 & - & - & - & - & - & - & - \tabularnewline
86 & 17.745 & 17.9582 & 16.6455 & 19.4325 & 0.3884 & 0.6363 & 0.9998 & 0.6363 \tabularnewline
87 & 19.394 & 17.6746 & 15.7634 & 19.9555 & 0.0698 & 0.4759 & 0.9641 & 0.4927 \tabularnewline
88 & 20.148 & 17.6936 & 15.4063 & 20.5309 & 0.045 & 0.1201 & 0.8237 & 0.4993 \tabularnewline
89 & 20.108 & 17.6135 & 14.9902 & 20.9909 & 0.0739 & 0.0707 & 0.836 & 0.4809 \tabularnewline
90 & 18.584 & 17.5995 & 14.7181 & 21.4179 & 0.3067 & 0.0989 & 0.7683 & 0.4802 \tabularnewline
91 & 18.441 & 17.4741 & 14.3682 & 21.7078 & 0.3272 & 0.3037 & 0.7616 & 0.4591 \tabularnewline
92 & 18.391 & 17.6796 & 14.3108 & 22.3946 & 0.3837 & 0.3758 & 0.7932 & 0.4973 \tabularnewline
93 & 19.178 & 17.5659 & 14.0225 & 22.644 & 0.2669 & 0.3751 & 0.7767 & 0.48 \tabularnewline
94 & 18.079 & 17.6068 & 13.8744 & 23.0757 & 0.4328 & 0.2867 & 0.7547 & 0.4872 \tabularnewline
95 & 18.483 & 17.4605 & 13.6001 & 23.2322 & 0.3642 & 0.4168 & 0.6358 & 0.4681 \tabularnewline
96 & 19.644 & 17.4072 & 13.411 & 23.4971 & 0.2358 & 0.3646 & 0.5481 & 0.463 \tabularnewline
97 & 19.195 & 17.2106 & 13.1311 & 23.5347 & 0.2693 & 0.2254 & 0.4402 & 0.4402 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34265&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[85])[/C][/ROW]
[ROW][C]73[/C][C]15.648[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]74[/C][C]15.305[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]75[/C][C]15.579[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]76[/C][C]16.348[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]77[/C][C]15.928[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]78[/C][C]16.171[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]15.937[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]15.713[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]15.594[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]15.683[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]83[/C][C]16.438[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]84[/C][C]17.032[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]17.696[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]17.745[/C][C]17.9582[/C][C]16.6455[/C][C]19.4325[/C][C]0.3884[/C][C]0.6363[/C][C]0.9998[/C][C]0.6363[/C][/ROW]
[ROW][C]87[/C][C]19.394[/C][C]17.6746[/C][C]15.7634[/C][C]19.9555[/C][C]0.0698[/C][C]0.4759[/C][C]0.9641[/C][C]0.4927[/C][/ROW]
[ROW][C]88[/C][C]20.148[/C][C]17.6936[/C][C]15.4063[/C][C]20.5309[/C][C]0.045[/C][C]0.1201[/C][C]0.8237[/C][C]0.4993[/C][/ROW]
[ROW][C]89[/C][C]20.108[/C][C]17.6135[/C][C]14.9902[/C][C]20.9909[/C][C]0.0739[/C][C]0.0707[/C][C]0.836[/C][C]0.4809[/C][/ROW]
[ROW][C]90[/C][C]18.584[/C][C]17.5995[/C][C]14.7181[/C][C]21.4179[/C][C]0.3067[/C][C]0.0989[/C][C]0.7683[/C][C]0.4802[/C][/ROW]
[ROW][C]91[/C][C]18.441[/C][C]17.4741[/C][C]14.3682[/C][C]21.7078[/C][C]0.3272[/C][C]0.3037[/C][C]0.7616[/C][C]0.4591[/C][/ROW]
[ROW][C]92[/C][C]18.391[/C][C]17.6796[/C][C]14.3108[/C][C]22.3946[/C][C]0.3837[/C][C]0.3758[/C][C]0.7932[/C][C]0.4973[/C][/ROW]
[ROW][C]93[/C][C]19.178[/C][C]17.5659[/C][C]14.0225[/C][C]22.644[/C][C]0.2669[/C][C]0.3751[/C][C]0.7767[/C][C]0.48[/C][/ROW]
[ROW][C]94[/C][C]18.079[/C][C]17.6068[/C][C]13.8744[/C][C]23.0757[/C][C]0.4328[/C][C]0.2867[/C][C]0.7547[/C][C]0.4872[/C][/ROW]
[ROW][C]95[/C][C]18.483[/C][C]17.4605[/C][C]13.6001[/C][C]23.2322[/C][C]0.3642[/C][C]0.4168[/C][C]0.6358[/C][C]0.4681[/C][/ROW]
[ROW][C]96[/C][C]19.644[/C][C]17.4072[/C][C]13.411[/C][C]23.4971[/C][C]0.2358[/C][C]0.3646[/C][C]0.5481[/C][C]0.463[/C][/ROW]
[ROW][C]97[/C][C]19.195[/C][C]17.2106[/C][C]13.1311[/C][C]23.5347[/C][C]0.2693[/C][C]0.2254[/C][C]0.4402[/C][C]0.4402[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34265&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34265&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[85])
7315.648-------
7415.305-------
7515.579-------
7616.348-------
7715.928-------
7816.171-------
7915.937-------
8015.713-------
8115.594-------
8215.683-------
8316.438-------
8417.032-------
8517.696-------
8617.74517.958216.645519.43250.38840.63630.99980.6363
8719.39417.674615.763419.95550.06980.47590.96410.4927
8820.14817.693615.406320.53090.0450.12010.82370.4993
8920.10817.613514.990220.99090.07390.07070.8360.4809
9018.58417.599514.718121.41790.30670.09890.76830.4802
9118.44117.474114.368221.70780.32720.30370.76160.4591
9218.39117.679614.310822.39460.38370.37580.79320.4973
9319.17817.565914.022522.6440.26690.37510.77670.48
9418.07917.606813.874423.07570.43280.28670.75470.4872
9518.48317.460513.600123.23220.36420.41680.63580.4681
9619.64417.407213.41123.49710.23580.36460.54810.463
9719.19517.210613.131123.53470.26930.22540.44020.4402







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
860.0419-0.01190.0010.04550.00380.0615
870.06580.09730.00812.95640.24640.4964
880.08180.13870.01166.02390.5020.7085
890.09780.14160.01186.22230.51850.7201
900.11070.05590.00470.96930.08080.2842
910.12360.05530.00460.93490.07790.2791
920.13610.04020.00340.50610.04220.2054
930.14750.09180.00762.59880.21660.4654
940.15850.02680.00220.2230.01860.1363
950.16870.05860.00491.04550.08710.2952
960.17850.12850.01075.00330.41690.6457
970.18750.11530.00963.93790.32820.5729

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
86 & 0.0419 & -0.0119 & 0.001 & 0.0455 & 0.0038 & 0.0615 \tabularnewline
87 & 0.0658 & 0.0973 & 0.0081 & 2.9564 & 0.2464 & 0.4964 \tabularnewline
88 & 0.0818 & 0.1387 & 0.0116 & 6.0239 & 0.502 & 0.7085 \tabularnewline
89 & 0.0978 & 0.1416 & 0.0118 & 6.2223 & 0.5185 & 0.7201 \tabularnewline
90 & 0.1107 & 0.0559 & 0.0047 & 0.9693 & 0.0808 & 0.2842 \tabularnewline
91 & 0.1236 & 0.0553 & 0.0046 & 0.9349 & 0.0779 & 0.2791 \tabularnewline
92 & 0.1361 & 0.0402 & 0.0034 & 0.5061 & 0.0422 & 0.2054 \tabularnewline
93 & 0.1475 & 0.0918 & 0.0076 & 2.5988 & 0.2166 & 0.4654 \tabularnewline
94 & 0.1585 & 0.0268 & 0.0022 & 0.223 & 0.0186 & 0.1363 \tabularnewline
95 & 0.1687 & 0.0586 & 0.0049 & 1.0455 & 0.0871 & 0.2952 \tabularnewline
96 & 0.1785 & 0.1285 & 0.0107 & 5.0033 & 0.4169 & 0.6457 \tabularnewline
97 & 0.1875 & 0.1153 & 0.0096 & 3.9379 & 0.3282 & 0.5729 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34265&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]86[/C][C]0.0419[/C][C]-0.0119[/C][C]0.001[/C][C]0.0455[/C][C]0.0038[/C][C]0.0615[/C][/ROW]
[ROW][C]87[/C][C]0.0658[/C][C]0.0973[/C][C]0.0081[/C][C]2.9564[/C][C]0.2464[/C][C]0.4964[/C][/ROW]
[ROW][C]88[/C][C]0.0818[/C][C]0.1387[/C][C]0.0116[/C][C]6.0239[/C][C]0.502[/C][C]0.7085[/C][/ROW]
[ROW][C]89[/C][C]0.0978[/C][C]0.1416[/C][C]0.0118[/C][C]6.2223[/C][C]0.5185[/C][C]0.7201[/C][/ROW]
[ROW][C]90[/C][C]0.1107[/C][C]0.0559[/C][C]0.0047[/C][C]0.9693[/C][C]0.0808[/C][C]0.2842[/C][/ROW]
[ROW][C]91[/C][C]0.1236[/C][C]0.0553[/C][C]0.0046[/C][C]0.9349[/C][C]0.0779[/C][C]0.2791[/C][/ROW]
[ROW][C]92[/C][C]0.1361[/C][C]0.0402[/C][C]0.0034[/C][C]0.5061[/C][C]0.0422[/C][C]0.2054[/C][/ROW]
[ROW][C]93[/C][C]0.1475[/C][C]0.0918[/C][C]0.0076[/C][C]2.5988[/C][C]0.2166[/C][C]0.4654[/C][/ROW]
[ROW][C]94[/C][C]0.1585[/C][C]0.0268[/C][C]0.0022[/C][C]0.223[/C][C]0.0186[/C][C]0.1363[/C][/ROW]
[ROW][C]95[/C][C]0.1687[/C][C]0.0586[/C][C]0.0049[/C][C]1.0455[/C][C]0.0871[/C][C]0.2952[/C][/ROW]
[ROW][C]96[/C][C]0.1785[/C][C]0.1285[/C][C]0.0107[/C][C]5.0033[/C][C]0.4169[/C][C]0.6457[/C][/ROW]
[ROW][C]97[/C][C]0.1875[/C][C]0.1153[/C][C]0.0096[/C][C]3.9379[/C][C]0.3282[/C][C]0.5729[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34265&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34265&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
860.0419-0.01190.0010.04550.00380.0615
870.06580.09730.00812.95640.24640.4964
880.08180.13870.01166.02390.5020.7085
890.09780.14160.01186.22230.51850.7201
900.11070.05590.00470.96930.08080.2842
910.12360.05530.00460.93490.07790.2791
920.13610.04020.00340.50610.04220.2054
930.14750.09180.00762.59880.21660.4654
940.15850.02680.00220.2230.01860.1363
950.16870.05860.00491.04550.08710.2952
960.17850.12850.01075.00330.41690.6457
970.18750.11530.00963.93790.32820.5729



Parameters (Session):
par1 = 12 ; par2 = -0.5 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 2 ; par7 = 1 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = -0.5 ; par3 = 1 ; par4 = 0 ; 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,fx))
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')