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 computationSun, 27 Dec 2009 04:50:39 -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/27/t126191471397t9exc4no50i5j.htm/, Retrieved Thu, 02 May 2024 16:15:54 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70853, Retrieved Thu, 02 May 2024 16:15:54 +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)
-       [ARIMA Forecasting] [] [2009-12-27 11:50:39] [f6a332ba2d530c028d935c5a5bbb53af] [Current]
Feedback Forum

Post a new message
Dataseries X:
28029
29383
36438
32034
22679
24319
18004
17537
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
20036
22485




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70853&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[58])
4624776-------
4719814-------
4812738-------
4931566-------
5030111-------
5130019-------
5231934-------
5325826-------
5426835-------
5520205-------
5617789-------
5720520-------
5822518-------
591557218936.526313555.612424317.44030.11020.0960.37460.096
601150911860.52636022.919817698.13280.4530.10640.38412e-04
612544730688.526324427.45136949.60170.050410.39180.9947
622409029233.526322575.863235891.18950.0650.86750.39810.976
632778629141.526322109.606836173.44590.35280.92040.40340.9676
642619531056.526323669.286838443.76580.09850.80720.4080.9883
652051624948.526317222.290432674.76230.13040.37590.41190.7312
662275925957.526317906.555234008.49750.21810.90740.41540.7988
671902819327.526310964.419827690.63290.4720.21060.41850.2273
681697116911.52638247.522325575.53040.49460.3160.42130.1023
692003619642.526310687.729928597.32280.46570.72060.42380.2646
702248521640.526312404.087930876.96480.42890.63330.42610.4261

