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 04:21:06 -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/t1261394530qrssijvm4kc6b4s.htm/, Retrieved Thu, 02 May 2024 11:53:42 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70103, Retrieved Thu, 02 May 2024 11:53:42 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact143
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [] [2009-11-05 08:15:26] [74be16979710d4c4e7c6647856088456]
-   PD  [Univariate Data Series] [] [2009-11-11 08:16:12] [74be16979710d4c4e7c6647856088456]
- RMP     [ARIMA Forecasting] [] [2009-12-06 18:23:17] [5d885a68c2332cc44f6191ec94766bfa]
-   PD        [ARIMA Forecasting] [] [2009-12-21 11:21:06] [2b679e8ec54382eeb0ec0b6bb527570a] [Current]
Feedback Forum

Post a new message
Dataseries X:
101.09
102.71
102.11
101.68
101.7
101.53
101.76
101.15
100.92
100.73
100.55
102.15
100.79
99.93
100.03
100.25
99.6
100.16
100.49
99.72
100.14
98.48
100.38
101.45
98.42
98.6
100.06
98.62
100.84
100.02
97.95
98.32
98.27
97.22
99.28
100.38
99.02
100.32
99.81
100.6
101.19
100.47
101.77
102.32
102.39
101.16
100.63
101.48
101.44
100.09
100.7
100.78
99.81
98.45
98.49
97.48
97.91
96.94
98.53
96.82
95.76




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70103&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[49])
3799.02-------
38100.32-------
3999.81-------
40100.6-------
41101.19-------
42100.47-------
43101.77-------
44102.32-------
45102.39-------
46101.16-------
47100.63-------
48101.48-------
49101.44-------
50100.09101.695799.5989103.79260.06670.59450.90080.5945
51100.7101.66398.6975104.62840.26220.85070.88970.5586
52100.78101.7598.1181105.38190.30030.71450.73260.5664
5399.81101.960497.7667106.15420.15740.70940.64060.5961
5498.45101.78797.0983106.47570.08150.79570.7090.5577
5598.49101.943496.8072107.07970.09380.90870.52640.5762
5697.48102.064696.5168107.61240.05260.89670.4640.5873
5797.91102.075796.1449108.00660.08430.93560.45860.5832
5896.94101.794995.5043108.08550.06520.88690.57840.544
5998.53101.784895.154108.41570.1680.92390.63360.5406
6096.82101.995495.0409108.94990.07230.83560.55770.5622
6195.76101.927794.664109.19150.0480.91590.55240.5524

