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 computationMon, 21 Dec 2009 08:59:35 -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/21/t1261411244tu469gjerc80n9r.htm/, Retrieved Sun, 05 May 2024 15:50:00 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70308, Retrieved Sun, 05 May 2024 15:50:00 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact138
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-06 10:44:58] [1e83ffa964db6f7ea6ccc4e7b5acbbff]
-   PD  [ARIMA Forecasting] [ws 10 deel 2 prblm] [2009-12-09 19:29:01] [134dc66689e3d457a82860db6471d419]
-   P     [ARIMA Forecasting] [ws 10 deel 2 arim...] [2009-12-12 09:45:03] [134dc66689e3d457a82860db6471d419]
-    D      [ARIMA Forecasting] [WS 10 ] [2009-12-12 11:53:20] [3425351e86519d261a643e224a0c8ee1]
-   PD        [ARIMA Forecasting] [] [2009-12-19 16:24:22] [3425351e86519d261a643e224a0c8ee1]
-   P           [ARIMA Forecasting] [] [2009-12-20 10:24:37] [3425351e86519d261a643e224a0c8ee1]
-   PD              [ARIMA Forecasting] [ARIMA forecasting] [2009-12-21 15:59:35] [d79e31a57591875d497c91f296c77132] [Current]
Feedback Forum

Post a new message
Dataseries X:
91.98
91.72
90.27
91.89
92.07
92.92
93.34
93.6
92.41
93.6
93.77
93.6
93.6
93.51
92.66
94.2
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.5
96.16
96.33
96.33
95.05
96.84
96.92
97.44
97.78
97.69
96.67
98.29
98.2
98.71
98.54
98.2
96.92
99.06
99.65
99.82
99.99
100.33
99.31
101.1
101.1
100.93
100.85
100.93
99.6
101.88
101.81
102.38
102.74
102.82
101.72
103.47
102.98
102.68
102.9
103.03
101.29
103.69
103.68
104.2
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
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=70308&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=70308&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70308&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.3081109.6721110.94416e-040.836510.8365
98109.11110.456109.513111.3990.00260.993510.8336
99107.06108.9823107.8028110.16177e-040.41610.047
100109.53111.3526109.9755112.72970.0047110.9738
101108.92111.6444110.0944113.19443e-040.996210.9818
102109.24112.0345110.329113.74017e-040.999810.9906
103109.12112.3733110.5253114.22133e-040.99960.99920.9943
104109112.6848110.7046114.66511e-040.99980.99390.9962
105107.23111.6169109.5127113.721100.99260.98970.9352
106109.49113.1163110.8951115.33767e-0410.99380.9971
107109.04112.9275110.595115.25995e-040.99810.98980.9932
108109.02112.9937110.5552115.43237e-040.99930.99210.9921

