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, 15 Dec 2009 21:00:10 -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/16/t1260936076jnr38h4hhvdntfl.htm/, Retrieved Tue, 30 Apr 2024 15:53:04 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=68224, Retrieved Tue, 30 Apr 2024 15:53:04 +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)
-     [Bivariate Granger Causality] [] [2009-12-07 09:26:51] [b98453cac15ba1066b407e146608df68]
- RM D  [ARIMA Forecasting] [Shwws10_v1] [2009-12-09 19:58:16] [5f89c040fdf1f8599c99d7f78a662321]
-   P     [ARIMA Forecasting] [Shwws10_v1] [2009-12-11 21:28:43] [5f89c040fdf1f8599c99d7f78a662321]
-   PD        [ARIMA Forecasting] [Paper] [2009-12-16 04:00:10] [93b66894f6318f3da4fcda772f2ffa6f] [Current]
-   PD          [ARIMA Forecasting] [Paper] [2009-12-16 04:15:07] [5f89c040fdf1f8599c99d7f78a662321]
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
115.45
115.83




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68224&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[35])
23111.45-------
24112.18-------
25113.34-------
26113.46-------
27114.06-------
28115.54-------
29116.39-------
30115.94-------
31116.97-------
32115.94-------
33115.91-------
34116.43-------
35116.26-------
36116.35116.4103114.9342117.88650.46810.579110.5791
37117.9116.5489114.5521118.54570.09240.57740.99920.6116
38117.7116.5136113.8433119.18390.19190.15440.98750.5738
39117.53116.6137113.112120.11530.3040.27160.92360.5785
40117.86116.6481112.4632120.83290.28510.33980.69810.5721
41117.65116.6597111.7367121.58260.34670.31640.54270.5632
42116.51116.7068111.0616122.3520.47280.37170.6050.5616
43115.93116.7191110.3986123.03960.40330.52580.4690.5566
44115.31116.7358109.7397123.73180.34480.58930.58820.553
45115116.7559109.1146124.39710.32620.64460.58590.5506
46115.45116.7635108.5016125.02540.37770.66220.53150.5475
47115.83116.7749107.909125.64080.41730.61520.54530.5453

