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 computationTue, 28 Aug 2012 16:20:55 -0400
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/Aug/28/t1346185378olwpkrrghyajgzo.htm/, Retrieved Sat, 04 May 2024 07:15:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=169551, Retrieved Sat, 04 May 2024 07:15:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact120
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [] [2008-12-14 11:54:22] [d2d412c7f4d35ffbf5ee5ee89db327d4]
- RMP   [ARIMA Forecasting] [] [2011-12-06 20:23:08] [b98453cac15ba1066b407e146608df68]
- R PD      [ARIMA Forecasting] [ARIMA forecast] [2012-08-28 20:20:55] [c53b4e73f301bc561a9fa0b8f84a7890] [Current]
Feedback Forum

Post a new message
Dataseries X:
117541.78
116587
116809
122819.55
116955
117186
117265
117536
117781
117928
120437.52
121753.21
119369.88
118622
118885
124998.3
119369
119647
119879
120075
120295
120538
123250.68
124631.03
122443.31
121532
121844
128241.75
122391
122644
122927
122909
123417
123756
126540.18
128088.74
125874.28
124817
124961
131499.9
125639
125851
125970
126322
126540
126733
129557.34
131179.77
128754.8
127890
127996
134790.6
128585
128851
129142
129334
129536
129944
132842.76
134447.96
132088.81
130902
131374
138243
131885
131839
132002
132005
132127
132116
134993.94
136459.55




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=169551&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'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[60])
48131179.77-------
49128754.8-------
50127890-------
51127996-------
52134790.6-------
53128585-------
54128851-------
55129142-------
56129334-------
57129536-------
58129944-------
59132842.76-------
60134447.96-------
61132088.81134415.2958128984.8161139845.77540.20050.49530.97950.4953
62130902134382.6394126703.7143142061.56460.18720.72090.95130.4933
63131374134349.9911124946.4092143753.57290.26750.76380.90730.4919
64138243134317.3506123460.3483145174.3530.23930.70240.4660.4906
65131885134284.7181122147.6946146421.74170.34920.26130.82130.4895
66131839134252.0935120958.2648147545.92220.3610.63650.78710.4885
67132002134219.4769119862.2442148576.70950.38110.62740.75590.4876
68132005134186.8681118840.2042149533.5320.39030.60990.73230.4867
69132127134154.2673117878.6482150429.88640.40360.60210.71090.4859
70132116134121.6744116967.7481151275.60070.40940.59010.68340.4851
71134993.94134089.0894116100.0835152078.09540.46070.58510.5540.4844
72136459.55134056.5124115269.8889152843.13590.4010.4610.48370.4837

