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, 11 Dec 2009 13:47:14 -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/2009/Dec/11/t1260564512guepl2xh2zgwqpl.htm/, Retrieved Mon, 29 Apr 2024 04:46:41 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=66780, Retrieved Mon, 29 Apr 2024 04:46:41 +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)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
- R PD  [ARIMA Forecasting] [ARIMA-Forecasting] [2009-12-09 16:48:03] [ee7c2e7343f5b1451e62c5c16ec521f1]
-   PD    [ARIMA Forecasting] [ARIMA forecasting] [2009-12-10 08:34:29] [a542c511726eba04a1fc2f4bd37a90f8]
-   PD        [ARIMA Forecasting] [Arima forecasting] [2009-12-11 20:47:14] [d79e31a57591875d497c91f296c77132] [Current]
-   PD          [ARIMA Forecasting] [ARIMA forecasting] [2009-12-11 22:18:44] [4b453aa14d54730625f8d3de5f1f6d82]
Feedback Forum

Post a new message
Dataseries X:
91,98
91,72
90,27
91,89
92,07
92,92
93,34
93,60
92,41
93,60
93,77
93,60
93,60
93,51
92,66
94,20
94,37
94,45
94,62
94,37
93,43
94,79
94,88
94,79
94,62
94,71
93,77
95,73
95,99
95,82
95,47
95,82
94,71
96,33
96,50
96,16
96,33
96,33
95,05
96,84
96,92
97,44
97,78
97,69
96,67
98,29
98,20
98,71
98,54
98,20
96,92
99,06
99,65
99,82
99,99
100,33
99,31
101,10
101,10
100,93
100,85
100,93
99,60
101,88
101,81
102,38
102,74
102,82
101,72
103,47
102,98
102,68
102,90
103,03
101,29
103,69
103,68
104,20
104,08
104,16
103,05
104,66
104,46
104,95
105,85
106,23
104,86
107,44
108,23
108,45
109,39
110,15
109,13
110,28
110,17
109,99
109,26
109,11
107,06
109,53
108,92
109,24
109,12
109,00
107,23
109,49
109,04
109,02




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66780&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' @ 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[96])
84104.95-------
85105.85-------
86106.23-------
87104.86-------
88107.44-------
89108.23-------
90108.45-------
91109.39-------
92110.15-------
93109.13-------
94110.28-------
95110.17-------
96109.99-------
97109.26110.3433109.705110.98174e-040.86110.861
98109.11110.4854109.5556111.41520.00190.995110.8518
99107.06109.0811107.9138110.24843e-040.480710.0635
100109.53111.4015110.0254112.77760.0038110.9778
101108.92111.7582110.1925113.32392e-040.997410.9866
102109.24112.1087110.368113.84956e-040.999810.9915
103109.12112.5149110.6107114.4192e-040.99960.99940.9953
104109112.8624110.8045114.92021e-040.99980.99510.9969
105107.23111.8038109.6006114.00700.99370.99130.9467
106109.49113.2668110.9255115.60818e-0410.99380.997
107109.04113.1159110.6429115.58896e-040.9980.99020.9934
108109.02113.1135110.5145115.71240.0010.99890.99080.9908