\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[35]) \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 & - & - & - & - & - & - & - \tabularnewline
35 & 116.26 & - & - & - & - & - & - & - \tabularnewline
36 & 116.35 & 116.4103 & 114.9342 & 117.8865 & 0.4681 & 0.5791 & 1 & 0.5791 \tabularnewline
37 & 117.9 & 116.5489 & 114.5521 & 118.5457 & 0.0924 & 0.5774 & 0.9992 & 0.6116 \tabularnewline
38 & 117.7 & 116.5136 & 113.8433 & 119.1839 & 0.1919 & 0.1544 & 0.9875 & 0.5738 \tabularnewline
39 & 117.53 & 116.6137 & 113.112 & 120.1153 & 0.304 & 0.2716 & 0.9236 & 0.5785 \tabularnewline
40 & 117.86 & 116.6481 & 112.4632 & 120.8329 & 0.2851 & 0.3398 & 0.6981 & 0.5721 \tabularnewline
41 & 117.65 & 116.6597 & 111.7367 & 121.5826 & 0.3467 & 0.3164 & 0.5427 & 0.5632 \tabularnewline
42 & 116.51 & 116.7068 & 111.0616 & 122.352 & 0.4728 & 0.3717 & 0.605 & 0.5616 \tabularnewline
43 & 115.93 & 116.7191 & 110.3986 & 123.0396 & 0.4033 & 0.5258 & 0.469 & 0.5566 \tabularnewline
44 & 115.31 & 116.7358 & 109.7397 & 123.7318 & 0.3448 & 0.5893 & 0.5882 & 0.553 \tabularnewline
45 & 115 & 116.7559 & 109.1146 & 124.3971 & 0.3262 & 0.6446 & 0.5859 & 0.5506 \tabularnewline
46 & 115.45 & 116.7635 & 108.5016 & 125.0254 & 0.3777 & 0.6622 & 0.5315 & 0.5475 \tabularnewline
47 & 115.83 & 116.7749 & 107.909 & 125.6408 & 0.4173 & 0.6152 & 0.5453 & 0.5453 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=68224&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[35])[/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]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]116.26[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]116.35[/C][C]116.4103[/C][C]114.9342[/C][C]117.8865[/C][C]0.4681[/C][C]0.5791[/C][C]1[/C][C]0.5791[/C][/ROW]
[ROW][C]37[/C][C]117.9[/C][C]116.5489[/C][C]114.5521[/C][C]118.5457[/C][C]0.0924[/C][C]0.5774[/C][C]0.9992[/C][C]0.6116[/C][/ROW]
[ROW][C]38[/C][C]117.7[/C][C]116.5136[/C][C]113.8433[/C][C]119.1839[/C][C]0.1919[/C][C]0.1544[/C][C]0.9875[/C][C]0.5738[/C][/ROW]
[ROW][C]39[/C][C]117.53[/C][C]116.6137[/C][C]113.112[/C][C]120.1153[/C][C]0.304[/C][C]0.2716[/C][C]0.9236[/C][C]0.5785[/C][/ROW]
[ROW][C]40[/C][C]117.86[/C][C]116.6481[/C][C]112.4632[/C][C]120.8329[/C][C]0.2851[/C][C]0.3398[/C][C]0.6981[/C][C]0.5721[/C][/ROW]
[ROW][C]41[/C][C]117.65[/C][C]116.6597[/C][C]111.7367[/C][C]121.5826[/C][C]0.3467[/C][C]0.3164[/C][C]0.5427[/C][C]0.5632[/C][/ROW]
[ROW][C]42[/C][C]116.51[/C][C]116.7068[/C][C]111.0616[/C][C]122.352[/C][C]0.4728[/C][C]0.3717[/C][C]0.605[/C][C]0.5616[/C][/ROW]
[ROW][C]43[/C][C]115.93[/C][C]116.7191[/C][C]110.3986[/C][C]123.0396[/C][C]0.4033[/C][C]0.5258[/C][C]0.469[/C][C]0.5566[/C][/ROW]
[ROW][C]44[/C][C]115.31[/C][C]116.7358[/C][C]109.7397[/C][C]123.7318[/C][C]0.3448[/C][C]0.5893[/C][C]0.5882[/C][C]0.553[/C][/ROW]
[ROW][C]45[/C][C]115[/C][C]116.7559[/C][C]109.1146[/C][C]124.3971[/C][C]0.3262[/C][C]0.6446[/C][C]0.5859[/C][C]0.5506[/C][/ROW]
[ROW][C]46[/C][C]115.45[/C][C]116.7635[/C][C]108.5016[/C][C]125.0254[/C][C]0.3777[/C][C]0.6622[/C][C]0.5315[/C][C]0.5475[/C][/ROW]
[ROW][C]47[/C][C]115.83[/C][C]116.7749[/C][C]107.909[/C][C]125.6408[/C][C]0.4173[/C][C]0.6152[/C][C]0.5453[/C][C]0.5453[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=68224&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68224&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[35])
23111.45-------
24112.18-------
25113.34-------
26113.46-------
27114.06-------
28115.54-------
29116.39-------
30115.94-------
31116.97-------
32115.94-------
33115.91-------
34116.43-------
35116.26-------
36116.35116.4103114.9342117.88650.46810.579110.5791
37117.9116.5489114.5521118.54570.09240.57740.99920.6116
38117.7116.5136113.8433119.18390.19190.15440.98750.5738
39117.53116.6137113.112120.11530.3040.27160.92360.5785
40117.86116.6481112.4632120.83290.28510.33980.69810.5721
41117.65116.6597111.7367121.58260.34670.31640.54270.5632
42116.51116.7068111.0616122.3520.47280.37170.6050.5616
43115.93116.7191110.3986123.03960.40330.52580.4690.5566
44115.31116.7358109.7397123.73180.34480.58930.58820.553
45115116.7559109.1146124.39710.32620.64460.58590.5506
46115.45116.7635108.5016125.02540.37770.66220.53150.5475
47115.83116.7749107.909125.64080.41730.61520.54530.5453







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
360.0065-5e-0400.003600
370.00870.01160.00611.82550.91460.9563
380.01170.01020.00741.40751.07891.0387
390.01530.00790.00750.83971.01911.0095
400.01830.01040.00811.46881.1091.0531
410.02150.00850.00820.98081.08761.0429
420.0247-0.00170.00720.03870.93780.9684
430.0276-0.00680.00720.62270.89840.9478
440.0306-0.01220.00772.03281.02441.0122
450.0334-0.0150.00853.08311.23031.1092
460.0361-0.01120.00871.72531.27531.1293
470.0387-0.00810.00870.89281.24341.1151

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
36 & 0.0065 & -5e-04 & 0 & 0.0036 & 0 & 0 \tabularnewline
37 & 0.0087 & 0.0116 & 0.0061 & 1.8255 & 0.9146 & 0.9563 \tabularnewline
38 & 0.0117 & 0.0102 & 0.0074 & 1.4075 & 1.0789 & 1.0387 \tabularnewline
39 & 0.0153 & 0.0079 & 0.0075 & 0.8397 & 1.0191 & 1.0095 \tabularnewline
40 & 0.0183 & 0.0104 & 0.0081 & 1.4688 & 1.109 & 1.0531 \tabularnewline
41 & 0.0215 & 0.0085 & 0.0082 & 0.9808 & 1.0876 & 1.0429 \tabularnewline
42 & 0.0247 & -0.0017 & 0.0072 & 0.0387 & 0.9378 & 0.9684 \tabularnewline
43 & 0.0276 & -0.0068 & 0.0072 & 0.6227 & 0.8984 & 0.9478 \tabularnewline
44 & 0.0306 & -0.0122 & 0.0077 & 2.0328 & 1.0244 & 1.0122 \tabularnewline
45 & 0.0334 & -0.015 & 0.0085 & 3.0831 & 1.2303 & 1.1092 \tabularnewline
46 & 0.0361 & -0.0112 & 0.0087 & 1.7253 & 1.2753 & 1.1293 \tabularnewline
47 & 0.0387 & -0.0081 & 0.0087 & 0.8928 & 1.2434 & 1.1151 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=68224&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]36[/C][C]0.0065[/C][C]-5e-04[/C][C]0[/C][C]0.0036[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]37[/C][C]0.0087[/C][C]0.0116[/C][C]0.0061[/C][C]1.8255[/C][C]0.9146[/C][C]0.9563[/C][/ROW]
[ROW][C]38[/C][C]0.0117[/C][C]0.0102[/C][C]0.0074[/C][C]1.4075[/C][C]1.0789[/C][C]1.0387[/C][/ROW]
[ROW][C]39[/C][C]0.0153[/C][C]0.0079[/C][C]0.0075[/C][C]0.8397[/C][C]1.0191[/C][C]1.0095[/C][/ROW]
[ROW][C]40[/C][C]0.0183[/C][C]0.0104[/C][C]0.0081[/C][C]1.4688[/C][C]1.109[/C][C]1.0531[/C][/ROW]
[ROW][C]41[/C][C]0.0215[/C][C]0.0085[/C][C]0.0082[/C][C]0.9808[/C][C]1.0876[/C][C]1.0429[/C][/ROW]
[ROW][C]42[/C][C]0.0247[/C][C]-0.0017[/C][C]0.0072[/C][C]0.0387[/C][C]0.9378[/C][C]0.9684[/C][/ROW]
[ROW][C]43[/C][C]0.0276[/C][C]-0.0068[/C][C]0.0072[/C][C]0.6227[/C][C]0.8984[/C][C]0.9478[/C][/ROW]
[ROW][C]44[/C][C]0.0306[/C][C]-0.0122[/C][C]0.0077[/C][C]2.0328[/C][C]1.0244[/C][C]1.0122[/C][/ROW]
[ROW][C]45[/C][C]0.0334[/C][C]-0.015[/C][C]0.0085[/C][C]3.0831[/C][C]1.2303[/C][C]1.1092[/C][/ROW]
[ROW][C]46[/C][C]0.0361[/C][C]-0.0112[/C][C]0.0087[/C][C]1.7253[/C][C]1.2753[/C][C]1.1293[/C][/ROW]
[ROW][C]47[/C][C]0.0387[/C][C]-0.0081[/C][C]0.0087[/C][C]0.8928[/C][C]1.2434[/C][C]1.1151[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=68224&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68224&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
360.0065-5e-0400.003600
370.00870.01160.00611.82550.91460.9563
380.01170.01020.00741.40751.07891.0387
390.01530.00790.00750.83971.01911.0095
400.01830.01040.00811.46881.1091.0531
410.02150.00850.00820.98081.08761.0429
420.0247-0.00170.00720.03870.93780.9684
430.0276-0.00680.00720.62270.89840.9478
440.0306-0.01220.00772.03281.02441.0122
450.0334-0.0150.00853.08311.23031.1092
460.0361-0.01120.00871.72531.27531.1293
470.0387-0.00810.00870.89281.24341.1151



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