\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[60]) \tabularnewline
48 & 131179.77 & - & - & - & - & - & - & - \tabularnewline
49 & 128754.8 & - & - & - & - & - & - & - \tabularnewline
50 & 127890 & - & - & - & - & - & - & - \tabularnewline
51 & 127996 & - & - & - & - & - & - & - \tabularnewline
52 & 134790.6 & - & - & - & - & - & - & - \tabularnewline
53 & 128585 & - & - & - & - & - & - & - \tabularnewline
54 & 128851 & - & - & - & - & - & - & - \tabularnewline
55 & 129142 & - & - & - & - & - & - & - \tabularnewline
56 & 129334 & - & - & - & - & - & - & - \tabularnewline
57 & 129536 & - & - & - & - & - & - & - \tabularnewline
58 & 129944 & - & - & - & - & - & - & - \tabularnewline
59 & 132842.76 & - & - & - & - & - & - & - \tabularnewline
60 & 134447.96 & - & - & - & - & - & - & - \tabularnewline
61 & 132088.81 & 134415.2958 & 128984.8161 & 139845.7754 & 0.2005 & 0.4953 & 0.9795 & 0.4953 \tabularnewline
62 & 130902 & 134382.6394 & 126703.7143 & 142061.5646 & 0.1872 & 0.7209 & 0.9513 & 0.4933 \tabularnewline
63 & 131374 & 134349.9911 & 124946.4092 & 143753.5729 & 0.2675 & 0.7638 & 0.9073 & 0.4919 \tabularnewline
64 & 138243 & 134317.3506 & 123460.3483 & 145174.353 & 0.2393 & 0.7024 & 0.466 & 0.4906 \tabularnewline
65 & 131885 & 134284.7181 & 122147.6946 & 146421.7417 & 0.3492 & 0.2613 & 0.8213 & 0.4895 \tabularnewline
66 & 131839 & 134252.0935 & 120958.2648 & 147545.9222 & 0.361 & 0.6365 & 0.7871 & 0.4885 \tabularnewline
67 & 132002 & 134219.4769 & 119862.2442 & 148576.7095 & 0.3811 & 0.6274 & 0.7559 & 0.4876 \tabularnewline
68 & 132005 & 134186.8681 & 118840.2042 & 149533.532 & 0.3903 & 0.6099 & 0.7323 & 0.4867 \tabularnewline
69 & 132127 & 134154.2673 & 117878.6482 & 150429.8864 & 0.4036 & 0.6021 & 0.7109 & 0.4859 \tabularnewline
70 & 132116 & 134121.6744 & 116967.7481 & 151275.6007 & 0.4094 & 0.5901 & 0.6834 & 0.4851 \tabularnewline
71 & 134993.94 & 134089.0894 & 116100.0835 & 152078.0954 & 0.4607 & 0.5851 & 0.554 & 0.4844 \tabularnewline
72 & 136459.55 & 134056.5124 & 115269.8889 & 152843.1359 & 0.401 & 0.461 & 0.4837 & 0.4837 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=169551&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[60])[/C][/ROW]
[ROW][C]48[/C][C]131179.77[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]128754.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]127890[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]127996[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]134790.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]128585[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]128851[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]129142[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]129334[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]129536[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]129944[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]132842.76[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]134447.96[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]132088.81[/C][C]134415.2958[/C][C]128984.8161[/C][C]139845.7754[/C][C]0.2005[/C][C]0.4953[/C][C]0.9795[/C][C]0.4953[/C][/ROW]
[ROW][C]62[/C][C]130902[/C][C]134382.6394[/C][C]126703.7143[/C][C]142061.5646[/C][C]0.1872[/C][C]0.7209[/C][C]0.9513[/C][C]0.4933[/C][/ROW]
[ROW][C]63[/C][C]131374[/C][C]134349.9911[/C][C]124946.4092[/C][C]143753.5729[/C][C]0.2675[/C][C]0.7638[/C][C]0.9073[/C][C]0.4919[/C][/ROW]
[ROW][C]64[/C][C]138243[/C][C]134317.3506[/C][C]123460.3483[/C][C]145174.353[/C][C]0.2393[/C][C]0.7024[/C][C]0.466[/C][C]0.4906[/C][/ROW]
[ROW][C]65[/C][C]131885[/C][C]134284.7181[/C][C]122147.6946[/C][C]146421.7417[/C][C]0.3492[/C][C]0.2613[/C][C]0.8213[/C][C]0.4895[/C][/ROW]
[ROW][C]66[/C][C]131839[/C][C]134252.0935[/C][C]120958.2648[/C][C]147545.9222[/C][C]0.361[/C][C]0.6365[/C][C]0.7871[/C][C]0.4885[/C][/ROW]
[ROW][C]67[/C][C]132002[/C][C]134219.4769[/C][C]119862.2442[/C][C]148576.7095[/C][C]0.3811[/C][C]0.6274[/C][C]0.7559[/C][C]0.4876[/C][/ROW]
[ROW][C]68[/C][C]132005[/C][C]134186.8681[/C][C]118840.2042[/C][C]149533.532[/C][C]0.3903[/C][C]0.6099[/C][C]0.7323[/C][C]0.4867[/C][/ROW]
[ROW][C]69[/C][C]132127[/C][C]134154.2673[/C][C]117878.6482[/C][C]150429.8864[/C][C]0.4036[/C][C]0.6021[/C][C]0.7109[/C][C]0.4859[/C][/ROW]
[ROW][C]70[/C][C]132116[/C][C]134121.6744[/C][C]116967.7481[/C][C]151275.6007[/C][C]0.4094[/C][C]0.5901[/C][C]0.6834[/C][C]0.4851[/C][/ROW]
[ROW][C]71[/C][C]134993.94[/C][C]134089.0894[/C][C]116100.0835[/C][C]152078.0954[/C][C]0.4607[/C][C]0.5851[/C][C]0.554[/C][C]0.4844[/C][/ROW]
[ROW][C]72[/C][C]136459.55[/C][C]134056.5124[/C][C]115269.8889[/C][C]152843.1359[/C][C]0.401[/C][C]0.461[/C][C]0.4837[/C][C]0.4837[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=169551&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=169551&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[60])
48131179.77-------
49128754.8-------
50127890-------
51127996-------
52134790.6-------
53128585-------
54128851-------
55129142-------
56129334-------
57129536-------
58129944-------
59132842.76-------
60134447.96-------
61132088.81134415.2958128984.8161139845.77540.20050.49530.97950.4953
62130902134382.6394126703.7143142061.56460.18720.72090.95130.4933
63131374134349.9911124946.4092143753.57290.26750.76380.90730.4919
64138243134317.3506123460.3483145174.3530.23930.70240.4660.4906
65131885134284.7181122147.6946146421.74170.34920.26130.82130.4895
66131839134252.0935120958.2648147545.92220.3610.63650.78710.4885
67132002134219.4769119862.2442148576.70950.38110.62740.75590.4876
68132005134186.8681118840.2042149533.5320.39030.60990.73230.4867
69132127134154.2673117878.6482150429.88640.40360.60210.71090.4859
70132116134121.6744116967.7481151275.60070.40940.59010.68340.4851
71134993.94134089.0894116100.0835152078.09540.46070.58510.5540.4844
72136459.55134056.5124115269.8889152843.13590.4010.4610.48370.4837







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
610.0206-0.017305412535.960800
620.0292-0.02590.021612114850.92948763693.44512960.3536
630.0357-0.02220.02188856522.8238794636.57112965.5753
640.04120.02920.023615410723.049110448658.19063232.4384
650.0461-0.01790.02255758646.98729510655.94993083.9351
660.0505-0.0180.02175823020.33118896050.01342982.6247
670.0546-0.01650.0214917203.61698327643.38532885.7656
680.0584-0.01630.02044760548.50117881756.52482807.4466
690.0619-0.01510.01984109812.7377462651.65952731.7854
700.0653-0.0150.01934022729.8557118659.4792668.0816
710.06840.00670.0182818754.53826545940.84812558.5036
720.07150.01790.01825774589.80286481661.59432545.9108

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & 0.0206 & -0.0173 & 0 & 5412535.9608 & 0 & 0 \tabularnewline
62 & 0.0292 & -0.0259 & 0.0216 & 12114850.9294 & 8763693.4451 & 2960.3536 \tabularnewline
63 & 0.0357 & -0.0222 & 0.0218 & 8856522.823 & 8794636.5711 & 2965.5753 \tabularnewline
64 & 0.0412 & 0.0292 & 0.0236 & 15410723.0491 & 10448658.1906 & 3232.4384 \tabularnewline
65 & 0.0461 & -0.0179 & 0.0225 & 5758646.9872 & 9510655.9499 & 3083.9351 \tabularnewline
66 & 0.0505 & -0.018 & 0.0217 & 5823020.3311 & 8896050.0134 & 2982.6247 \tabularnewline
67 & 0.0546 & -0.0165 & 0.021 & 4917203.6169 & 8327643.3853 & 2885.7656 \tabularnewline
68 & 0.0584 & -0.0163 & 0.0204 & 4760548.5011 & 7881756.5248 & 2807.4466 \tabularnewline
69 & 0.0619 & -0.0151 & 0.0198 & 4109812.737 & 7462651.6595 & 2731.7854 \tabularnewline
70 & 0.0653 & -0.015 & 0.0193 & 4022729.855 & 7118659.479 & 2668.0816 \tabularnewline
71 & 0.0684 & 0.0067 & 0.0182 & 818754.5382 & 6545940.8481 & 2558.5036 \tabularnewline
72 & 0.0715 & 0.0179 & 0.0182 & 5774589.8028 & 6481661.5943 & 2545.9108 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=169551&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]61[/C][C]0.0206[/C][C]-0.0173[/C][C]0[/C][C]5412535.9608[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]62[/C][C]0.0292[/C][C]-0.0259[/C][C]0.0216[/C][C]12114850.9294[/C][C]8763693.4451[/C][C]2960.3536[/C][/ROW]
[ROW][C]63[/C][C]0.0357[/C][C]-0.0222[/C][C]0.0218[/C][C]8856522.823[/C][C]8794636.5711[/C][C]2965.5753[/C][/ROW]
[ROW][C]64[/C][C]0.0412[/C][C]0.0292[/C][C]0.0236[/C][C]15410723.0491[/C][C]10448658.1906[/C][C]3232.4384[/C][/ROW]
[ROW][C]65[/C][C]0.0461[/C][C]-0.0179[/C][C]0.0225[/C][C]5758646.9872[/C][C]9510655.9499[/C][C]3083.9351[/C][/ROW]
[ROW][C]66[/C][C]0.0505[/C][C]-0.018[/C][C]0.0217[/C][C]5823020.3311[/C][C]8896050.0134[/C][C]2982.6247[/C][/ROW]
[ROW][C]67[/C][C]0.0546[/C][C]-0.0165[/C][C]0.021[/C][C]4917203.6169[/C][C]8327643.3853[/C][C]2885.7656[/C][/ROW]
[ROW][C]68[/C][C]0.0584[/C][C]-0.0163[/C][C]0.0204[/C][C]4760548.5011[/C][C]7881756.5248[/C][C]2807.4466[/C][/ROW]
[ROW][C]69[/C][C]0.0619[/C][C]-0.0151[/C][C]0.0198[/C][C]4109812.737[/C][C]7462651.6595[/C][C]2731.7854[/C][/ROW]
[ROW][C]70[/C][C]0.0653[/C][C]-0.015[/C][C]0.0193[/C][C]4022729.855[/C][C]7118659.479[/C][C]2668.0816[/C][/ROW]
[ROW][C]71[/C][C]0.0684[/C][C]0.0067[/C][C]0.0182[/C][C]818754.5382[/C][C]6545940.8481[/C][C]2558.5036[/C][/ROW]
[ROW][C]72[/C][C]0.0715[/C][C]0.0179[/C][C]0.0182[/C][C]5774589.8028[/C][C]6481661.5943[/C][C]2545.9108[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=169551&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=169551&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
610.0206-0.017305412535.960800
620.0292-0.02590.021612114850.92948763693.44512960.3536
630.0357-0.02220.02188856522.8238794636.57112965.5753
640.04120.02920.023615410723.049110448658.19063232.4384
650.0461-0.01790.02255758646.98729510655.94993083.9351
660.0505-0.0180.02175823020.33118896050.01342982.6247
670.0546-0.01650.0214917203.61698327643.38532885.7656
680.0584-0.01630.02044760548.50117881756.52482807.4466
690.0619-0.01510.01984109812.7377462651.65952731.7854
700.0653-0.0150.01934022729.8557118659.4792668.0816
710.06840.00670.0182818754.53826545940.84812558.5036
720.07150.01790.01825774589.80286481661.59432545.9108



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