\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[49]) \tabularnewline
37 & 99.02 & - & - & - & - & - & - & - \tabularnewline
38 & 100.32 & - & - & - & - & - & - & - \tabularnewline
39 & 99.81 & - & - & - & - & - & - & - \tabularnewline
40 & 100.6 & - & - & - & - & - & - & - \tabularnewline
41 & 101.19 & - & - & - & - & - & - & - \tabularnewline
42 & 100.47 & - & - & - & - & - & - & - \tabularnewline
43 & 101.77 & - & - & - & - & - & - & - \tabularnewline
44 & 102.32 & - & - & - & - & - & - & - \tabularnewline
45 & 102.39 & - & - & - & - & - & - & - \tabularnewline
46 & 101.16 & - & - & - & - & - & - & - \tabularnewline
47 & 100.63 & - & - & - & - & - & - & - \tabularnewline
48 & 101.48 & - & - & - & - & - & - & - \tabularnewline
49 & 101.44 & - & - & - & - & - & - & - \tabularnewline
50 & 100.09 & 101.6957 & 99.5989 & 103.7926 & 0.0667 & 0.5945 & 0.9008 & 0.5945 \tabularnewline
51 & 100.7 & 101.663 & 98.6975 & 104.6284 & 0.2622 & 0.8507 & 0.8897 & 0.5586 \tabularnewline
52 & 100.78 & 101.75 & 98.1181 & 105.3819 & 0.3003 & 0.7145 & 0.7326 & 0.5664 \tabularnewline
53 & 99.81 & 101.9604 & 97.7667 & 106.1542 & 0.1574 & 0.7094 & 0.6406 & 0.5961 \tabularnewline
54 & 98.45 & 101.787 & 97.0983 & 106.4757 & 0.0815 & 0.7957 & 0.709 & 0.5577 \tabularnewline
55 & 98.49 & 101.9434 & 96.8072 & 107.0797 & 0.0938 & 0.9087 & 0.5264 & 0.5762 \tabularnewline
56 & 97.48 & 102.0646 & 96.5168 & 107.6124 & 0.0526 & 0.8967 & 0.464 & 0.5873 \tabularnewline
57 & 97.91 & 102.0757 & 96.1449 & 108.0066 & 0.0843 & 0.9356 & 0.4586 & 0.5832 \tabularnewline
58 & 96.94 & 101.7949 & 95.5043 & 108.0855 & 0.0652 & 0.8869 & 0.5784 & 0.544 \tabularnewline
59 & 98.53 & 101.7848 & 95.154 & 108.4157 & 0.168 & 0.9239 & 0.6336 & 0.5406 \tabularnewline
60 & 96.82 & 101.9954 & 95.0409 & 108.9499 & 0.0723 & 0.8356 & 0.5577 & 0.5622 \tabularnewline
61 & 95.76 & 101.9277 & 94.664 & 109.1915 & 0.048 & 0.9159 & 0.5524 & 0.5524 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70103&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[49])[/C][/ROW]
[ROW][C]37[/C][C]99.02[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]100.32[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]99.81[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]100.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]101.19[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]100.47[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]101.77[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]102.32[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]102.39[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]101.16[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]100.63[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]101.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]101.44[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]100.09[/C][C]101.6957[/C][C]99.5989[/C][C]103.7926[/C][C]0.0667[/C][C]0.5945[/C][C]0.9008[/C][C]0.5945[/C][/ROW]
[ROW][C]51[/C][C]100.7[/C][C]101.663[/C][C]98.6975[/C][C]104.6284[/C][C]0.2622[/C][C]0.8507[/C][C]0.8897[/C][C]0.5586[/C][/ROW]
[ROW][C]52[/C][C]100.78[/C][C]101.75[/C][C]98.1181[/C][C]105.3819[/C][C]0.3003[/C][C]0.7145[/C][C]0.7326[/C][C]0.5664[/C][/ROW]
[ROW][C]53[/C][C]99.81[/C][C]101.9604[/C][C]97.7667[/C][C]106.1542[/C][C]0.1574[/C][C]0.7094[/C][C]0.6406[/C][C]0.5961[/C][/ROW]
[ROW][C]54[/C][C]98.45[/C][C]101.787[/C][C]97.0983[/C][C]106.4757[/C][C]0.0815[/C][C]0.7957[/C][C]0.709[/C][C]0.5577[/C][/ROW]
[ROW][C]55[/C][C]98.49[/C][C]101.9434[/C][C]96.8072[/C][C]107.0797[/C][C]0.0938[/C][C]0.9087[/C][C]0.5264[/C][C]0.5762[/C][/ROW]
[ROW][C]56[/C][C]97.48[/C][C]102.0646[/C][C]96.5168[/C][C]107.6124[/C][C]0.0526[/C][C]0.8967[/C][C]0.464[/C][C]0.5873[/C][/ROW]
[ROW][C]57[/C][C]97.91[/C][C]102.0757[/C][C]96.1449[/C][C]108.0066[/C][C]0.0843[/C][C]0.9356[/C][C]0.4586[/C][C]0.5832[/C][/ROW]
[ROW][C]58[/C][C]96.94[/C][C]101.7949[/C][C]95.5043[/C][C]108.0855[/C][C]0.0652[/C][C]0.8869[/C][C]0.5784[/C][C]0.544[/C][/ROW]
[ROW][C]59[/C][C]98.53[/C][C]101.7848[/C][C]95.154[/C][C]108.4157[/C][C]0.168[/C][C]0.9239[/C][C]0.6336[/C][C]0.5406[/C][/ROW]
[ROW][C]60[/C][C]96.82[/C][C]101.9954[/C][C]95.0409[/C][C]108.9499[/C][C]0.0723[/C][C]0.8356[/C][C]0.5577[/C][C]0.5622[/C][/ROW]
[ROW][C]61[/C][C]95.76[/C][C]101.9277[/C][C]94.664[/C][C]109.1915[/C][C]0.048[/C][C]0.9159[/C][C]0.5524[/C][C]0.5524[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70103&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70103&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[49])
3799.02-------
38100.32-------
3999.81-------
40100.6-------
41101.19-------
42100.47-------
43101.77-------
44102.32-------
45102.39-------
46101.16-------
47100.63-------
48101.48-------
49101.44-------
50100.09101.695799.5989103.79260.06670.59450.90080.5945
51100.7101.66398.6975104.62840.26220.85070.88970.5586
52100.78101.7598.1181105.38190.30030.71450.73260.5664
5399.81101.960497.7667106.15420.15740.70940.64060.5961
5498.45101.78797.0983106.47570.08150.79570.7090.5577
5598.49101.943496.8072107.07970.09380.90870.52640.5762
5697.48102.064696.5168107.61240.05260.89670.4640.5873
5797.91102.075796.1449108.00660.08430.93560.45860.5832
5896.94101.794995.5043108.08550.06520.88690.57840.544
5998.53101.784895.154108.41570.1680.92390.63360.5406
6096.82101.995495.0409108.94990.07230.83560.55770.5622
6195.76101.927794.664109.19150.0480.91590.55240.5524







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.0105-0.015802.578400
510.0149-0.00950.01260.92731.75281.3239
520.0182-0.00950.01160.94091.48221.2174
530.021-0.02110.0144.62432.26771.5059
540.0235-0.03280.017711.13554.04132.0103
550.0257-0.03390.020411.92615.35542.3142
560.0277-0.04490.023921.01847.5932.7555
570.0296-0.04080.02617.35328.8132.9687
580.0315-0.04770.028423.570310.45273.2331
590.0332-0.0320.028810.593910.46683.2352
600.0348-0.05070.030826.784711.95033.4569
610.0364-0.06050.033338.041114.12453.7583

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0105 & -0.0158 & 0 & 2.5784 & 0 & 0 \tabularnewline
51 & 0.0149 & -0.0095 & 0.0126 & 0.9273 & 1.7528 & 1.3239 \tabularnewline
52 & 0.0182 & -0.0095 & 0.0116 & 0.9409 & 1.4822 & 1.2174 \tabularnewline
53 & 0.021 & -0.0211 & 0.014 & 4.6243 & 2.2677 & 1.5059 \tabularnewline
54 & 0.0235 & -0.0328 & 0.0177 & 11.1355 & 4.0413 & 2.0103 \tabularnewline
55 & 0.0257 & -0.0339 & 0.0204 & 11.9261 & 5.3554 & 2.3142 \tabularnewline
56 & 0.0277 & -0.0449 & 0.0239 & 21.0184 & 7.593 & 2.7555 \tabularnewline
57 & 0.0296 & -0.0408 & 0.026 & 17.3532 & 8.813 & 2.9687 \tabularnewline
58 & 0.0315 & -0.0477 & 0.0284 & 23.5703 & 10.4527 & 3.2331 \tabularnewline
59 & 0.0332 & -0.032 & 0.0288 & 10.5939 & 10.4668 & 3.2352 \tabularnewline
60 & 0.0348 & -0.0507 & 0.0308 & 26.7847 & 11.9503 & 3.4569 \tabularnewline
61 & 0.0364 & -0.0605 & 0.0333 & 38.0411 & 14.1245 & 3.7583 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70103&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]50[/C][C]0.0105[/C][C]-0.0158[/C][C]0[/C][C]2.5784[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]0.0149[/C][C]-0.0095[/C][C]0.0126[/C][C]0.9273[/C][C]1.7528[/C][C]1.3239[/C][/ROW]
[ROW][C]52[/C][C]0.0182[/C][C]-0.0095[/C][C]0.0116[/C][C]0.9409[/C][C]1.4822[/C][C]1.2174[/C][/ROW]
[ROW][C]53[/C][C]0.021[/C][C]-0.0211[/C][C]0.014[/C][C]4.6243[/C][C]2.2677[/C][C]1.5059[/C][/ROW]
[ROW][C]54[/C][C]0.0235[/C][C]-0.0328[/C][C]0.0177[/C][C]11.1355[/C][C]4.0413[/C][C]2.0103[/C][/ROW]
[ROW][C]55[/C][C]0.0257[/C][C]-0.0339[/C][C]0.0204[/C][C]11.9261[/C][C]5.3554[/C][C]2.3142[/C][/ROW]
[ROW][C]56[/C][C]0.0277[/C][C]-0.0449[/C][C]0.0239[/C][C]21.0184[/C][C]7.593[/C][C]2.7555[/C][/ROW]
[ROW][C]57[/C][C]0.0296[/C][C]-0.0408[/C][C]0.026[/C][C]17.3532[/C][C]8.813[/C][C]2.9687[/C][/ROW]
[ROW][C]58[/C][C]0.0315[/C][C]-0.0477[/C][C]0.0284[/C][C]23.5703[/C][C]10.4527[/C][C]3.2331[/C][/ROW]
[ROW][C]59[/C][C]0.0332[/C][C]-0.032[/C][C]0.0288[/C][C]10.5939[/C][C]10.4668[/C][C]3.2352[/C][/ROW]
[ROW][C]60[/C][C]0.0348[/C][C]-0.0507[/C][C]0.0308[/C][C]26.7847[/C][C]11.9503[/C][C]3.4569[/C][/ROW]
[ROW][C]61[/C][C]0.0364[/C][C]-0.0605[/C][C]0.0333[/C][C]38.0411[/C][C]14.1245[/C][C]3.7583[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70103&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70103&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
500.0105-0.015802.578400
510.0149-0.00950.01260.92731.75281.3239
520.0182-0.00950.01160.94091.48221.2174
530.021-0.02110.0144.62432.26771.5059
540.0235-0.03280.017711.13554.04132.0103
550.0257-0.03390.020411.92615.35542.3142
560.0277-0.04490.023921.01847.5932.7555
570.0296-0.04080.02617.35328.8132.9687
580.0315-0.04770.028423.570310.45273.2331
590.0332-0.0320.028810.593910.46683.2352
600.0348-0.05070.030826.784711.95033.4569
610.0364-0.06050.033338.041114.12453.7583



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