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 14:28:41 -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/t1260566991iu98wex2oxg7dej.htm/, Retrieved Sun, 28 Apr 2024 23:36:35 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=66801, Retrieved Sun, 28 Apr 2024 23:36:35 +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)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
- R PD    [ARIMA Forecasting] [shwws10vr1] [2009-12-11 21:28:41] [d447d4b3e35da686436a520338c962fc] [Current]
Feedback Forum

Post a new message
Dataseries X:
102.1
102.86
102.99
103.73
105.02
104.43
104.63
104.93
105.87
105.66
106.76
106
107.22
107.33
107.11
108.86
107.72
107.88
108.38
107.72
108.41
109.9
111.45
112.18
113.34
113.46
114.06
115.54
116.39
115.94
116.97
115.94
115.91
116.43
116.26
116.35
117.9
117.7
117.53
117.86
117.65
116.51
115.93
115.31
115




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=66801&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=66801&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66801&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[33])
21108.41-------
22109.9-------
23111.45-------
24112.18-------
25113.34-------
26113.46-------
27114.06-------
28115.54-------
29116.39-------
30115.94-------
31116.97-------
32115.94-------
33115.91-------
34116.43116.2968114.8699117.72370.42740.702410.7024
35116.26116.4415114.533118.35010.42610.504710.7074
36116.35116.4104113.8892118.93150.48130.54650.99950.6514
37117.9116.8396113.5743120.1050.26220.61560.98220.7116
38117.7116.8459112.9927120.69910.3320.29590.95750.683
39117.53116.9182112.4364121.40.39450.36620.89430.6704
40117.86117.5532112.4642122.64210.4530.50360.78090.7366
41117.65117.6737112.0225123.32480.49670.47420.67190.7296
42116.51117.5104111.3031123.71780.3760.48240.690.6933
43115.93117.7831111.0492124.51690.29480.64450.59350.7072
44115.31117.5268110.2907124.76290.27410.66730.66630.6693
45115117.8127110.0928125.53270.23760.73740.68550.6855

