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 computationThu, 16 Dec 2010 19:42:36 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/16/t1292528523bff9bnxccj795k9.htm/, Retrieved Fri, 03 May 2024 11:15:58 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=111231, Retrieved Fri, 03 May 2024 11:15:58 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact168
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [] [2008-12-08 19:22:39] [d2d412c7f4d35ffbf5ee5ee89db327d4]
- RMP   [Spectral Analysis] [spectrum analyse ...] [2010-12-14 18:46:58] [d6e648f00513dd750579ba7880c5fbf5]
- RMP     [ARIMA Forecasting] [arima forecast] [2010-12-14 19:31:52] [d6e648f00513dd750579ba7880c5fbf5]
- R  D      [ARIMA Forecasting] [] [2010-12-16 10:41:45] [58af523ef9b33032fd2497c80088399b]
F   PD          [ARIMA Forecasting] [] [2010-12-16 19:42:36] [7c1b7ddc8e9000e55b944088fdfb52dc] [Current]
-   PD            [ARIMA Forecasting] [] [2010-12-18 12:13:53] [58af523ef9b33032fd2497c80088399b]
- R PD            [ARIMA Forecasting] [verbetering FORECAST] [2010-12-24 13:52:30] [2805bc4d0d3810b6cd96238758e5985d]
Feedback Forum
2010-12-19 19:18:33 [5d62d7e88f1e34c4608b4d5b79699bef] [reply
P moet hier 3 zijn
2010-12-24 13:19:17 [] [reply
De werkelijke waarden sluiten hier helemaal niet aan bij de voorspelde waarde. De werkelijke waarden vallen voor minstens 7waarnemingen buiten het betrouwbaarheidsinterval. Deze afwijking is hoe dan ook significant. Waardoor deze forecast alles behalve aansluit bij de werkelijkheid.

Post a new message
Dataseries X:
41,85
41,75
41,75
41,75
41,58
41,61
41,42
41,37
41,37
41,33
41,37
41,34
41,33
41,29
41,29
41,27
41,04
40,90
40,89
40,72
40,72
40,58
40,24
40,07
40,12
40,10
40,10
40,08
40,06
39,99
40,05
39,66
39,66
39,67
39,56
39,64
39,73
39,70
39,70
39,68
39,76
40,00
39,96
40,01
40,01
40,01
40,00
39,91
39,86
39,79
39,79
39,80
39,64
39,55
39,36
39,28




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time14 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 & 14 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=111231&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]14 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=111231&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=111231&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 time14 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[44])
3239.66-------
3339.66-------
3439.67-------
3539.56-------
3639.64-------
3739.73-------
3839.7-------
3939.7-------
4039.68-------
4139.76-------
4240-------
4339.96-------
4440.01-------
4540.0140.008339.844940.17170.49180.491810.4918
4640.0140.123439.859240.38770.20.80.99960.8
474040.333539.963540.70350.03860.956710.9567
4839.9140.435539.968740.90240.01370.96630.99960.963
4939.8640.442639.905340.97990.01680.9740.99530.9427
5039.7940.453839.847641.06010.01590.97260.99260.9243
5139.7940.434239.759741.10870.03060.96940.98360.8911
5239.840.448939.721341.17660.04020.9620.98080.8814
5339.6440.452439.672441.23250.02060.94940.95910.8668
5439.5540.513239.678841.34750.01180.97990.8860.8814
5539.3640.480839.601941.35970.00620.9810.87730.8531
5639.2840.738639.816341.6610.0010.99830.93920.9392

