Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationMon, 03 Dec 2007 04:36:25 -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/2007/Dec/03/t1196681213h75wgfccu79dqvo.htm/, Retrieved Sat, 04 May 2024 03:42:35 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2326, Retrieved Sat, 04 May 2024 03:42:35 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsex012008
Estimated Impact575
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [omzet] [2007-12-03 11:36:25] [ef257666c09b3678397177defae7fd99] [Current]
Feedback Forum

Post a new message
Dataseries X:
122302.01
109264.65
103674.75
103890.3
75512.66
83121.3
125096.81
74206.73
88481.63
111598.17
146919.48
150790.85
113780.5
110870.76
118785.32
112820.5
102188.92
97092.73
114067.82
89690.15
89267.9
96198.64
129599.75
169424.7
152510.91
121850.2
144737.64
121381.88
106894.86
94305.06
116800.42
77584.28
100680.88
106634.05
168390.77
211971.89
136163.28
168950.25
89816.88
85406.93
66055.52
73311.68
85674.51
82822.59
94277.63
100991.65
149245.88
208517.17
40733.51
121352.23
104020.11
99566.82
101352.17
106628.41
109696.95
248696.37
105628.33
120449.17
136547.7
140896.42
131509.91
95450.31
133592.64
110332.9
88110.54
64931.25
98446.22
84212.38
77519.55
124806.02
102185.94
151348.79
124378.28
101433.13
126724.22
87461.88
95288.27
129055.33
107753.06
96364.03
71662.75
125666.24
456841.51
167642.32
167154.73
139685.18
119275.2
122746.05
107337.43
112584.89
133183.08
121152.57
119815.6
122858.44
152077.17
157221.96
140435.08
101455.09
104791.29
77226.59
84477.43
66227.74
89076.23
108924.43
83926.11
91764.8
120892.76
129952.42
135865.14
105512.77
96486.62
78064.88
92370.22
98454.46
96703.93
83170.95




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\begin{tabular}{lllllllll}
\hline
Summary of compuational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 3 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2326&T=0

[TABLE]
[ROW][C]Summary of compuational 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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2326&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2326&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







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[104])
92121152.57-------
93119815.6-------
94122858.44-------
95152077.17-------
96157221.96-------
97140435.08-------
98101455.09-------
99104791.29-------
10077226.59-------
10184477.43-------
10266227.74-------
10389076.23-------
104108924.43-------
10583926.1184969.2826-4691.222174629.78720.49090.30030.22310.3003
10691764.8124684.072735023.5681214344.57730.23590.81350.51590.6348
107120892.76246336.5584156676.0538335997.0630.00310.99960.98030.9987
108129952.42158787.72869127.2234248448.23270.26420.79630.51370.8621
109135865.14144053.555654393.051233714.06020.4290.62110.53150.7787
110105512.77115759.019326098.5147205419.52390.41140.33010.62270.5594
11196486.62118935.295229274.7906208595.79980.31180.61540.62140.5866
11278064.8898338.25848677.7538187998.7630.32880.51610.67780.4085
11392370.2297334.66597674.1612186995.17050.45680.66320.61070.4
11498454.46108566.014218905.5096198226.51880.41250.63830.82270.4969
11596703.93113015.766623355.262202676.27120.36070.62490.69960.5356
11683170.95108507.864618847.3599198168.36920.28980.60180.49640.4964