\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[96]) \tabularnewline
84 & 104.95 & - & - & - & - & - & - & - \tabularnewline
85 & 105.85 & - & - & - & - & - & - & - \tabularnewline
86 & 106.23 & - & - & - & - & - & - & - \tabularnewline
87 & 104.86 & - & - & - & - & - & - & - \tabularnewline
88 & 107.44 & - & - & - & - & - & - & - \tabularnewline
89 & 108.23 & - & - & - & - & - & - & - \tabularnewline
90 & 108.45 & - & - & - & - & - & - & - \tabularnewline
91 & 109.39 & - & - & - & - & - & - & - \tabularnewline
92 & 110.15 & - & - & - & - & - & - & - \tabularnewline
93 & 109.13 & - & - & - & - & - & - & - \tabularnewline
94 & 110.28 & - & - & - & - & - & - & - \tabularnewline
95 & 110.17 & - & - & - & - & - & - & - \tabularnewline
96 & 109.99 & - & - & - & - & - & - & - \tabularnewline
97 & 109.26 & 110.3433 & 109.705 & 110.9817 & 4e-04 & 0.861 & 1 & 0.861 \tabularnewline
98 & 109.11 & 110.4854 & 109.5556 & 111.4152 & 0.0019 & 0.9951 & 1 & 0.8518 \tabularnewline
99 & 107.06 & 109.0811 & 107.9138 & 110.2484 & 3e-04 & 0.4807 & 1 & 0.0635 \tabularnewline
100 & 109.53 & 111.4015 & 110.0254 & 112.7776 & 0.0038 & 1 & 1 & 0.9778 \tabularnewline
101 & 108.92 & 111.7582 & 110.1925 & 113.3239 & 2e-04 & 0.9974 & 1 & 0.9866 \tabularnewline
102 & 109.24 & 112.1087 & 110.368 & 113.8495 & 6e-04 & 0.9998 & 1 & 0.9915 \tabularnewline
103 & 109.12 & 112.5149 & 110.6107 & 114.419 & 2e-04 & 0.9996 & 0.9994 & 0.9953 \tabularnewline
104 & 109 & 112.8624 & 110.8045 & 114.9202 & 1e-04 & 0.9998 & 0.9951 & 0.9969 \tabularnewline
105 & 107.23 & 111.8038 & 109.6006 & 114.007 & 0 & 0.9937 & 0.9913 & 0.9467 \tabularnewline
106 & 109.49 & 113.2668 & 110.9255 & 115.6081 & 8e-04 & 1 & 0.9938 & 0.997 \tabularnewline
107 & 109.04 & 113.1159 & 110.6429 & 115.5889 & 6e-04 & 0.998 & 0.9902 & 0.9934 \tabularnewline
108 & 109.02 & 113.1135 & 110.5145 & 115.7124 & 0.001 & 0.9989 & 0.9908 & 0.9908 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66780&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[96])[/C][/ROW]
[ROW][C]84[/C][C]104.95[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]105.85[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]106.23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]104.86[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]107.44[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]108.23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]108.45[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]109.39[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]110.15[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]109.13[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]110.28[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]110.17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]109.99[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]109.26[/C][C]110.3433[/C][C]109.705[/C][C]110.9817[/C][C]4e-04[/C][C]0.861[/C][C]1[/C][C]0.861[/C][/ROW]
[ROW][C]98[/C][C]109.11[/C][C]110.4854[/C][C]109.5556[/C][C]111.4152[/C][C]0.0019[/C][C]0.9951[/C][C]1[/C][C]0.8518[/C][/ROW]
[ROW][C]99[/C][C]107.06[/C][C]109.0811[/C][C]107.9138[/C][C]110.2484[/C][C]3e-04[/C][C]0.4807[/C][C]1[/C][C]0.0635[/C][/ROW]
[ROW][C]100[/C][C]109.53[/C][C]111.4015[/C][C]110.0254[/C][C]112.7776[/C][C]0.0038[/C][C]1[/C][C]1[/C][C]0.9778[/C][/ROW]
[ROW][C]101[/C][C]108.92[/C][C]111.7582[/C][C]110.1925[/C][C]113.3239[/C][C]2e-04[/C][C]0.9974[/C][C]1[/C][C]0.9866[/C][/ROW]
[ROW][C]102[/C][C]109.24[/C][C]112.1087[/C][C]110.368[/C][C]113.8495[/C][C]6e-04[/C][C]0.9998[/C][C]1[/C][C]0.9915[/C][/ROW]
[ROW][C]103[/C][C]109.12[/C][C]112.5149[/C][C]110.6107[/C][C]114.419[/C][C]2e-04[/C][C]0.9996[/C][C]0.9994[/C][C]0.9953[/C][/ROW]
[ROW][C]104[/C][C]109[/C][C]112.8624[/C][C]110.8045[/C][C]114.9202[/C][C]1e-04[/C][C]0.9998[/C][C]0.9951[/C][C]0.9969[/C][/ROW]
[ROW][C]105[/C][C]107.23[/C][C]111.8038[/C][C]109.6006[/C][C]114.007[/C][C]0[/C][C]0.9937[/C][C]0.9913[/C][C]0.9467[/C][/ROW]
[ROW][C]106[/C][C]109.49[/C][C]113.2668[/C][C]110.9255[/C][C]115.6081[/C][C]8e-04[/C][C]1[/C][C]0.9938[/C][C]0.997[/C][/ROW]
[ROW][C]107[/C][C]109.04[/C][C]113.1159[/C][C]110.6429[/C][C]115.5889[/C][C]6e-04[/C][C]0.998[/C][C]0.9902[/C][C]0.9934[/C][/ROW]
[ROW][C]108[/C][C]109.02[/C][C]113.1135[/C][C]110.5145[/C][C]115.7124[/C][C]0.001[/C][C]0.9989[/C][C]0.9908[/C][C]0.9908[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66780&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66780&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[96])
84104.95-------
85105.85-------
86106.23-------
87104.86-------
88107.44-------
89108.23-------
90108.45-------
91109.39-------
92110.15-------
93109.13-------
94110.28-------
95110.17-------
96109.99-------
97109.26110.3433109.705110.98174e-040.86110.861
98109.11110.4854109.5556111.41520.00190.995110.8518
99107.06109.0811107.9138110.24843e-040.480710.0635
100109.53111.4015110.0254112.77760.0038110.9778
101108.92111.7582110.1925113.32392e-040.997410.9866
102109.24112.1087110.368113.84956e-040.999810.9915
103109.12112.5149110.6107114.4192e-040.99960.99940.9953
104109112.8624110.8045114.92021e-040.99980.99510.9969
105107.23111.8038109.6006114.00700.99370.99130.9467
106109.49113.2668110.9255115.60818e-0410.99380.997
107109.04113.1159110.6429115.58896e-040.9980.99020.9934
108109.02113.1135110.5145115.71240.0010.99890.99080.9908







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
970.003-0.009801.173600
980.0043-0.01240.01111.89171.53271.238
990.0055-0.01850.01364.0852.38341.5438
1000.0063-0.01680.01443.50272.66321.6319
1010.0071-0.02540.01668.05533.74171.9343
1020.0079-0.02560.01818.22964.48962.1189
1030.0086-0.03020.019811.52515.49472.3441
1040.0093-0.03420.021614.91796.67262.5831
1050.0101-0.04090.023820.91948.25562.8733
1060.0105-0.03330.024714.26448.85652.976
1070.0112-0.0360.025816.61299.56163.0922
1080.0117-0.03620.026616.756610.16123.1877

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
97 & 0.003 & -0.0098 & 0 & 1.1736 & 0 & 0 \tabularnewline
98 & 0.0043 & -0.0124 & 0.0111 & 1.8917 & 1.5327 & 1.238 \tabularnewline
99 & 0.0055 & -0.0185 & 0.0136 & 4.085 & 2.3834 & 1.5438 \tabularnewline
100 & 0.0063 & -0.0168 & 0.0144 & 3.5027 & 2.6632 & 1.6319 \tabularnewline
101 & 0.0071 & -0.0254 & 0.0166 & 8.0553 & 3.7417 & 1.9343 \tabularnewline
102 & 0.0079 & -0.0256 & 0.0181 & 8.2296 & 4.4896 & 2.1189 \tabularnewline
103 & 0.0086 & -0.0302 & 0.0198 & 11.5251 & 5.4947 & 2.3441 \tabularnewline
104 & 0.0093 & -0.0342 & 0.0216 & 14.9179 & 6.6726 & 2.5831 \tabularnewline
105 & 0.0101 & -0.0409 & 0.0238 & 20.9194 & 8.2556 & 2.8733 \tabularnewline
106 & 0.0105 & -0.0333 & 0.0247 & 14.2644 & 8.8565 & 2.976 \tabularnewline
107 & 0.0112 & -0.036 & 0.0258 & 16.6129 & 9.5616 & 3.0922 \tabularnewline
108 & 0.0117 & -0.0362 & 0.0266 & 16.7566 & 10.1612 & 3.1877 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66780&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]97[/C][C]0.003[/C][C]-0.0098[/C][C]0[/C][C]1.1736[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]98[/C][C]0.0043[/C][C]-0.0124[/C][C]0.0111[/C][C]1.8917[/C][C]1.5327[/C][C]1.238[/C][/ROW]
[ROW][C]99[/C][C]0.0055[/C][C]-0.0185[/C][C]0.0136[/C][C]4.085[/C][C]2.3834[/C][C]1.5438[/C][/ROW]
[ROW][C]100[/C][C]0.0063[/C][C]-0.0168[/C][C]0.0144[/C][C]3.5027[/C][C]2.6632[/C][C]1.6319[/C][/ROW]
[ROW][C]101[/C][C]0.0071[/C][C]-0.0254[/C][C]0.0166[/C][C]8.0553[/C][C]3.7417[/C][C]1.9343[/C][/ROW]
[ROW][C]102[/C][C]0.0079[/C][C]-0.0256[/C][C]0.0181[/C][C]8.2296[/C][C]4.4896[/C][C]2.1189[/C][/ROW]
[ROW][C]103[/C][C]0.0086[/C][C]-0.0302[/C][C]0.0198[/C][C]11.5251[/C][C]5.4947[/C][C]2.3441[/C][/ROW]
[ROW][C]104[/C][C]0.0093[/C][C]-0.0342[/C][C]0.0216[/C][C]14.9179[/C][C]6.6726[/C][C]2.5831[/C][/ROW]
[ROW][C]105[/C][C]0.0101[/C][C]-0.0409[/C][C]0.0238[/C][C]20.9194[/C][C]8.2556[/C][C]2.8733[/C][/ROW]
[ROW][C]106[/C][C]0.0105[/C][C]-0.0333[/C][C]0.0247[/C][C]14.2644[/C][C]8.8565[/C][C]2.976[/C][/ROW]
[ROW][C]107[/C][C]0.0112[/C][C]-0.036[/C][C]0.0258[/C][C]16.6129[/C][C]9.5616[/C][C]3.0922[/C][/ROW]
[ROW][C]108[/C][C]0.0117[/C][C]-0.0362[/C][C]0.0266[/C][C]16.7566[/C][C]10.1612[/C][C]3.1877[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66780&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66780&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
970.003-0.009801.173600
980.0043-0.01240.01111.89171.53271.238
990.0055-0.01850.01364.0852.38341.5438
1000.0063-0.01680.01443.50272.66321.6319
1010.0071-0.02540.01668.05533.74171.9343
1020.0079-0.02560.01818.22964.48962.1189
1030.0086-0.03020.019811.52515.49472.3441
1040.0093-0.03420.021614.91796.67262.5831
1050.0101-0.04090.023820.91948.25562.8733
1060.0105-0.03330.024714.26448.85652.976
1070.0112-0.0360.025816.61299.56163.0922
1080.0117-0.03620.026616.756610.16123.1877



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