\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[58]) \tabularnewline
46 & 24776 & - & - & - & - & - & - & - \tabularnewline
47 & 19814 & - & - & - & - & - & - & - \tabularnewline
48 & 12738 & - & - & - & - & - & - & - \tabularnewline
49 & 31566 & - & - & - & - & - & - & - \tabularnewline
50 & 30111 & - & - & - & - & - & - & - \tabularnewline
51 & 30019 & - & - & - & - & - & - & - \tabularnewline
52 & 31934 & - & - & - & - & - & - & - \tabularnewline
53 & 25826 & - & - & - & - & - & - & - \tabularnewline
54 & 26835 & - & - & - & - & - & - & - \tabularnewline
55 & 20205 & - & - & - & - & - & - & - \tabularnewline
56 & 17789 & - & - & - & - & - & - & - \tabularnewline
57 & 20520 & - & - & - & - & - & - & - \tabularnewline
58 & 22518 & - & - & - & - & - & - & - \tabularnewline
59 & 15572 & 18936.5263 & 13555.6124 & 24317.4403 & 0.1102 & 0.096 & 0.3746 & 0.096 \tabularnewline
60 & 11509 & 11860.5263 & 6022.9198 & 17698.1328 & 0.453 & 0.1064 & 0.3841 & 2e-04 \tabularnewline
61 & 25447 & 30688.5263 & 24427.451 & 36949.6017 & 0.0504 & 1 & 0.3918 & 0.9947 \tabularnewline
62 & 24090 & 29233.5263 & 22575.8632 & 35891.1895 & 0.065 & 0.8675 & 0.3981 & 0.976 \tabularnewline
63 & 27786 & 29141.5263 & 22109.6068 & 36173.4459 & 0.3528 & 0.9204 & 0.4034 & 0.9676 \tabularnewline
64 & 26195 & 31056.5263 & 23669.2868 & 38443.7658 & 0.0985 & 0.8072 & 0.408 & 0.9883 \tabularnewline
65 & 20516 & 24948.5263 & 17222.2904 & 32674.7623 & 0.1304 & 0.3759 & 0.4119 & 0.7312 \tabularnewline
66 & 22759 & 25957.5263 & 17906.5552 & 34008.4975 & 0.2181 & 0.9074 & 0.4154 & 0.7988 \tabularnewline
67 & 19028 & 19327.5263 & 10964.4198 & 27690.6329 & 0.472 & 0.2106 & 0.4185 & 0.2273 \tabularnewline
68 & 16971 & 16911.5263 & 8247.5223 & 25575.5304 & 0.4946 & 0.316 & 0.4213 & 0.1023 \tabularnewline
69 & 20036 & 19642.5263 & 10687.7299 & 28597.3228 & 0.4657 & 0.7206 & 0.4238 & 0.2646 \tabularnewline
70 & 22485 & 21640.5263 & 12404.0879 & 30876.9648 & 0.4289 & 0.6333 & 0.4261 & 0.4261 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70853&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[58])[/C][/ROW]
[ROW][C]46[/C][C]24776[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]19814[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]12738[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]31566[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]30111[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]30019[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]31934[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]25826[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]26835[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]20205[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]17789[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]20520[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]22518[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]15572[/C][C]18936.5263[/C][C]13555.6124[/C][C]24317.4403[/C][C]0.1102[/C][C]0.096[/C][C]0.3746[/C][C]0.096[/C][/ROW]
[ROW][C]60[/C][C]11509[/C][C]11860.5263[/C][C]6022.9198[/C][C]17698.1328[/C][C]0.453[/C][C]0.1064[/C][C]0.3841[/C][C]2e-04[/C][/ROW]
[ROW][C]61[/C][C]25447[/C][C]30688.5263[/C][C]24427.451[/C][C]36949.6017[/C][C]0.0504[/C][C]1[/C][C]0.3918[/C][C]0.9947[/C][/ROW]
[ROW][C]62[/C][C]24090[/C][C]29233.5263[/C][C]22575.8632[/C][C]35891.1895[/C][C]0.065[/C][C]0.8675[/C][C]0.3981[/C][C]0.976[/C][/ROW]
[ROW][C]63[/C][C]27786[/C][C]29141.5263[/C][C]22109.6068[/C][C]36173.4459[/C][C]0.3528[/C][C]0.9204[/C][C]0.4034[/C][C]0.9676[/C][/ROW]
[ROW][C]64[/C][C]26195[/C][C]31056.5263[/C][C]23669.2868[/C][C]38443.7658[/C][C]0.0985[/C][C]0.8072[/C][C]0.408[/C][C]0.9883[/C][/ROW]
[ROW][C]65[/C][C]20516[/C][C]24948.5263[/C][C]17222.2904[/C][C]32674.7623[/C][C]0.1304[/C][C]0.3759[/C][C]0.4119[/C][C]0.7312[/C][/ROW]
[ROW][C]66[/C][C]22759[/C][C]25957.5263[/C][C]17906.5552[/C][C]34008.4975[/C][C]0.2181[/C][C]0.9074[/C][C]0.4154[/C][C]0.7988[/C][/ROW]
[ROW][C]67[/C][C]19028[/C][C]19327.5263[/C][C]10964.4198[/C][C]27690.6329[/C][C]0.472[/C][C]0.2106[/C][C]0.4185[/C][C]0.2273[/C][/ROW]
[ROW][C]68[/C][C]16971[/C][C]16911.5263[/C][C]8247.5223[/C][C]25575.5304[/C][C]0.4946[/C][C]0.316[/C][C]0.4213[/C][C]0.1023[/C][/ROW]
[ROW][C]69[/C][C]20036[/C][C]19642.5263[/C][C]10687.7299[/C][C]28597.3228[/C][C]0.4657[/C][C]0.7206[/C][C]0.4238[/C][C]0.2646[/C][/ROW]
[ROW][C]70[/C][C]22485[/C][C]21640.5263[/C][C]12404.0879[/C][C]30876.9648[/C][C]0.4289[/C][C]0.6333[/C][C]0.4261[/C][C]0.4261[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70853&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70853&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[58])
4624776-------
4719814-------
4812738-------
4931566-------
5030111-------
5130019-------
5231934-------
5325826-------
5426835-------
5520205-------
5617789-------
5720520-------
5822518-------
591557218936.526313555.612424317.44030.11020.0960.37460.096
601150911860.52636022.919817698.13280.4530.10640.38412e-04
612544730688.526324427.45136949.60170.050410.39180.9947
622409029233.526322575.863235891.18950.0650.86750.39810.976
632778629141.526322109.606836173.44590.35280.92040.40340.9676
642619531056.526323669.286838443.76580.09850.80720.4080.9883
652051624948.526317222.290432674.76230.13040.37590.41190.7312
662275925957.526317906.555234008.49750.21810.90740.41540.7988
671902819327.526310964.419827690.63290.4720.21060.41850.2273
681697116911.52638247.522325575.53040.49460.3160.42130.1023
692003619642.526310687.729928597.32280.46570.72060.42380.2646
702248521640.526312404.087930876.96480.42890.63330.42610.4261







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
590.145-0.1777011320037.492600
600.2511-0.02960.1037123570.76775721804.13012392.0293
610.1041-0.17080.12627473598.372912972402.21113601.7221
620.1162-0.17590.138526455863.210316343267.46094042.6807
630.1231-0.04650.12011837451.658413442104.30043666.3475
640.1214-0.15650.126223634438.354515140826.64273891.1215
650.158-0.17770.133519647289.754815784607.08733972.9847
660.1582-0.12320.132210230570.747715090352.54493884.6303
670.2208-0.01550.119389716.028413423615.15413663.8252
680.26140.00350.10773537.116212081607.35043475.8607
690.23260.020.0997154821.521110997354.09323316.2259
700.21780.0390.0947713135.762410140335.89893184.3894

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
59 & 0.145 & -0.1777 & 0 & 11320037.4926 & 0 & 0 \tabularnewline
60 & 0.2511 & -0.0296 & 0.1037 & 123570.7677 & 5721804.1301 & 2392.0293 \tabularnewline
61 & 0.1041 & -0.1708 & 0.126 & 27473598.3729 & 12972402.2111 & 3601.7221 \tabularnewline
62 & 0.1162 & -0.1759 & 0.1385 & 26455863.2103 & 16343267.4609 & 4042.6807 \tabularnewline
63 & 0.1231 & -0.0465 & 0.1201 & 1837451.6584 & 13442104.3004 & 3666.3475 \tabularnewline
64 & 0.1214 & -0.1565 & 0.1262 & 23634438.3545 & 15140826.6427 & 3891.1215 \tabularnewline
65 & 0.158 & -0.1777 & 0.1335 & 19647289.7548 & 15784607.0873 & 3972.9847 \tabularnewline
66 & 0.1582 & -0.1232 & 0.1322 & 10230570.7477 & 15090352.5449 & 3884.6303 \tabularnewline
67 & 0.2208 & -0.0155 & 0.1193 & 89716.0284 & 13423615.1541 & 3663.8252 \tabularnewline
68 & 0.2614 & 0.0035 & 0.1077 & 3537.1162 & 12081607.3504 & 3475.8607 \tabularnewline
69 & 0.2326 & 0.02 & 0.0997 & 154821.5211 & 10997354.0932 & 3316.2259 \tabularnewline
70 & 0.2178 & 0.039 & 0.0947 & 713135.7624 & 10140335.8989 & 3184.3894 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70853&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]59[/C][C]0.145[/C][C]-0.1777[/C][C]0[/C][C]11320037.4926[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]60[/C][C]0.2511[/C][C]-0.0296[/C][C]0.1037[/C][C]123570.7677[/C][C]5721804.1301[/C][C]2392.0293[/C][/ROW]
[ROW][C]61[/C][C]0.1041[/C][C]-0.1708[/C][C]0.126[/C][C]27473598.3729[/C][C]12972402.2111[/C][C]3601.7221[/C][/ROW]
[ROW][C]62[/C][C]0.1162[/C][C]-0.1759[/C][C]0.1385[/C][C]26455863.2103[/C][C]16343267.4609[/C][C]4042.6807[/C][/ROW]
[ROW][C]63[/C][C]0.1231[/C][C]-0.0465[/C][C]0.1201[/C][C]1837451.6584[/C][C]13442104.3004[/C][C]3666.3475[/C][/ROW]
[ROW][C]64[/C][C]0.1214[/C][C]-0.1565[/C][C]0.1262[/C][C]23634438.3545[/C][C]15140826.6427[/C][C]3891.1215[/C][/ROW]
[ROW][C]65[/C][C]0.158[/C][C]-0.1777[/C][C]0.1335[/C][C]19647289.7548[/C][C]15784607.0873[/C][C]3972.9847[/C][/ROW]
[ROW][C]66[/C][C]0.1582[/C][C]-0.1232[/C][C]0.1322[/C][C]10230570.7477[/C][C]15090352.5449[/C][C]3884.6303[/C][/ROW]
[ROW][C]67[/C][C]0.2208[/C][C]-0.0155[/C][C]0.1193[/C][C]89716.0284[/C][C]13423615.1541[/C][C]3663.8252[/C][/ROW]
[ROW][C]68[/C][C]0.2614[/C][C]0.0035[/C][C]0.1077[/C][C]3537.1162[/C][C]12081607.3504[/C][C]3475.8607[/C][/ROW]
[ROW][C]69[/C][C]0.2326[/C][C]0.02[/C][C]0.0997[/C][C]154821.5211[/C][C]10997354.0932[/C][C]3316.2259[/C][/ROW]
[ROW][C]70[/C][C]0.2178[/C][C]0.039[/C][C]0.0947[/C][C]713135.7624[/C][C]10140335.8989[/C][C]3184.3894[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70853&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70853&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
590.145-0.1777011320037.492600
600.2511-0.02960.1037123570.76775721804.13012392.0293
610.1041-0.17080.12627473598.372912972402.21113601.7221
620.1162-0.17590.138526455863.210316343267.46094042.6807
630.1231-0.04650.12011837451.658413442104.30043666.3475
640.1214-0.15650.126223634438.354515140826.64273891.1215
650.158-0.17770.133519647289.754815784607.08733972.9847
660.1582-0.12320.132210230570.747715090352.54493884.6303
670.2208-0.01550.119389716.028413423615.15413663.8252
680.26140.00350.10773537.116212081607.35043475.8607
690.23260.020.0997154821.521110997354.09323316.2259
700.21780.0390.0947713135.762410140335.89893184.3894



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