\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[104]) \tabularnewline
92 & 121152.57 & - & - & - & - & - & - & - \tabularnewline
93 & 119815.6 & - & - & - & - & - & - & - \tabularnewline
94 & 122858.44 & - & - & - & - & - & - & - \tabularnewline
95 & 152077.17 & - & - & - & - & - & - & - \tabularnewline
96 & 157221.96 & - & - & - & - & - & - & - \tabularnewline
97 & 140435.08 & - & - & - & - & - & - & - \tabularnewline
98 & 101455.09 & - & - & - & - & - & - & - \tabularnewline
99 & 104791.29 & - & - & - & - & - & - & - \tabularnewline
100 & 77226.59 & - & - & - & - & - & - & - \tabularnewline
101 & 84477.43 & - & - & - & - & - & - & - \tabularnewline
102 & 66227.74 & - & - & - & - & - & - & - \tabularnewline
103 & 89076.23 & - & - & - & - & - & - & - \tabularnewline
104 & 108924.43 & - & - & - & - & - & - & - \tabularnewline
105 & 83926.11 & 84969.2826 & -4691.222 & 174629.7872 & 0.4909 & 0.3003 & 0.2231 & 0.3003 \tabularnewline
106 & 91764.8 & 124684.0727 & 35023.5681 & 214344.5773 & 0.2359 & 0.8135 & 0.5159 & 0.6348 \tabularnewline
107 & 120892.76 & 246336.5584 & 156676.0538 & 335997.063 & 0.0031 & 0.9996 & 0.9803 & 0.9987 \tabularnewline
108 & 129952.42 & 158787.728 & 69127.2234 & 248448.2327 & 0.2642 & 0.7963 & 0.5137 & 0.8621 \tabularnewline
109 & 135865.14 & 144053.5556 & 54393.051 & 233714.0602 & 0.429 & 0.6211 & 0.5315 & 0.7787 \tabularnewline
110 & 105512.77 & 115759.0193 & 26098.5147 & 205419.5239 & 0.4114 & 0.3301 & 0.6227 & 0.5594 \tabularnewline
111 & 96486.62 & 118935.2952 & 29274.7906 & 208595.7998 & 0.3118 & 0.6154 & 0.6214 & 0.5866 \tabularnewline
112 & 78064.88 & 98338.2584 & 8677.7538 & 187998.763 & 0.3288 & 0.5161 & 0.6778 & 0.4085 \tabularnewline
113 & 92370.22 & 97334.6659 & 7674.1612 & 186995.1705 & 0.4568 & 0.6632 & 0.6107 & 0.4 \tabularnewline
114 & 98454.46 & 108566.0142 & 18905.5096 & 198226.5188 & 0.4125 & 0.6383 & 0.8227 & 0.4969 \tabularnewline
115 & 96703.93 & 113015.7666 & 23355.262 & 202676.2712 & 0.3607 & 0.6249 & 0.6996 & 0.5356 \tabularnewline
116 & 83170.95 & 108507.8646 & 18847.3599 & 198168.3692 & 0.2898 & 0.6018 & 0.4964 & 0.4964 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2326&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[104])[/C][/ROW]
[ROW][C]92[/C][C]121152.57[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]119815.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]122858.44[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]152077.17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]157221.96[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]140435.08[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]101455.09[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]104791.29[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]77226.59[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]84477.43[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]66227.74[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]89076.23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]108924.43[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]83926.11[/C][C]84969.2826[/C][C]-4691.222[/C][C]174629.7872[/C][C]0.4909[/C][C]0.3003[/C][C]0.2231[/C][C]0.3003[/C][/ROW]
[ROW][C]106[/C][C]91764.8[/C][C]124684.0727[/C][C]35023.5681[/C][C]214344.5773[/C][C]0.2359[/C][C]0.8135[/C][C]0.5159[/C][C]0.6348[/C][/ROW]
[ROW][C]107[/C][C]120892.76[/C][C]246336.5584[/C][C]156676.0538[/C][C]335997.063[/C][C]0.0031[/C][C]0.9996[/C][C]0.9803[/C][C]0.9987[/C][/ROW]
[ROW][C]108[/C][C]129952.42[/C][C]158787.728[/C][C]69127.2234[/C][C]248448.2327[/C][C]0.2642[/C][C]0.7963[/C][C]0.5137[/C][C]0.8621[/C][/ROW]
[ROW][C]109[/C][C]135865.14[/C][C]144053.5556[/C][C]54393.051[/C][C]233714.0602[/C][C]0.429[/C][C]0.6211[/C][C]0.5315[/C][C]0.7787[/C][/ROW]
[ROW][C]110[/C][C]105512.77[/C][C]115759.0193[/C][C]26098.5147[/C][C]205419.5239[/C][C]0.4114[/C][C]0.3301[/C][C]0.6227[/C][C]0.5594[/C][/ROW]
[ROW][C]111[/C][C]96486.62[/C][C]118935.2952[/C][C]29274.7906[/C][C]208595.7998[/C][C]0.3118[/C][C]0.6154[/C][C]0.6214[/C][C]0.5866[/C][/ROW]
[ROW][C]112[/C][C]78064.88[/C][C]98338.2584[/C][C]8677.7538[/C][C]187998.763[/C][C]0.3288[/C][C]0.5161[/C][C]0.6778[/C][C]0.4085[/C][/ROW]
[ROW][C]113[/C][C]92370.22[/C][C]97334.6659[/C][C]7674.1612[/C][C]186995.1705[/C][C]0.4568[/C][C]0.6632[/C][C]0.6107[/C][C]0.4[/C][/ROW]
[ROW][C]114[/C][C]98454.46[/C][C]108566.0142[/C][C]18905.5096[/C][C]198226.5188[/C][C]0.4125[/C][C]0.6383[/C][C]0.8227[/C][C]0.4969[/C][/ROW]
[ROW][C]115[/C][C]96703.93[/C][C]113015.7666[/C][C]23355.262[/C][C]202676.2712[/C][C]0.3607[/C][C]0.6249[/C][C]0.6996[/C][C]0.5356[/C][/ROW]
[ROW][C]116[/C][C]83170.95[/C][C]108507.8646[/C][C]18847.3599[/C][C]198168.3692[/C][C]0.2898[/C][C]0.6018[/C][C]0.4964[/C][C]0.4964[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2326&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2326&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[104])
92121152.57-------
93119815.6-------
94122858.44-------
95152077.17-------
96157221.96-------
97140435.08-------
98101455.09-------
99104791.29-------
10077226.59-------
10184477.43-------
10266227.74-------
10389076.23-------
104108924.43-------
10583926.1184969.2826-4691.222174629.78720.49090.30030.22310.3003
10691764.8124684.072735023.5681214344.57730.23590.81350.51590.6348
107120892.76246336.5584156676.0538335997.0630.00310.99960.98030.9987
108129952.42158787.72869127.2234248448.23270.26420.79630.51370.8621
109135865.14144053.555654393.051233714.06020.4290.62110.53150.7787
110105512.77115759.019326098.5147205419.52390.41140.33010.62270.5594
11196486.62118935.295229274.7906208595.79980.31180.61540.62140.5866
11278064.8898338.25848677.7538187998.7630.32880.51610.67780.4085
11392370.2297334.66597674.1612186995.17050.45680.66320.61070.4
11498454.46108566.014218905.5096198226.51880.41250.63830.82270.4969
11596703.93113015.766623355.262202676.27120.36070.62490.69960.5356
11683170.95108507.864618847.3599198168.36920.28980.60180.49640.4964







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1050.5384-0.01230.0011088209.033490684.0861301.138
1060.3669-0.2640.0221083678516.866990306543.07229502.9755
1070.1857-0.50920.042415736146559.51391311345546.626236212.5054
1080.2881-0.18160.0151831474990.324769289582.52718324.0364
1090.3176-0.05680.004767050150.10465587512.50872363.792
1100.3952-0.08850.0074104985624.59278748802.04942957.8374
1110.3846-0.18870.0157503943017.312141995251.44276480.3743
1120.4652-0.20620.0172411009872.975634250822.7485852.4202
1130.47-0.0510.004324645722.73712053810.22811433.1121
1140.4214-0.09310.0078102243528.9918520294.08262918.9543
1150.4048-0.14430.012266076012.753922173001.06284708.8216
1160.4216-0.23350.0195641959239.125253496603.26047314.1372

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
105 & 0.5384 & -0.0123 & 0.001 & 1088209.0334 & 90684.0861 & 301.138 \tabularnewline
106 & 0.3669 & -0.264 & 0.022 & 1083678516.8669 & 90306543.0722 & 9502.9755 \tabularnewline
107 & 0.1857 & -0.5092 & 0.0424 & 15736146559.5139 & 1311345546.6262 & 36212.5054 \tabularnewline
108 & 0.2881 & -0.1816 & 0.0151 & 831474990.3247 & 69289582.5271 & 8324.0364 \tabularnewline
109 & 0.3176 & -0.0568 & 0.0047 & 67050150.1046 & 5587512.5087 & 2363.792 \tabularnewline
110 & 0.3952 & -0.0885 & 0.0074 & 104985624.5927 & 8748802.0494 & 2957.8374 \tabularnewline
111 & 0.3846 & -0.1887 & 0.0157 & 503943017.3121 & 41995251.4427 & 6480.3743 \tabularnewline
112 & 0.4652 & -0.2062 & 0.0172 & 411009872.9756 & 34250822.748 & 5852.4202 \tabularnewline
113 & 0.47 & -0.051 & 0.0043 & 24645722.7371 & 2053810.2281 & 1433.1121 \tabularnewline
114 & 0.4214 & -0.0931 & 0.0078 & 102243528.991 & 8520294.0826 & 2918.9543 \tabularnewline
115 & 0.4048 & -0.1443 & 0.012 & 266076012.7539 & 22173001.0628 & 4708.8216 \tabularnewline
116 & 0.4216 & -0.2335 & 0.0195 & 641959239.1252 & 53496603.2604 & 7314.1372 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2326&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]105[/C][C]0.5384[/C][C]-0.0123[/C][C]0.001[/C][C]1088209.0334[/C][C]90684.0861[/C][C]301.138[/C][/ROW]
[ROW][C]106[/C][C]0.3669[/C][C]-0.264[/C][C]0.022[/C][C]1083678516.8669[/C][C]90306543.0722[/C][C]9502.9755[/C][/ROW]
[ROW][C]107[/C][C]0.1857[/C][C]-0.5092[/C][C]0.0424[/C][C]15736146559.5139[/C][C]1311345546.6262[/C][C]36212.5054[/C][/ROW]
[ROW][C]108[/C][C]0.2881[/C][C]-0.1816[/C][C]0.0151[/C][C]831474990.3247[/C][C]69289582.5271[/C][C]8324.0364[/C][/ROW]
[ROW][C]109[/C][C]0.3176[/C][C]-0.0568[/C][C]0.0047[/C][C]67050150.1046[/C][C]5587512.5087[/C][C]2363.792[/C][/ROW]
[ROW][C]110[/C][C]0.3952[/C][C]-0.0885[/C][C]0.0074[/C][C]104985624.5927[/C][C]8748802.0494[/C][C]2957.8374[/C][/ROW]
[ROW][C]111[/C][C]0.3846[/C][C]-0.1887[/C][C]0.0157[/C][C]503943017.3121[/C][C]41995251.4427[/C][C]6480.3743[/C][/ROW]
[ROW][C]112[/C][C]0.4652[/C][C]-0.2062[/C][C]0.0172[/C][C]411009872.9756[/C][C]34250822.748[/C][C]5852.4202[/C][/ROW]
[ROW][C]113[/C][C]0.47[/C][C]-0.051[/C][C]0.0043[/C][C]24645722.7371[/C][C]2053810.2281[/C][C]1433.1121[/C][/ROW]
[ROW][C]114[/C][C]0.4214[/C][C]-0.0931[/C][C]0.0078[/C][C]102243528.991[/C][C]8520294.0826[/C][C]2918.9543[/C][/ROW]
[ROW][C]115[/C][C]0.4048[/C][C]-0.1443[/C][C]0.012[/C][C]266076012.7539[/C][C]22173001.0628[/C][C]4708.8216[/C][/ROW]
[ROW][C]116[/C][C]0.4216[/C][C]-0.2335[/C][C]0.0195[/C][C]641959239.1252[/C][C]53496603.2604[/C][C]7314.1372[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2326&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2326&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
1050.5384-0.01230.0011088209.033490684.0861301.138
1060.3669-0.2640.0221083678516.866990306543.07229502.9755
1070.1857-0.50920.042415736146559.51391311345546.626236212.5054
1080.2881-0.18160.0151831474990.324769289582.52718324.0364
1090.3176-0.05680.004767050150.10465587512.50872363.792
1100.3952-0.08850.0074104985624.59278748802.04942957.8374
1110.3846-0.18870.0157503943017.312141995251.44276480.3743
1120.4652-0.20620.0172411009872.975634250822.7485852.4202
1130.47-0.0510.004324645722.73712053810.22811433.1121
1140.4214-0.09310.0078102243528.9918520294.08262918.9543
1150.4048-0.14430.012266076012.753922173001.06284708.8216
1160.4216-0.23350.0195641959239.125253496603.26047314.1372



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