\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[44]) \tabularnewline
32 & 39.66 & - & - & - & - & - & - & - \tabularnewline
33 & 39.66 & - & - & - & - & - & - & - \tabularnewline
34 & 39.67 & - & - & - & - & - & - & - \tabularnewline
35 & 39.56 & - & - & - & - & - & - & - \tabularnewline
36 & 39.64 & - & - & - & - & - & - & - \tabularnewline
37 & 39.73 & - & - & - & - & - & - & - \tabularnewline
38 & 39.7 & - & - & - & - & - & - & - \tabularnewline
39 & 39.7 & - & - & - & - & - & - & - \tabularnewline
40 & 39.68 & - & - & - & - & - & - & - \tabularnewline
41 & 39.76 & - & - & - & - & - & - & - \tabularnewline
42 & 40 & - & - & - & - & - & - & - \tabularnewline
43 & 39.96 & - & - & - & - & - & - & - \tabularnewline
44 & 40.01 & - & - & - & - & - & - & - \tabularnewline
45 & 40.01 & 40.0083 & 39.8449 & 40.1717 & 0.4918 & 0.4918 & 1 & 0.4918 \tabularnewline
46 & 40.01 & 40.1234 & 39.8592 & 40.3877 & 0.2 & 0.8 & 0.9996 & 0.8 \tabularnewline
47 & 40 & 40.3335 & 39.9635 & 40.7035 & 0.0386 & 0.9567 & 1 & 0.9567 \tabularnewline
48 & 39.91 & 40.4355 & 39.9687 & 40.9024 & 0.0137 & 0.9663 & 0.9996 & 0.963 \tabularnewline
49 & 39.86 & 40.4426 & 39.9053 & 40.9799 & 0.0168 & 0.974 & 0.9953 & 0.9427 \tabularnewline
50 & 39.79 & 40.4538 & 39.8476 & 41.0601 & 0.0159 & 0.9726 & 0.9926 & 0.9243 \tabularnewline
51 & 39.79 & 40.4342 & 39.7597 & 41.1087 & 0.0306 & 0.9694 & 0.9836 & 0.8911 \tabularnewline
52 & 39.8 & 40.4489 & 39.7213 & 41.1766 & 0.0402 & 0.962 & 0.9808 & 0.8814 \tabularnewline
53 & 39.64 & 40.4524 & 39.6724 & 41.2325 & 0.0206 & 0.9494 & 0.9591 & 0.8668 \tabularnewline
54 & 39.55 & 40.5132 & 39.6788 & 41.3475 & 0.0118 & 0.9799 & 0.886 & 0.8814 \tabularnewline
55 & 39.36 & 40.4808 & 39.6019 & 41.3597 & 0.0062 & 0.981 & 0.8773 & 0.8531 \tabularnewline
56 & 39.28 & 40.7386 & 39.8163 & 41.661 & 0.001 & 0.9983 & 0.9392 & 0.9392 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=111231&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[44])[/C][/ROW]
[ROW][C]32[/C][C]39.66[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]39.66[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]39.67[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]39.56[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]39.64[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]39.73[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]39.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]39.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]39.68[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]39.76[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]40[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]39.96[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]40.01[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]40.01[/C][C]40.0083[/C][C]39.8449[/C][C]40.1717[/C][C]0.4918[/C][C]0.4918[/C][C]1[/C][C]0.4918[/C][/ROW]
[ROW][C]46[/C][C]40.01[/C][C]40.1234[/C][C]39.8592[/C][C]40.3877[/C][C]0.2[/C][C]0.8[/C][C]0.9996[/C][C]0.8[/C][/ROW]
[ROW][C]47[/C][C]40[/C][C]40.3335[/C][C]39.9635[/C][C]40.7035[/C][C]0.0386[/C][C]0.9567[/C][C]1[/C][C]0.9567[/C][/ROW]
[ROW][C]48[/C][C]39.91[/C][C]40.4355[/C][C]39.9687[/C][C]40.9024[/C][C]0.0137[/C][C]0.9663[/C][C]0.9996[/C][C]0.963[/C][/ROW]
[ROW][C]49[/C][C]39.86[/C][C]40.4426[/C][C]39.9053[/C][C]40.9799[/C][C]0.0168[/C][C]0.974[/C][C]0.9953[/C][C]0.9427[/C][/ROW]
[ROW][C]50[/C][C]39.79[/C][C]40.4538[/C][C]39.8476[/C][C]41.0601[/C][C]0.0159[/C][C]0.9726[/C][C]0.9926[/C][C]0.9243[/C][/ROW]
[ROW][C]51[/C][C]39.79[/C][C]40.4342[/C][C]39.7597[/C][C]41.1087[/C][C]0.0306[/C][C]0.9694[/C][C]0.9836[/C][C]0.8911[/C][/ROW]
[ROW][C]52[/C][C]39.8[/C][C]40.4489[/C][C]39.7213[/C][C]41.1766[/C][C]0.0402[/C][C]0.962[/C][C]0.9808[/C][C]0.8814[/C][/ROW]
[ROW][C]53[/C][C]39.64[/C][C]40.4524[/C][C]39.6724[/C][C]41.2325[/C][C]0.0206[/C][C]0.9494[/C][C]0.9591[/C][C]0.8668[/C][/ROW]
[ROW][C]54[/C][C]39.55[/C][C]40.5132[/C][C]39.6788[/C][C]41.3475[/C][C]0.0118[/C][C]0.9799[/C][C]0.886[/C][C]0.8814[/C][/ROW]
[ROW][C]55[/C][C]39.36[/C][C]40.4808[/C][C]39.6019[/C][C]41.3597[/C][C]0.0062[/C][C]0.981[/C][C]0.8773[/C][C]0.8531[/C][/ROW]
[ROW][C]56[/C][C]39.28[/C][C]40.7386[/C][C]39.8163[/C][C]41.661[/C][C]0.001[/C][C]0.9983[/C][C]0.9392[/C][C]0.9392[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=111231&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=111231&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[44])
3239.66-------
3339.66-------
3439.67-------
3539.56-------
3639.64-------
3739.73-------
3839.7-------
3939.7-------
4039.68-------
4139.76-------
4240-------
4339.96-------
4440.01-------
4540.0140.008339.844940.17170.49180.491810.4918
4640.0140.123439.859240.38770.20.80.99960.8
474040.333539.963540.70350.03860.956710.9567
4839.9140.435539.968740.90240.01370.96630.99960.963
4939.8640.442639.905340.97990.01680.9740.99530.9427
5039.7940.453839.847641.06010.01590.97260.99260.9243
5139.7940.434239.759741.10870.03060.96940.98360.8911
5239.840.448939.721341.17660.04020.9620.98080.8814
5339.6440.452439.672441.23250.02060.94940.95910.8668
5439.5540.513239.678841.34750.01180.97990.8860.8814
5539.3640.480839.601941.35970.00620.9810.87730.8531
5639.2840.738639.816341.6610.0010.99830.93920.9392







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
450.002100000
460.0034-0.00280.00140.01290.00640.0802
470.0047-0.00830.00370.11120.04140.2034
480.0059-0.0130.0060.27620.10010.3163
490.0068-0.01440.00770.33940.14790.3846
500.0076-0.01640.00920.44070.19670.4435
510.0085-0.01590.01010.41490.22790.4774
520.0092-0.0160.01090.42110.2520.502
530.0098-0.02010.01190.660.29740.5453
540.0105-0.02380.01310.92770.36040.6003
550.0111-0.02770.01441.25620.44180.6647
560.0116-0.03580.01622.12770.58230.7631

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
45 & 0.0021 & 0 & 0 & 0 & 0 & 0 \tabularnewline
46 & 0.0034 & -0.0028 & 0.0014 & 0.0129 & 0.0064 & 0.0802 \tabularnewline
47 & 0.0047 & -0.0083 & 0.0037 & 0.1112 & 0.0414 & 0.2034 \tabularnewline
48 & 0.0059 & -0.013 & 0.006 & 0.2762 & 0.1001 & 0.3163 \tabularnewline
49 & 0.0068 & -0.0144 & 0.0077 & 0.3394 & 0.1479 & 0.3846 \tabularnewline
50 & 0.0076 & -0.0164 & 0.0092 & 0.4407 & 0.1967 & 0.4435 \tabularnewline
51 & 0.0085 & -0.0159 & 0.0101 & 0.4149 & 0.2279 & 0.4774 \tabularnewline
52 & 0.0092 & -0.016 & 0.0109 & 0.4211 & 0.252 & 0.502 \tabularnewline
53 & 0.0098 & -0.0201 & 0.0119 & 0.66 & 0.2974 & 0.5453 \tabularnewline
54 & 0.0105 & -0.0238 & 0.0131 & 0.9277 & 0.3604 & 0.6003 \tabularnewline
55 & 0.0111 & -0.0277 & 0.0144 & 1.2562 & 0.4418 & 0.6647 \tabularnewline
56 & 0.0116 & -0.0358 & 0.0162 & 2.1277 & 0.5823 & 0.7631 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=111231&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]45[/C][C]0.0021[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]46[/C][C]0.0034[/C][C]-0.0028[/C][C]0.0014[/C][C]0.0129[/C][C]0.0064[/C][C]0.0802[/C][/ROW]
[ROW][C]47[/C][C]0.0047[/C][C]-0.0083[/C][C]0.0037[/C][C]0.1112[/C][C]0.0414[/C][C]0.2034[/C][/ROW]
[ROW][C]48[/C][C]0.0059[/C][C]-0.013[/C][C]0.006[/C][C]0.2762[/C][C]0.1001[/C][C]0.3163[/C][/ROW]
[ROW][C]49[/C][C]0.0068[/C][C]-0.0144[/C][C]0.0077[/C][C]0.3394[/C][C]0.1479[/C][C]0.3846[/C][/ROW]
[ROW][C]50[/C][C]0.0076[/C][C]-0.0164[/C][C]0.0092[/C][C]0.4407[/C][C]0.1967[/C][C]0.4435[/C][/ROW]
[ROW][C]51[/C][C]0.0085[/C][C]-0.0159[/C][C]0.0101[/C][C]0.4149[/C][C]0.2279[/C][C]0.4774[/C][/ROW]
[ROW][C]52[/C][C]0.0092[/C][C]-0.016[/C][C]0.0109[/C][C]0.4211[/C][C]0.252[/C][C]0.502[/C][/ROW]
[ROW][C]53[/C][C]0.0098[/C][C]-0.0201[/C][C]0.0119[/C][C]0.66[/C][C]0.2974[/C][C]0.5453[/C][/ROW]
[ROW][C]54[/C][C]0.0105[/C][C]-0.0238[/C][C]0.0131[/C][C]0.9277[/C][C]0.3604[/C][C]0.6003[/C][/ROW]
[ROW][C]55[/C][C]0.0111[/C][C]-0.0277[/C][C]0.0144[/C][C]1.2562[/C][C]0.4418[/C][C]0.6647[/C][/ROW]
[ROW][C]56[/C][C]0.0116[/C][C]-0.0358[/C][C]0.0162[/C][C]2.1277[/C][C]0.5823[/C][C]0.7631[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=111231&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=111231&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
450.002100000
460.0034-0.00280.00140.01290.00640.0802
470.0047-0.00830.00370.11120.04140.2034
480.0059-0.0130.0060.27620.10010.3163
490.0068-0.01440.00770.33940.14790.3846
500.0076-0.01640.00920.44070.19670.4435
510.0085-0.01590.01010.41490.22790.4774
520.0092-0.0160.01090.42110.2520.502
530.0098-0.02010.01190.660.29740.5453
540.0105-0.02380.01310.92770.36040.6003
550.0111-0.02770.01441.25620.44180.6647
560.0116-0.03580.01622.12770.58230.7631



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