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 computationWed, 30 Dec 2009 07:15:56 -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/30/t126218266513d47y3jykcm6uf.htm/, Retrieved Mon, 29 Apr 2024 01:51:57 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=71292, Retrieved Mon, 29 Apr 2024 01:51:57 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact114
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Spectral Analysis] [periodogram insch...] [2009-12-27 14:27:44] [005293453b571dbccb80b45226e44173]
-   P   [Spectral Analysis] [periodogram insch...] [2009-12-27 14:33:32] [005293453b571dbccb80b45226e44173]
- RMP       [ARIMA Forecasting] [Arima forecast in...] [2009-12-30 14:15:56] [b02b8a83db8a631da1ab9c106b4cdcf2] [Current]
-   P         [ARIMA Forecasting] [arima forecast] [2009-12-30 22:43:13] [bd8e774728cf1f2f4e6868fd314defe3]
Feedback Forum

Post a new message
Dataseries X:
20366
22782
19169
13807
29743
25591
29096
26482
22405
27044
17970
18730
19684
19785
18479
10698
31956
29506
34506
27165
26736
23691
18157
17328
18205
20995
17382
9367
31124
26551
30651
25859
25100
25778
20418
18688
20424
24776
19814
12738
31566
30111
30019
31934
25826
26835
20205
17789
20520
22518
15572
11509
25447
24090
27786
26195
20516
22759
19028
16971




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71292&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 time1 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[48])
3618688-------
3720424-------
3824776-------
3919814-------
4012738-------
4131566-------
4230111-------
4330019-------
4431934-------
4525826-------
4626835-------
4720205-------
4817789-------
492052019952.585315396.706824508.46370.40360.8240.41960.824
502251824038.070519169.668728906.47220.27030.92170.38320.9941
511557219242.189713254.306725230.07270.11480.14180.42580.6828
521150912062.64725618.026118507.26830.43310.14290.41860.0408
532544730955.185523816.442738093.92830.065210.43340.9998
542409029459.958621848.015537071.90180.08340.84930.43340.9987
552778629393.032121244.123237541.9410.34960.89890.44020.9974
562619531292.403822694.343839890.46370.12260.78790.44190.999
572051625194.144916137.178434251.11150.15570.41430.44560.9455
582275926197.073216722.552135671.59440.23850.88010.44750.959
591902819570.85779684.987929456.72750.45710.26370.450.6381
601697117152.49896878.596627426.40110.48620.36020.45170.4517