\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[33]) \tabularnewline
21 & 108.41 & - & - & - & - & - & - & - \tabularnewline
22 & 109.9 & - & - & - & - & - & - & - \tabularnewline
23 & 111.45 & - & - & - & - & - & - & - \tabularnewline
24 & 112.18 & - & - & - & - & - & - & - \tabularnewline
25 & 113.34 & - & - & - & - & - & - & - \tabularnewline
26 & 113.46 & - & - & - & - & - & - & - \tabularnewline
27 & 114.06 & - & - & - & - & - & - & - \tabularnewline
28 & 115.54 & - & - & - & - & - & - & - \tabularnewline
29 & 116.39 & - & - & - & - & - & - & - \tabularnewline
30 & 115.94 & - & - & - & - & - & - & - \tabularnewline
31 & 116.97 & - & - & - & - & - & - & - \tabularnewline
32 & 115.94 & - & - & - & - & - & - & - \tabularnewline
33 & 115.91 & - & - & - & - & - & - & - \tabularnewline
34 & 116.43 & 116.2968 & 114.8699 & 117.7237 & 0.4274 & 0.7024 & 1 & 0.7024 \tabularnewline
35 & 116.26 & 116.4415 & 114.533 & 118.3501 & 0.4261 & 0.5047 & 1 & 0.7074 \tabularnewline
36 & 116.35 & 116.4104 & 113.8892 & 118.9315 & 0.4813 & 0.5465 & 0.9995 & 0.6514 \tabularnewline
37 & 117.9 & 116.8396 & 113.5743 & 120.105 & 0.2622 & 0.6156 & 0.9822 & 0.7116 \tabularnewline
38 & 117.7 & 116.8459 & 112.9927 & 120.6991 & 0.332 & 0.2959 & 0.9575 & 0.683 \tabularnewline
39 & 117.53 & 116.9182 & 112.4364 & 121.4 & 0.3945 & 0.3662 & 0.8943 & 0.6704 \tabularnewline
40 & 117.86 & 117.5532 & 112.4642 & 122.6421 & 0.453 & 0.5036 & 0.7809 & 0.7366 \tabularnewline
41 & 117.65 & 117.6737 & 112.0225 & 123.3248 & 0.4967 & 0.4742 & 0.6719 & 0.7296 \tabularnewline
42 & 116.51 & 117.5104 & 111.3031 & 123.7178 & 0.376 & 0.4824 & 0.69 & 0.6933 \tabularnewline
43 & 115.93 & 117.7831 & 111.0492 & 124.5169 & 0.2948 & 0.6445 & 0.5935 & 0.7072 \tabularnewline
44 & 115.31 & 117.5268 & 110.2907 & 124.7629 & 0.2741 & 0.6673 & 0.6663 & 0.6693 \tabularnewline
45 & 115 & 117.8127 & 110.0928 & 125.5327 & 0.2376 & 0.7374 & 0.6855 & 0.6855 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66801&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[33])[/C][/ROW]
[ROW][C]21[/C][C]108.41[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]22[/C][C]109.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]23[/C][C]111.45[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]24[/C][C]112.18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]25[/C][C]113.34[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]26[/C][C]113.46[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]27[/C][C]114.06[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]28[/C][C]115.54[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]29[/C][C]116.39[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]30[/C][C]115.94[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]31[/C][C]116.97[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]32[/C][C]115.94[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]115.91[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]116.43[/C][C]116.2968[/C][C]114.8699[/C][C]117.7237[/C][C]0.4274[/C][C]0.7024[/C][C]1[/C][C]0.7024[/C][/ROW]
[ROW][C]35[/C][C]116.26[/C][C]116.4415[/C][C]114.533[/C][C]118.3501[/C][C]0.4261[/C][C]0.5047[/C][C]1[/C][C]0.7074[/C][/ROW]
[ROW][C]36[/C][C]116.35[/C][C]116.4104[/C][C]113.8892[/C][C]118.9315[/C][C]0.4813[/C][C]0.5465[/C][C]0.9995[/C][C]0.6514[/C][/ROW]
[ROW][C]37[/C][C]117.9[/C][C]116.8396[/C][C]113.5743[/C][C]120.105[/C][C]0.2622[/C][C]0.6156[/C][C]0.9822[/C][C]0.7116[/C][/ROW]
[ROW][C]38[/C][C]117.7[/C][C]116.8459[/C][C]112.9927[/C][C]120.6991[/C][C]0.332[/C][C]0.2959[/C][C]0.9575[/C][C]0.683[/C][/ROW]
[ROW][C]39[/C][C]117.53[/C][C]116.9182[/C][C]112.4364[/C][C]121.4[/C][C]0.3945[/C][C]0.3662[/C][C]0.8943[/C][C]0.6704[/C][/ROW]
[ROW][C]40[/C][C]117.86[/C][C]117.5532[/C][C]112.4642[/C][C]122.6421[/C][C]0.453[/C][C]0.5036[/C][C]0.7809[/C][C]0.7366[/C][/ROW]
[ROW][C]41[/C][C]117.65[/C][C]117.6737[/C][C]112.0225[/C][C]123.3248[/C][C]0.4967[/C][C]0.4742[/C][C]0.6719[/C][C]0.7296[/C][/ROW]
[ROW][C]42[/C][C]116.51[/C][C]117.5104[/C][C]111.3031[/C][C]123.7178[/C][C]0.376[/C][C]0.4824[/C][C]0.69[/C][C]0.6933[/C][/ROW]
[ROW][C]43[/C][C]115.93[/C][C]117.7831[/C][C]111.0492[/C][C]124.5169[/C][C]0.2948[/C][C]0.6445[/C][C]0.5935[/C][C]0.7072[/C][/ROW]
[ROW][C]44[/C][C]115.31[/C][C]117.5268[/C][C]110.2907[/C][C]124.7629[/C][C]0.2741[/C][C]0.6673[/C][C]0.6663[/C][C]0.6693[/C][/ROW]
[ROW][C]45[/C][C]115[/C][C]117.8127[/C][C]110.0928[/C][C]125.5327[/C][C]0.2376[/C][C]0.7374[/C][C]0.6855[/C][C]0.6855[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66801&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66801&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[33])
21108.41-------
22109.9-------
23111.45-------
24112.18-------
25113.34-------
26113.46-------
27114.06-------
28115.54-------
29116.39-------
30115.94-------
31116.97-------
32115.94-------
33115.91-------
34116.43116.2968114.8699117.72370.42740.702410.7024
35116.26116.4415114.533118.35010.42610.504710.7074
36116.35116.4104113.8892118.93150.48130.54650.99950.6514
37117.9116.8396113.5743120.1050.26220.61560.98220.7116
38117.7116.8459112.9927120.69910.3320.29590.95750.683
39117.53116.9182112.4364121.40.39450.36620.89430.6704
40117.86117.5532112.4642122.64210.4530.50360.78090.7366
41117.65117.6737112.0225123.32480.49670.47420.67190.7296
42116.51117.5104111.3031123.71780.3760.48240.690.6933
43115.93117.7831111.0492124.51690.29480.64450.59350.7072
44115.31117.5268110.2907124.76290.27410.66730.66630.6693
45115117.8127110.0928125.53270.23760.73740.68550.6855







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
340.00630.001100.017700
350.0084-0.00160.00140.0330.02540.1592
360.011-5e-040.00110.00360.01810.1346
370.01430.00910.00311.12440.29470.5428
380.01680.00730.00390.72940.38160.6178
390.01960.00520.00410.37430.38040.6168
400.02210.00260.00390.09420.33950.5827
410.0245-2e-040.00356e-040.29710.5451
420.027-0.00850.0041.00090.37530.6126
430.0292-0.01570.00523.43380.68120.8253
440.0314-0.01890.00644.91411.0661.0325
450.0334-0.02390.00797.91151.63641.2792

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
34 & 0.0063 & 0.0011 & 0 & 0.0177 & 0 & 0 \tabularnewline
35 & 0.0084 & -0.0016 & 0.0014 & 0.033 & 0.0254 & 0.1592 \tabularnewline
36 & 0.011 & -5e-04 & 0.0011 & 0.0036 & 0.0181 & 0.1346 \tabularnewline
37 & 0.0143 & 0.0091 & 0.0031 & 1.1244 & 0.2947 & 0.5428 \tabularnewline
38 & 0.0168 & 0.0073 & 0.0039 & 0.7294 & 0.3816 & 0.6178 \tabularnewline
39 & 0.0196 & 0.0052 & 0.0041 & 0.3743 & 0.3804 & 0.6168 \tabularnewline
40 & 0.0221 & 0.0026 & 0.0039 & 0.0942 & 0.3395 & 0.5827 \tabularnewline
41 & 0.0245 & -2e-04 & 0.0035 & 6e-04 & 0.2971 & 0.5451 \tabularnewline
42 & 0.027 & -0.0085 & 0.004 & 1.0009 & 0.3753 & 0.6126 \tabularnewline
43 & 0.0292 & -0.0157 & 0.0052 & 3.4338 & 0.6812 & 0.8253 \tabularnewline
44 & 0.0314 & -0.0189 & 0.0064 & 4.9141 & 1.066 & 1.0325 \tabularnewline
45 & 0.0334 & -0.0239 & 0.0079 & 7.9115 & 1.6364 & 1.2792 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66801&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]34[/C][C]0.0063[/C][C]0.0011[/C][C]0[/C][C]0.0177[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]35[/C][C]0.0084[/C][C]-0.0016[/C][C]0.0014[/C][C]0.033[/C][C]0.0254[/C][C]0.1592[/C][/ROW]
[ROW][C]36[/C][C]0.011[/C][C]-5e-04[/C][C]0.0011[/C][C]0.0036[/C][C]0.0181[/C][C]0.1346[/C][/ROW]
[ROW][C]37[/C][C]0.0143[/C][C]0.0091[/C][C]0.0031[/C][C]1.1244[/C][C]0.2947[/C][C]0.5428[/C][/ROW]
[ROW][C]38[/C][C]0.0168[/C][C]0.0073[/C][C]0.0039[/C][C]0.7294[/C][C]0.3816[/C][C]0.6178[/C][/ROW]
[ROW][C]39[/C][C]0.0196[/C][C]0.0052[/C][C]0.0041[/C][C]0.3743[/C][C]0.3804[/C][C]0.6168[/C][/ROW]
[ROW][C]40[/C][C]0.0221[/C][C]0.0026[/C][C]0.0039[/C][C]0.0942[/C][C]0.3395[/C][C]0.5827[/C][/ROW]
[ROW][C]41[/C][C]0.0245[/C][C]-2e-04[/C][C]0.0035[/C][C]6e-04[/C][C]0.2971[/C][C]0.5451[/C][/ROW]
[ROW][C]42[/C][C]0.027[/C][C]-0.0085[/C][C]0.004[/C][C]1.0009[/C][C]0.3753[/C][C]0.6126[/C][/ROW]
[ROW][C]43[/C][C]0.0292[/C][C]-0.0157[/C][C]0.0052[/C][C]3.4338[/C][C]0.6812[/C][C]0.8253[/C][/ROW]
[ROW][C]44[/C][C]0.0314[/C][C]-0.0189[/C][C]0.0064[/C][C]4.9141[/C][C]1.066[/C][C]1.0325[/C][/ROW]
[ROW][C]45[/C][C]0.0334[/C][C]-0.0239[/C][C]0.0079[/C][C]7.9115[/C][C]1.6364[/C][C]1.2792[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66801&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66801&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
340.00630.001100.017700
350.0084-0.00160.00140.0330.02540.1592
360.011-5e-040.00110.00360.01810.1346
370.01430.00910.00311.12440.29470.5428
380.01680.00730.00390.72940.38160.6178
390.01960.00520.00410.37430.38040.6168
400.02210.00260.00390.09420.33950.5827
410.0245-2e-040.00356e-040.29710.5451
420.027-0.00850.0041.00090.37530.6126
430.0292-0.01570.00523.43380.68120.8253
440.0314-0.01890.00644.91411.0661.0325
450.0334-0.02390.00797.91151.63641.2792



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