\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.3081 & 109.6721 & 110.9441 & 6e-04 & 0.8365 & 1 & 0.8365 \tabularnewline
98 & 109.11 & 110.456 & 109.513 & 111.399 & 0.0026 & 0.9935 & 1 & 0.8336 \tabularnewline
99 & 107.06 & 108.9823 & 107.8028 & 110.1617 & 7e-04 & 0.416 & 1 & 0.047 \tabularnewline
100 & 109.53 & 111.3526 & 109.9755 & 112.7297 & 0.0047 & 1 & 1 & 0.9738 \tabularnewline
101 & 108.92 & 111.6444 & 110.0944 & 113.1944 & 3e-04 & 0.9962 & 1 & 0.9818 \tabularnewline
102 & 109.24 & 112.0345 & 110.329 & 113.7401 & 7e-04 & 0.9998 & 1 & 0.9906 \tabularnewline
103 & 109.12 & 112.3733 & 110.5253 & 114.2213 & 3e-04 & 0.9996 & 0.9992 & 0.9943 \tabularnewline
104 & 109 & 112.6848 & 110.7046 & 114.6651 & 1e-04 & 0.9998 & 0.9939 & 0.9962 \tabularnewline
105 & 107.23 & 111.6169 & 109.5127 & 113.7211 & 0 & 0.9926 & 0.9897 & 0.9352 \tabularnewline
106 & 109.49 & 113.1163 & 110.8951 & 115.3376 & 7e-04 & 1 & 0.9938 & 0.9971 \tabularnewline
107 & 109.04 & 112.9275 & 110.595 & 115.2599 & 5e-04 & 0.9981 & 0.9898 & 0.9932 \tabularnewline
108 & 109.02 & 112.9937 & 110.5552 & 115.4323 & 7e-04 & 0.9993 & 0.9921 & 0.9921 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70308&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.3081[/C][C]109.6721[/C][C]110.9441[/C][C]6e-04[/C][C]0.8365[/C][C]1[/C][C]0.8365[/C][/ROW]
[ROW][C]98[/C][C]109.11[/C][C]110.456[/C][C]109.513[/C][C]111.399[/C][C]0.0026[/C][C]0.9935[/C][C]1[/C][C]0.8336[/C][/ROW]
[ROW][C]99[/C][C]107.06[/C][C]108.9823[/C][C]107.8028[/C][C]110.1617[/C][C]7e-04[/C][C]0.416[/C][C]1[/C][C]0.047[/C][/ROW]
[ROW][C]100[/C][C]109.53[/C][C]111.3526[/C][C]109.9755[/C][C]112.7297[/C][C]0.0047[/C][C]1[/C][C]1[/C][C]0.9738[/C][/ROW]
[ROW][C]101[/C][C]108.92[/C][C]111.6444[/C][C]110.0944[/C][C]113.1944[/C][C]3e-04[/C][C]0.9962[/C][C]1[/C][C]0.9818[/C][/ROW]
[ROW][C]102[/C][C]109.24[/C][C]112.0345[/C][C]110.329[/C][C]113.7401[/C][C]7e-04[/C][C]0.9998[/C][C]1[/C][C]0.9906[/C][/ROW]
[ROW][C]103[/C][C]109.12[/C][C]112.3733[/C][C]110.5253[/C][C]114.2213[/C][C]3e-04[/C][C]0.9996[/C][C]0.9992[/C][C]0.9943[/C][/ROW]
[ROW][C]104[/C][C]109[/C][C]112.6848[/C][C]110.7046[/C][C]114.6651[/C][C]1e-04[/C][C]0.9998[/C][C]0.9939[/C][C]0.9962[/C][/ROW]
[ROW][C]105[/C][C]107.23[/C][C]111.6169[/C][C]109.5127[/C][C]113.7211[/C][C]0[/C][C]0.9926[/C][C]0.9897[/C][C]0.9352[/C][/ROW]
[ROW][C]106[/C][C]109.49[/C][C]113.1163[/C][C]110.8951[/C][C]115.3376[/C][C]7e-04[/C][C]1[/C][C]0.9938[/C][C]0.9971[/C][/ROW]
[ROW][C]107[/C][C]109.04[/C][C]112.9275[/C][C]110.595[/C][C]115.2599[/C][C]5e-04[/C][C]0.9981[/C][C]0.9898[/C][C]0.9932[/C][/ROW]
[ROW][C]108[/C][C]109.02[/C][C]112.9937[/C][C]110.5552[/C][C]115.4323[/C][C]7e-04[/C][C]0.9993[/C][C]0.9921[/C][C]0.9921[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70308&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70308&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.3081109.6721110.94416e-040.836510.8365
98109.11110.456109.513111.3990.00260.993510.8336
99107.06108.9823107.8028110.16177e-040.41610.047
100109.53111.3526109.9755112.72970.0047110.9738
101108.92111.6444110.0944113.19443e-040.996210.9818
102109.24112.0345110.329113.74017e-040.999810.9906
103109.12112.3733110.5253114.22133e-040.99960.99920.9943
104109112.6848110.7046114.66511e-040.99980.99390.9962
105107.23111.6169109.5127113.721100.99260.98970.9352
106109.49113.1163110.8951115.33767e-0410.99380.9971
107109.04112.9275110.595115.25995e-040.99810.98980.9932
108109.02112.9937110.5552115.43237e-040.99930.99210.9921







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
970.0029-0.00958e-041.09860.09150.3026
980.0044-0.01220.0011.81180.1510.3886
990.0055-0.01760.00153.69510.30790.5549
1000.0063-0.01640.00143.32190.27680.5261
1010.0071-0.02440.0027.42230.61850.7865
1020.0078-0.02490.00217.80950.65080.8067
1030.0084-0.0290.002410.58390.8820.9391
1040.009-0.03270.002713.5781.13151.0637
1050.0096-0.03930.003319.24511.60381.2664
1060.01-0.03210.002713.15031.09591.0468
1070.0105-0.03440.002915.11231.25941.1222
1080.011-0.03520.002915.79041.31591.1471

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
97 & 0.0029 & -0.0095 & 8e-04 & 1.0986 & 0.0915 & 0.3026 \tabularnewline
98 & 0.0044 & -0.0122 & 0.001 & 1.8118 & 0.151 & 0.3886 \tabularnewline
99 & 0.0055 & -0.0176 & 0.0015 & 3.6951 & 0.3079 & 0.5549 \tabularnewline
100 & 0.0063 & -0.0164 & 0.0014 & 3.3219 & 0.2768 & 0.5261 \tabularnewline
101 & 0.0071 & -0.0244 & 0.002 & 7.4223 & 0.6185 & 0.7865 \tabularnewline
102 & 0.0078 & -0.0249 & 0.0021 & 7.8095 & 0.6508 & 0.8067 \tabularnewline
103 & 0.0084 & -0.029 & 0.0024 & 10.5839 & 0.882 & 0.9391 \tabularnewline
104 & 0.009 & -0.0327 & 0.0027 & 13.578 & 1.1315 & 1.0637 \tabularnewline
105 & 0.0096 & -0.0393 & 0.0033 & 19.2451 & 1.6038 & 1.2664 \tabularnewline
106 & 0.01 & -0.0321 & 0.0027 & 13.1503 & 1.0959 & 1.0468 \tabularnewline
107 & 0.0105 & -0.0344 & 0.0029 & 15.1123 & 1.2594 & 1.1222 \tabularnewline
108 & 0.011 & -0.0352 & 0.0029 & 15.7904 & 1.3159 & 1.1471 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70308&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.0029[/C][C]-0.0095[/C][C]8e-04[/C][C]1.0986[/C][C]0.0915[/C][C]0.3026[/C][/ROW]
[ROW][C]98[/C][C]0.0044[/C][C]-0.0122[/C][C]0.001[/C][C]1.8118[/C][C]0.151[/C][C]0.3886[/C][/ROW]
[ROW][C]99[/C][C]0.0055[/C][C]-0.0176[/C][C]0.0015[/C][C]3.6951[/C][C]0.3079[/C][C]0.5549[/C][/ROW]
[ROW][C]100[/C][C]0.0063[/C][C]-0.0164[/C][C]0.0014[/C][C]3.3219[/C][C]0.2768[/C][C]0.5261[/C][/ROW]
[ROW][C]101[/C][C]0.0071[/C][C]-0.0244[/C][C]0.002[/C][C]7.4223[/C][C]0.6185[/C][C]0.7865[/C][/ROW]
[ROW][C]102[/C][C]0.0078[/C][C]-0.0249[/C][C]0.0021[/C][C]7.8095[/C][C]0.6508[/C][C]0.8067[/C][/ROW]
[ROW][C]103[/C][C]0.0084[/C][C]-0.029[/C][C]0.0024[/C][C]10.5839[/C][C]0.882[/C][C]0.9391[/C][/ROW]
[ROW][C]104[/C][C]0.009[/C][C]-0.0327[/C][C]0.0027[/C][C]13.578[/C][C]1.1315[/C][C]1.0637[/C][/ROW]
[ROW][C]105[/C][C]0.0096[/C][C]-0.0393[/C][C]0.0033[/C][C]19.2451[/C][C]1.6038[/C][C]1.2664[/C][/ROW]
[ROW][C]106[/C][C]0.01[/C][C]-0.0321[/C][C]0.0027[/C][C]13.1503[/C][C]1.0959[/C][C]1.0468[/C][/ROW]
[ROW][C]107[/C][C]0.0105[/C][C]-0.0344[/C][C]0.0029[/C][C]15.1123[/C][C]1.2594[/C][C]1.1222[/C][/ROW]
[ROW][C]108[/C][C]0.011[/C][C]-0.0352[/C][C]0.0029[/C][C]15.7904[/C][C]1.3159[/C][C]1.1471[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70308&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70308&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.0029-0.00958e-041.09860.09150.3026
980.0044-0.01220.0011.81180.1510.3886
990.0055-0.01760.00153.69510.30790.5549
1000.0063-0.01640.00143.32190.27680.5261
1010.0071-0.02440.0027.42230.61850.7865
1020.0078-0.02490.00217.80950.65080.8067
1030.0084-0.0290.002410.58390.8820.9391
1040.009-0.03270.002713.5781.13151.0637
1050.0096-0.03930.003319.24511.60381.2664
1060.01-0.03210.002713.15031.09591.0468
1070.0105-0.03440.002915.11231.25941.1222
1080.011-0.03520.002915.79041.31591.1471



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