\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[48]) \tabularnewline
36 & 18688 & - & - & - & - & - & - & - \tabularnewline
37 & 20424 & - & - & - & - & - & - & - \tabularnewline
38 & 24776 & - & - & - & - & - & - & - \tabularnewline
39 & 19814 & - & - & - & - & - & - & - \tabularnewline
40 & 12738 & - & - & - & - & - & - & - \tabularnewline
41 & 31566 & - & - & - & - & - & - & - \tabularnewline
42 & 30111 & - & - & - & - & - & - & - \tabularnewline
43 & 30019 & - & - & - & - & - & - & - \tabularnewline
44 & 31934 & - & - & - & - & - & - & - \tabularnewline
45 & 25826 & - & - & - & - & - & - & - \tabularnewline
46 & 26835 & - & - & - & - & - & - & - \tabularnewline
47 & 20205 & - & - & - & - & - & - & - \tabularnewline
48 & 17789 & - & - & - & - & - & - & - \tabularnewline
49 & 20520 & 19952.5853 & 15396.7068 & 24508.4637 & 0.4036 & 0.824 & 0.4196 & 0.824 \tabularnewline
50 & 22518 & 24038.0705 & 19169.6687 & 28906.4722 & 0.2703 & 0.9217 & 0.3832 & 0.9941 \tabularnewline
51 & 15572 & 19242.1897 & 13254.3067 & 25230.0727 & 0.1148 & 0.1418 & 0.4258 & 0.6828 \tabularnewline
52 & 11509 & 12062.6472 & 5618.0261 & 18507.2683 & 0.4331 & 0.1429 & 0.4186 & 0.0408 \tabularnewline
53 & 25447 & 30955.1855 & 23816.4427 & 38093.9283 & 0.0652 & 1 & 0.4334 & 0.9998 \tabularnewline
54 & 24090 & 29459.9586 & 21848.0155 & 37071.9018 & 0.0834 & 0.8493 & 0.4334 & 0.9987 \tabularnewline
55 & 27786 & 29393.0321 & 21244.1232 & 37541.941 & 0.3496 & 0.8989 & 0.4402 & 0.9974 \tabularnewline
56 & 26195 & 31292.4038 & 22694.3438 & 39890.4637 & 0.1226 & 0.7879 & 0.4419 & 0.999 \tabularnewline
57 & 20516 & 25194.1449 & 16137.1784 & 34251.1115 & 0.1557 & 0.4143 & 0.4456 & 0.9455 \tabularnewline
58 & 22759 & 26197.0732 & 16722.5521 & 35671.5944 & 0.2385 & 0.8801 & 0.4475 & 0.959 \tabularnewline
59 & 19028 & 19570.8577 & 9684.9879 & 29456.7275 & 0.4571 & 0.2637 & 0.45 & 0.6381 \tabularnewline
60 & 16971 & 17152.4989 & 6878.5966 & 27426.4011 & 0.4862 & 0.3602 & 0.4517 & 0.4517 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71292&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[48])[/C][/ROW]
[ROW][C]36[/C][C]18688[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]20424[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]24776[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]19814[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]12738[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]31566[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]30111[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]30019[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]31934[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]25826[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]26835[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]20205[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]17789[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]20520[/C][C]19952.5853[/C][C]15396.7068[/C][C]24508.4637[/C][C]0.4036[/C][C]0.824[/C][C]0.4196[/C][C]0.824[/C][/ROW]
[ROW][C]50[/C][C]22518[/C][C]24038.0705[/C][C]19169.6687[/C][C]28906.4722[/C][C]0.2703[/C][C]0.9217[/C][C]0.3832[/C][C]0.9941[/C][/ROW]
[ROW][C]51[/C][C]15572[/C][C]19242.1897[/C][C]13254.3067[/C][C]25230.0727[/C][C]0.1148[/C][C]0.1418[/C][C]0.4258[/C][C]0.6828[/C][/ROW]
[ROW][C]52[/C][C]11509[/C][C]12062.6472[/C][C]5618.0261[/C][C]18507.2683[/C][C]0.4331[/C][C]0.1429[/C][C]0.4186[/C][C]0.0408[/C][/ROW]
[ROW][C]53[/C][C]25447[/C][C]30955.1855[/C][C]23816.4427[/C][C]38093.9283[/C][C]0.0652[/C][C]1[/C][C]0.4334[/C][C]0.9998[/C][/ROW]
[ROW][C]54[/C][C]24090[/C][C]29459.9586[/C][C]21848.0155[/C][C]37071.9018[/C][C]0.0834[/C][C]0.8493[/C][C]0.4334[/C][C]0.9987[/C][/ROW]
[ROW][C]55[/C][C]27786[/C][C]29393.0321[/C][C]21244.1232[/C][C]37541.941[/C][C]0.3496[/C][C]0.8989[/C][C]0.4402[/C][C]0.9974[/C][/ROW]
[ROW][C]56[/C][C]26195[/C][C]31292.4038[/C][C]22694.3438[/C][C]39890.4637[/C][C]0.1226[/C][C]0.7879[/C][C]0.4419[/C][C]0.999[/C][/ROW]
[ROW][C]57[/C][C]20516[/C][C]25194.1449[/C][C]16137.1784[/C][C]34251.1115[/C][C]0.1557[/C][C]0.4143[/C][C]0.4456[/C][C]0.9455[/C][/ROW]
[ROW][C]58[/C][C]22759[/C][C]26197.0732[/C][C]16722.5521[/C][C]35671.5944[/C][C]0.2385[/C][C]0.8801[/C][C]0.4475[/C][C]0.959[/C][/ROW]
[ROW][C]59[/C][C]19028[/C][C]19570.8577[/C][C]9684.9879[/C][C]29456.7275[/C][C]0.4571[/C][C]0.2637[/C][C]0.45[/C][C]0.6381[/C][/ROW]
[ROW][C]60[/C][C]16971[/C][C]17152.4989[/C][C]6878.5966[/C][C]27426.4011[/C][C]0.4862[/C][C]0.3602[/C][C]0.4517[/C][C]0.4517[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71292&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71292&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[48])
3618688-------
3720424-------
3824776-------
3919814-------
4012738-------
4131566-------
4230111-------
4330019-------
4431934-------
4525826-------
4626835-------
4720205-------
4817789-------
492052019952.585315396.706824508.46370.40360.8240.41960.824
502251824038.070519169.668728906.47220.27030.92170.38320.9941
511557219242.189713254.306725230.07270.11480.14180.42580.6828
521150912062.64725618.026118507.26830.43310.14290.41860.0408
532544730955.185523816.442738093.92830.065210.43340.9998
542409029459.958621848.015537071.90180.08340.84930.43340.9987
552778629393.032121244.123237541.9410.34960.89890.44020.9974
562619531292.403822694.343839890.46370.12260.78790.44190.999
572051625194.144916137.178434251.11150.15570.41430.44560.9455
582275926197.073216722.552135671.59440.23850.88010.44750.959
591902819570.85779684.987929456.72750.45710.26370.450.6381
601697117152.49896878.596627426.40110.48620.36020.45170.4517







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.11650.02840321959.498300
500.1033-0.06320.04582310614.20291316286.85061147.2955
510.1588-0.19070.094113470292.37575367622.02562316.8129
520.2726-0.04590.0821306525.2484102347.83122025.4253
530.1177-0.17790.101230340107.0959349899.6843057.7606
540.1318-0.18230.114828836455.815312597659.03923549.3181
550.1414-0.05470.10622582552.18511166929.48863341.6956
560.1402-0.16290.113325983525.115413019003.9423608.1857
570.1834-0.18570.121321885040.089314004119.06943742.2078
580.1845-0.13120.122311820347.62913785741.92543712.9156
590.2577-0.02770.1137294694.531812559283.07143543.9079
600.3056-0.01060.105132941.835311515421.30183393.438

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.1165 & 0.0284 & 0 & 321959.4983 & 0 & 0 \tabularnewline
50 & 0.1033 & -0.0632 & 0.0458 & 2310614.2029 & 1316286.8506 & 1147.2955 \tabularnewline
51 & 0.1588 & -0.1907 & 0.0941 & 13470292.3757 & 5367622.0256 & 2316.8129 \tabularnewline
52 & 0.2726 & -0.0459 & 0.0821 & 306525.248 & 4102347.8312 & 2025.4253 \tabularnewline
53 & 0.1177 & -0.1779 & 0.1012 & 30340107.095 & 9349899.684 & 3057.7606 \tabularnewline
54 & 0.1318 & -0.1823 & 0.1148 & 28836455.8153 & 12597659.0392 & 3549.3181 \tabularnewline
55 & 0.1414 & -0.0547 & 0.1062 & 2582552.185 & 11166929.4886 & 3341.6956 \tabularnewline
56 & 0.1402 & -0.1629 & 0.1133 & 25983525.1154 & 13019003.942 & 3608.1857 \tabularnewline
57 & 0.1834 & -0.1857 & 0.1213 & 21885040.0893 & 14004119.0694 & 3742.2078 \tabularnewline
58 & 0.1845 & -0.1312 & 0.1223 & 11820347.629 & 13785741.9254 & 3712.9156 \tabularnewline
59 & 0.2577 & -0.0277 & 0.1137 & 294694.5318 & 12559283.0714 & 3543.9079 \tabularnewline
60 & 0.3056 & -0.0106 & 0.1051 & 32941.8353 & 11515421.3018 & 3393.438 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71292&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]49[/C][C]0.1165[/C][C]0.0284[/C][C]0[/C][C]321959.4983[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.1033[/C][C]-0.0632[/C][C]0.0458[/C][C]2310614.2029[/C][C]1316286.8506[/C][C]1147.2955[/C][/ROW]
[ROW][C]51[/C][C]0.1588[/C][C]-0.1907[/C][C]0.0941[/C][C]13470292.3757[/C][C]5367622.0256[/C][C]2316.8129[/C][/ROW]
[ROW][C]52[/C][C]0.2726[/C][C]-0.0459[/C][C]0.0821[/C][C]306525.248[/C][C]4102347.8312[/C][C]2025.4253[/C][/ROW]
[ROW][C]53[/C][C]0.1177[/C][C]-0.1779[/C][C]0.1012[/C][C]30340107.095[/C][C]9349899.684[/C][C]3057.7606[/C][/ROW]
[ROW][C]54[/C][C]0.1318[/C][C]-0.1823[/C][C]0.1148[/C][C]28836455.8153[/C][C]12597659.0392[/C][C]3549.3181[/C][/ROW]
[ROW][C]55[/C][C]0.1414[/C][C]-0.0547[/C][C]0.1062[/C][C]2582552.185[/C][C]11166929.4886[/C][C]3341.6956[/C][/ROW]
[ROW][C]56[/C][C]0.1402[/C][C]-0.1629[/C][C]0.1133[/C][C]25983525.1154[/C][C]13019003.942[/C][C]3608.1857[/C][/ROW]
[ROW][C]57[/C][C]0.1834[/C][C]-0.1857[/C][C]0.1213[/C][C]21885040.0893[/C][C]14004119.0694[/C][C]3742.2078[/C][/ROW]
[ROW][C]58[/C][C]0.1845[/C][C]-0.1312[/C][C]0.1223[/C][C]11820347.629[/C][C]13785741.9254[/C][C]3712.9156[/C][/ROW]
[ROW][C]59[/C][C]0.2577[/C][C]-0.0277[/C][C]0.1137[/C][C]294694.5318[/C][C]12559283.0714[/C][C]3543.9079[/C][/ROW]
[ROW][C]60[/C][C]0.3056[/C][C]-0.0106[/C][C]0.1051[/C][C]32941.8353[/C][C]11515421.3018[/C][C]3393.438[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71292&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71292&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
490.11650.02840321959.498300
500.1033-0.06320.04582310614.20291316286.85061147.2955
510.1588-0.19070.094113470292.37575367622.02562316.8129
520.2726-0.04590.0821306525.2484102347.83122025.4253
530.1177-0.17790.101230340107.0959349899.6843057.7606
540.1318-0.18230.114828836455.815312597659.03923549.3181
550.1414-0.05470.10622582552.18511166929.48863341.6956
560.1402-0.16290.113325983525.115413019003.9423608.1857
570.1834-0.18570.121321885040.089314004119.06943742.2078
580.1845-0.13120.122311820347.62913785741.92543712.9156
590.2577-0.02770.1137294694.531812559283.07143543.9079
600.3056-0.01060.105132941.835311515421.30183393.438



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