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, 14 Dec 2010 19:29:10 +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/14/t1292354842uvtdca6ihzw5go5.htm/, Retrieved Thu, 02 May 2024 19:16:16 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=110089, Retrieved Thu, 02 May 2024 19:16:16 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact145
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [Arima forecasting...] [2010-12-12 08:24:17] [05ab9592748364013445d860bb938e43]
-   P     [ARIMA Forecasting] [Arima forecasting...] [2010-12-14 19:29:10] [60147a93d53c93401a082f47876e6cb5] [Current]
Feedback Forum

Post a new message
Dataseries X:
4143
4429
5219
4929
5761
5592
4163
4962
5208
4755
4491
5732
5731
5040
6102
4904
5369
5578
4619
4731
5011
5299
4146
4625
4736
4219
5116
4205
4121
5103
4300
4578
3809
5657
4248
3830
4736
4839
4411
4570
4104
4801
3953
3828
4440
4026
4109
4785
3224
3552
3940
3913
3681
4309
3830
4143
4087
3818
3380
3430
3458
3970
5260
5024
5634
6549
4676




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=110089&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[55])
433953-------
443828-------
454440-------
464026-------
474109-------
484785-------
493224-------
503552-------
513940-------
523913-------
533681-------
544309-------
553830-------
5641433863.68292827.27334900.09260.29870.52540.52690.5254
5740874094.8883032.46725157.30890.49420.46460.26220.6875
5838183897.71382794.09455001.33320.44370.36840.40990.5479
5933803926.24482630.20185222.28770.20440.5650.39110.5579
6034304010.05792667.68645352.42940.19850.82120.12890.6037
6134583929.81452528.94165330.68740.25460.75780.83830.5555
6239703946.94742446.20285447.69210.4880.73850.6970.5607
6352603976.77972422.53875531.02070.05280.50340.51850.5734
6450243944.472330.73865558.20140.09490.0550.51520.5553
6556343953.47132269.00625637.93640.02530.10640.62440.5571
6665493963.85442225.59265702.11620.00180.02980.34860.56
6746763950.97712156.75825745.19590.21420.00230.55260.5526

\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[55]) \tabularnewline
43 & 3953 & - & - & - & - & - & - & - \tabularnewline
44 & 3828 & - & - & - & - & - & - & - \tabularnewline
45 & 4440 & - & - & - & - & - & - & - \tabularnewline
46 & 4026 & - & - & - & - & - & - & - \tabularnewline
47 & 4109 & - & - & - & - & - & - & - \tabularnewline
48 & 4785 & - & - & - & - & - & - & - \tabularnewline
49 & 3224 & - & - & - & - & - & - & - \tabularnewline
50 & 3552 & - & - & - & - & - & - & - \tabularnewline
51 & 3940 & - & - & - & - & - & - & - \tabularnewline
52 & 3913 & - & - & - & - & - & - & - \tabularnewline
53 & 3681 & - & - & - & - & - & - & - \tabularnewline
54 & 4309 & - & - & - & - & - & - & - \tabularnewline
55 & 3830 & - & - & - & - & - & - & - \tabularnewline
56 & 4143 & 3863.6829 & 2827.2733 & 4900.0926 & 0.2987 & 0.5254 & 0.5269 & 0.5254 \tabularnewline
57 & 4087 & 4094.888 & 3032.4672 & 5157.3089 & 0.4942 & 0.4646 & 0.2622 & 0.6875 \tabularnewline
58 & 3818 & 3897.7138 & 2794.0945 & 5001.3332 & 0.4437 & 0.3684 & 0.4099 & 0.5479 \tabularnewline
59 & 3380 & 3926.2448 & 2630.2018 & 5222.2877 & 0.2044 & 0.565 & 0.3911 & 0.5579 \tabularnewline
60 & 3430 & 4010.0579 & 2667.6864 & 5352.4294 & 0.1985 & 0.8212 & 0.1289 & 0.6037 \tabularnewline
61 & 3458 & 3929.8145 & 2528.9416 & 5330.6874 & 0.2546 & 0.7578 & 0.8383 & 0.5555 \tabularnewline
62 & 3970 & 3946.9474 & 2446.2028 & 5447.6921 & 0.488 & 0.7385 & 0.697 & 0.5607 \tabularnewline
63 & 5260 & 3976.7797 & 2422.5387 & 5531.0207 & 0.0528 & 0.5034 & 0.5185 & 0.5734 \tabularnewline
64 & 5024 & 3944.47 & 2330.7386 & 5558.2014 & 0.0949 & 0.055 & 0.5152 & 0.5553 \tabularnewline
65 & 5634 & 3953.4713 & 2269.0062 & 5637.9364 & 0.0253 & 0.1064 & 0.6244 & 0.5571 \tabularnewline
66 & 6549 & 3963.8544 & 2225.5926 & 5702.1162 & 0.0018 & 0.0298 & 0.3486 & 0.56 \tabularnewline
67 & 4676 & 3950.9771 & 2156.7582 & 5745.1959 & 0.2142 & 0.0023 & 0.5526 & 0.5526 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=110089&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[55])[/C][/ROW]
[ROW][C]43[/C][C]3953[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]3828[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]4440[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]4026[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]4109[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]4785[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]3224[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]3552[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]3940[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]3913[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]3681[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]4309[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]3830[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]4143[/C][C]3863.6829[/C][C]2827.2733[/C][C]4900.0926[/C][C]0.2987[/C][C]0.5254[/C][C]0.5269[/C][C]0.5254[/C][/ROW]
[ROW][C]57[/C][C]4087[/C][C]4094.888[/C][C]3032.4672[/C][C]5157.3089[/C][C]0.4942[/C][C]0.4646[/C][C]0.2622[/C][C]0.6875[/C][/ROW]
[ROW][C]58[/C][C]3818[/C][C]3897.7138[/C][C]2794.0945[/C][C]5001.3332[/C][C]0.4437[/C][C]0.3684[/C][C]0.4099[/C][C]0.5479[/C][/ROW]
[ROW][C]59[/C][C]3380[/C][C]3926.2448[/C][C]2630.2018[/C][C]5222.2877[/C][C]0.2044[/C][C]0.565[/C][C]0.3911[/C][C]0.5579[/C][/ROW]
[ROW][C]60[/C][C]3430[/C][C]4010.0579[/C][C]2667.6864[/C][C]5352.4294[/C][C]0.1985[/C][C]0.8212[/C][C]0.1289[/C][C]0.6037[/C][/ROW]
[ROW][C]61[/C][C]3458[/C][C]3929.8145[/C][C]2528.9416[/C][C]5330.6874[/C][C]0.2546[/C][C]0.7578[/C][C]0.8383[/C][C]0.5555[/C][/ROW]
[ROW][C]62[/C][C]3970[/C][C]3946.9474[/C][C]2446.2028[/C][C]5447.6921[/C][C]0.488[/C][C]0.7385[/C][C]0.697[/C][C]0.5607[/C][/ROW]
[ROW][C]63[/C][C]5260[/C][C]3976.7797[/C][C]2422.5387[/C][C]5531.0207[/C][C]0.0528[/C][C]0.5034[/C][C]0.5185[/C][C]0.5734[/C][/ROW]
[ROW][C]64[/C][C]5024[/C][C]3944.47[/C][C]2330.7386[/C][C]5558.2014[/C][C]0.0949[/C][C]0.055[/C][C]0.5152[/C][C]0.5553[/C][/ROW]
[ROW][C]65[/C][C]5634[/C][C]3953.4713[/C][C]2269.0062[/C][C]5637.9364[/C][C]0.0253[/C][C]0.1064[/C][C]0.6244[/C][C]0.5571[/C][/ROW]
[ROW][C]66[/C][C]6549[/C][C]3963.8544[/C][C]2225.5926[/C][C]5702.1162[/C][C]0.0018[/C][C]0.0298[/C][C]0.3486[/C][C]0.56[/C][/ROW]
[ROW][C]67[/C][C]4676[/C][C]3950.9771[/C][C]2156.7582[/C][C]5745.1959[/C][C]0.2142[/C][C]0.0023[/C][C]0.5526[/C][C]0.5526[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=110089&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=110089&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[55])
433953-------
443828-------
454440-------
464026-------
474109-------
484785-------
493224-------
503552-------
513940-------
523913-------
533681-------
544309-------
553830-------
5641433863.68292827.27334900.09260.29870.52540.52690.5254
5740874094.8883032.46725157.30890.49420.46460.26220.6875
5838183897.71382794.09455001.33320.44370.36840.40990.5479
5933803926.24482630.20185222.28770.20440.5650.39110.5579
6034304010.05792667.68645352.42940.19850.82120.12890.6037
6134583929.81452528.94165330.68740.25460.75780.83830.5555
6239703946.94742446.20285447.69210.4880.73850.6970.5607
6352603976.77972422.53875531.02070.05280.50340.51850.5734
6450243944.472330.73865558.20140.09490.0550.51520.5553
6556343953.47132269.00625637.93640.02530.10640.62440.5571
6665493963.85442225.59265702.11620.00180.02980.34860.56
6746763950.97712156.75825745.19590.21420.00230.55260.5526







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
560.13690.0723078018.024300
570.1324-0.00190.037162.221339040.1228197.5857
580.1445-0.02050.03166354.296428144.8473167.7643
590.1684-0.13910.0584298383.368495704.4776309.3614
600.1708-0.14470.0757336467.1859143857.0193379.2849
610.1819-0.12010.0831222608.9505156982.3411396.21
620.1940.00580.072531.4214134632.2097366.9226
630.19940.32270.10341646654.3497323634.9772568.8892
640.20870.27370.12231165385.0375417162.7617645.8814
650.21740.42510.15262824176.694657864.1549811.0883
660.22370.65220.1986682977.72561205601.75231097.999
670.23170.18350.1968525658.26391148939.79491071.8861

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
56 & 0.1369 & 0.0723 & 0 & 78018.0243 & 0 & 0 \tabularnewline
57 & 0.1324 & -0.0019 & 0.0371 & 62.2213 & 39040.1228 & 197.5857 \tabularnewline
58 & 0.1445 & -0.0205 & 0.0316 & 6354.2964 & 28144.8473 & 167.7643 \tabularnewline
59 & 0.1684 & -0.1391 & 0.0584 & 298383.3684 & 95704.4776 & 309.3614 \tabularnewline
60 & 0.1708 & -0.1447 & 0.0757 & 336467.1859 & 143857.0193 & 379.2849 \tabularnewline
61 & 0.1819 & -0.1201 & 0.0831 & 222608.9505 & 156982.3411 & 396.21 \tabularnewline
62 & 0.194 & 0.0058 & 0.072 & 531.4214 & 134632.2097 & 366.9226 \tabularnewline
63 & 0.1994 & 0.3227 & 0.1034 & 1646654.3497 & 323634.9772 & 568.8892 \tabularnewline
64 & 0.2087 & 0.2737 & 0.1223 & 1165385.0375 & 417162.7617 & 645.8814 \tabularnewline
65 & 0.2174 & 0.4251 & 0.1526 & 2824176.694 & 657864.1549 & 811.0883 \tabularnewline
66 & 0.2237 & 0.6522 & 0.198 & 6682977.7256 & 1205601.7523 & 1097.999 \tabularnewline
67 & 0.2317 & 0.1835 & 0.1968 & 525658.2639 & 1148939.7949 & 1071.8861 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=110089&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]56[/C][C]0.1369[/C][C]0.0723[/C][C]0[/C][C]78018.0243[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]57[/C][C]0.1324[/C][C]-0.0019[/C][C]0.0371[/C][C]62.2213[/C][C]39040.1228[/C][C]197.5857[/C][/ROW]
[ROW][C]58[/C][C]0.1445[/C][C]-0.0205[/C][C]0.0316[/C][C]6354.2964[/C][C]28144.8473[/C][C]167.7643[/C][/ROW]
[ROW][C]59[/C][C]0.1684[/C][C]-0.1391[/C][C]0.0584[/C][C]298383.3684[/C][C]95704.4776[/C][C]309.3614[/C][/ROW]
[ROW][C]60[/C][C]0.1708[/C][C]-0.1447[/C][C]0.0757[/C][C]336467.1859[/C][C]143857.0193[/C][C]379.2849[/C][/ROW]
[ROW][C]61[/C][C]0.1819[/C][C]-0.1201[/C][C]0.0831[/C][C]222608.9505[/C][C]156982.3411[/C][C]396.21[/C][/ROW]
[ROW][C]62[/C][C]0.194[/C][C]0.0058[/C][C]0.072[/C][C]531.4214[/C][C]134632.2097[/C][C]366.9226[/C][/ROW]
[ROW][C]63[/C][C]0.1994[/C][C]0.3227[/C][C]0.1034[/C][C]1646654.3497[/C][C]323634.9772[/C][C]568.8892[/C][/ROW]
[ROW][C]64[/C][C]0.2087[/C][C]0.2737[/C][C]0.1223[/C][C]1165385.0375[/C][C]417162.7617[/C][C]645.8814[/C][/ROW]
[ROW][C]65[/C][C]0.2174[/C][C]0.4251[/C][C]0.1526[/C][C]2824176.694[/C][C]657864.1549[/C][C]811.0883[/C][/ROW]
[ROW][C]66[/C][C]0.2237[/C][C]0.6522[/C][C]0.198[/C][C]6682977.7256[/C][C]1205601.7523[/C][C]1097.999[/C][/ROW]
[ROW][C]67[/C][C]0.2317[/C][C]0.1835[/C][C]0.1968[/C][C]525658.2639[/C][C]1148939.7949[/C][C]1071.8861[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=110089&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=110089&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
560.13690.0723078018.024300
570.1324-0.00190.037162.221339040.1228197.5857
580.1445-0.02050.03166354.296428144.8473167.7643
590.1684-0.13910.0584298383.368495704.4776309.3614
600.1708-0.14470.0757336467.1859143857.0193379.2849
610.1819-0.12010.0831222608.9505156982.3411396.21
620.1940.00580.072531.4214134632.2097366.9226
630.19940.32270.10341646654.3497323634.9772568.8892
640.20870.27370.12231165385.0375417162.7617645.8814
650.21740.42510.15262824176.694657864.1549811.0883
660.22370.65220.1986682977.72561205601.75231097.999
670.23170.18350.1968525658.26391148939.79491071.8861



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