Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 24 Dec 2008 03:41:38 -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/2008/Dec/24/t12301154088k4be4ql0dqievz.htm/, Retrieved Sun, 19 May 2024 10:05:41 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=36451, Retrieved Sun, 19 May 2024 10:05:41 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact208
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F     [ARIMA Forecasting] [step 1] [2008-12-16 19:27:17] [89807c1e898f33ff9d3cae28449e7b22]
-   PD    [ARIMA Forecasting] [ARIMA FC Vrouwen] [2008-12-24 10:41:38] [f0e1dc59aca2fa8d78080b39899f316a] [Current]
Feedback Forum

Post a new message
Dataseries X:
54327
53476
52258
50156
47925
45844
47605
63617
67028
65845
60106
55317
53188
51010
49364
47616
45429
43480
44964
61008
64530
62960
57529
52954
51374
49211
47980
45575
44431
43596
45544
60109
63695
60819
54709
49357
46913
46728
44576
41988
40880
37860
38532
52713
56139
50939
46352
42169
42025
41713
40123
37737
36928
33812
36122
48823
51520
47090
42683
39947




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24

\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 & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36451&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]'Sir Ronald Aylmer Fisher' @ 193.190.124.24[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36451&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36451&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'Sir Ronald Aylmer Fisher' @ 193.190.124.24







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])
3649357-------
3746913-------
3846728-------
3944576-------
4041988-------
4140880-------
4237860-------
4338532-------
4452713-------
4556139-------
4650939-------
4746352-------
4842169-------
494202540143.743638548.924441818.39730.01380.008900.0089
504171339990.284437767.386542372.04630.07810.04700.0365
514012338203.518435644.878140985.74860.08820.006700.0026
523773736050.567733310.63239065.44630.13650.00411e-040
533692835127.375632173.383438412.88170.14140.05983e-040
543381232606.474629659.240135912.22570.23740.00529e-040
553612233168.015829933.824436830.72380.0570.36520.0020
564882344943.956740005.833550631.87960.09070.99880.00370.8305
575152047769.937642162.726554296.2140.130.37590.0060.9537
584709043477.950938212.012949639.16070.12530.00530.00880.6614
594268339678.3234740.433845482.82770.15520.00620.01210.2002
603994736201.294131590.397541643.82630.08870.00980.01580.0158

\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 & 49357 & - & - & - & - & - & - & - \tabularnewline
37 & 46913 & - & - & - & - & - & - & - \tabularnewline
38 & 46728 & - & - & - & - & - & - & - \tabularnewline
39 & 44576 & - & - & - & - & - & - & - \tabularnewline
40 & 41988 & - & - & - & - & - & - & - \tabularnewline
41 & 40880 & - & - & - & - & - & - & - \tabularnewline
42 & 37860 & - & - & - & - & - & - & - \tabularnewline
43 & 38532 & - & - & - & - & - & - & - \tabularnewline
44 & 52713 & - & - & - & - & - & - & - \tabularnewline
45 & 56139 & - & - & - & - & - & - & - \tabularnewline
46 & 50939 & - & - & - & - & - & - & - \tabularnewline
47 & 46352 & - & - & - & - & - & - & - \tabularnewline
48 & 42169 & - & - & - & - & - & - & - \tabularnewline
49 & 42025 & 40143.7436 & 38548.9244 & 41818.3973 & 0.0138 & 0.0089 & 0 & 0.0089 \tabularnewline
50 & 41713 & 39990.2844 & 37767.3865 & 42372.0463 & 0.0781 & 0.047 & 0 & 0.0365 \tabularnewline
51 & 40123 & 38203.5184 & 35644.8781 & 40985.7486 & 0.0882 & 0.0067 & 0 & 0.0026 \tabularnewline
52 & 37737 & 36050.5677 & 33310.632 & 39065.4463 & 0.1365 & 0.0041 & 1e-04 & 0 \tabularnewline
53 & 36928 & 35127.3756 & 32173.3834 & 38412.8817 & 0.1414 & 0.0598 & 3e-04 & 0 \tabularnewline
54 & 33812 & 32606.4746 & 29659.2401 & 35912.2257 & 0.2374 & 0.0052 & 9e-04 & 0 \tabularnewline
55 & 36122 & 33168.0158 & 29933.8244 & 36830.7238 & 0.057 & 0.3652 & 0.002 & 0 \tabularnewline
56 & 48823 & 44943.9567 & 40005.8335 & 50631.8796 & 0.0907 & 0.9988 & 0.0037 & 0.8305 \tabularnewline
57 & 51520 & 47769.9376 & 42162.7265 & 54296.214 & 0.13 & 0.3759 & 0.006 & 0.9537 \tabularnewline
58 & 47090 & 43477.9509 & 38212.0129 & 49639.1607 & 0.1253 & 0.0053 & 0.0088 & 0.6614 \tabularnewline
59 & 42683 & 39678.32 & 34740.4338 & 45482.8277 & 0.1552 & 0.0062 & 0.0121 & 0.2002 \tabularnewline
60 & 39947 & 36201.2941 & 31590.3975 & 41643.8263 & 0.0887 & 0.0098 & 0.0158 & 0.0158 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36451&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]49357[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]46913[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]46728[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]44576[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]41988[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]40880[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]37860[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]38532[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]52713[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]56139[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]50939[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]46352[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]42169[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]42025[/C][C]40143.7436[/C][C]38548.9244[/C][C]41818.3973[/C][C]0.0138[/C][C]0.0089[/C][C]0[/C][C]0.0089[/C][/ROW]
[ROW][C]50[/C][C]41713[/C][C]39990.2844[/C][C]37767.3865[/C][C]42372.0463[/C][C]0.0781[/C][C]0.047[/C][C]0[/C][C]0.0365[/C][/ROW]
[ROW][C]51[/C][C]40123[/C][C]38203.5184[/C][C]35644.8781[/C][C]40985.7486[/C][C]0.0882[/C][C]0.0067[/C][C]0[/C][C]0.0026[/C][/ROW]
[ROW][C]52[/C][C]37737[/C][C]36050.5677[/C][C]33310.632[/C][C]39065.4463[/C][C]0.1365[/C][C]0.0041[/C][C]1e-04[/C][C]0[/C][/ROW]
[ROW][C]53[/C][C]36928[/C][C]35127.3756[/C][C]32173.3834[/C][C]38412.8817[/C][C]0.1414[/C][C]0.0598[/C][C]3e-04[/C][C]0[/C][/ROW]
[ROW][C]54[/C][C]33812[/C][C]32606.4746[/C][C]29659.2401[/C][C]35912.2257[/C][C]0.2374[/C][C]0.0052[/C][C]9e-04[/C][C]0[/C][/ROW]
[ROW][C]55[/C][C]36122[/C][C]33168.0158[/C][C]29933.8244[/C][C]36830.7238[/C][C]0.057[/C][C]0.3652[/C][C]0.002[/C][C]0[/C][/ROW]
[ROW][C]56[/C][C]48823[/C][C]44943.9567[/C][C]40005.8335[/C][C]50631.8796[/C][C]0.0907[/C][C]0.9988[/C][C]0.0037[/C][C]0.8305[/C][/ROW]
[ROW][C]57[/C][C]51520[/C][C]47769.9376[/C][C]42162.7265[/C][C]54296.214[/C][C]0.13[/C][C]0.3759[/C][C]0.006[/C][C]0.9537[/C][/ROW]
[ROW][C]58[/C][C]47090[/C][C]43477.9509[/C][C]38212.0129[/C][C]49639.1607[/C][C]0.1253[/C][C]0.0053[/C][C]0.0088[/C][C]0.6614[/C][/ROW]
[ROW][C]59[/C][C]42683[/C][C]39678.32[/C][C]34740.4338[/C][C]45482.8277[/C][C]0.1552[/C][C]0.0062[/C][C]0.0121[/C][C]0.2002[/C][/ROW]
[ROW][C]60[/C][C]39947[/C][C]36201.2941[/C][C]31590.3975[/C][C]41643.8263[/C][C]0.0887[/C][C]0.0098[/C][C]0.0158[/C][C]0.0158[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36451&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36451&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])
3649357-------
3746913-------
3846728-------
3944576-------
4041988-------
4140880-------
4237860-------
4338532-------
4452713-------
4556139-------
4650939-------
4746352-------
4842169-------
494202540143.743638548.924441818.39730.01380.008900.0089
504171339990.284437767.386542372.04630.07810.04700.0365
514012338203.518435644.878140985.74860.08820.006700.0026
523773736050.567733310.63239065.44630.13650.00411e-040
533692835127.375632173.383438412.88170.14140.05983e-040
543381232606.474629659.240135912.22570.23740.00529e-040
553612233168.015829933.824436830.72380.0570.36520.0020
564882344943.956740005.833550631.87960.09070.99880.00370.8305
575152047769.937642162.726554296.2140.130.37590.0060.9537
584709043477.950938212.012949639.16070.12530.00530.00880.6614
594268339678.3234740.433845482.82770.15520.00620.01210.2002
603994736201.294131590.397541643.82630.08870.00980.01580.0158







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.02130.04690.00393539125.5534294927.1294543.0719
500.03040.04310.00362967748.9089247312.4091497.3051
510.03720.05020.00423684409.5658307034.1305554.1066
520.04270.04680.00392844053.8828237004.4902486.8311
530.04770.05130.00433242248.1335270187.3445519.7955
540.05170.0370.00311453291.5167121107.6264348.0052
550.05630.08910.00748726022.4081727168.534852.7418
560.06460.08630.007215046977.10781253914.7591119.7834
570.06970.07850.006514062968.29081171914.02421082.5498
580.07230.08310.006913046899.03091087241.58591042.7088
590.07460.07570.00639028101.6691752341.8058867.3764
600.07670.10350.008614030313.01761169192.75151081.2922

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0213 & 0.0469 & 0.0039 & 3539125.5534 & 294927.1294 & 543.0719 \tabularnewline
50 & 0.0304 & 0.0431 & 0.0036 & 2967748.9089 & 247312.4091 & 497.3051 \tabularnewline
51 & 0.0372 & 0.0502 & 0.0042 & 3684409.5658 & 307034.1305 & 554.1066 \tabularnewline
52 & 0.0427 & 0.0468 & 0.0039 & 2844053.8828 & 237004.4902 & 486.8311 \tabularnewline
53 & 0.0477 & 0.0513 & 0.0043 & 3242248.1335 & 270187.3445 & 519.7955 \tabularnewline
54 & 0.0517 & 0.037 & 0.0031 & 1453291.5167 & 121107.6264 & 348.0052 \tabularnewline
55 & 0.0563 & 0.0891 & 0.0074 & 8726022.4081 & 727168.534 & 852.7418 \tabularnewline
56 & 0.0646 & 0.0863 & 0.0072 & 15046977.1078 & 1253914.759 & 1119.7834 \tabularnewline
57 & 0.0697 & 0.0785 & 0.0065 & 14062968.2908 & 1171914.0242 & 1082.5498 \tabularnewline
58 & 0.0723 & 0.0831 & 0.0069 & 13046899.0309 & 1087241.5859 & 1042.7088 \tabularnewline
59 & 0.0746 & 0.0757 & 0.0063 & 9028101.6691 & 752341.8058 & 867.3764 \tabularnewline
60 & 0.0767 & 0.1035 & 0.0086 & 14030313.0176 & 1169192.7515 & 1081.2922 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36451&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.0213[/C][C]0.0469[/C][C]0.0039[/C][C]3539125.5534[/C][C]294927.1294[/C][C]543.0719[/C][/ROW]
[ROW][C]50[/C][C]0.0304[/C][C]0.0431[/C][C]0.0036[/C][C]2967748.9089[/C][C]247312.4091[/C][C]497.3051[/C][/ROW]
[ROW][C]51[/C][C]0.0372[/C][C]0.0502[/C][C]0.0042[/C][C]3684409.5658[/C][C]307034.1305[/C][C]554.1066[/C][/ROW]
[ROW][C]52[/C][C]0.0427[/C][C]0.0468[/C][C]0.0039[/C][C]2844053.8828[/C][C]237004.4902[/C][C]486.8311[/C][/ROW]
[ROW][C]53[/C][C]0.0477[/C][C]0.0513[/C][C]0.0043[/C][C]3242248.1335[/C][C]270187.3445[/C][C]519.7955[/C][/ROW]
[ROW][C]54[/C][C]0.0517[/C][C]0.037[/C][C]0.0031[/C][C]1453291.5167[/C][C]121107.6264[/C][C]348.0052[/C][/ROW]
[ROW][C]55[/C][C]0.0563[/C][C]0.0891[/C][C]0.0074[/C][C]8726022.4081[/C][C]727168.534[/C][C]852.7418[/C][/ROW]
[ROW][C]56[/C][C]0.0646[/C][C]0.0863[/C][C]0.0072[/C][C]15046977.1078[/C][C]1253914.759[/C][C]1119.7834[/C][/ROW]
[ROW][C]57[/C][C]0.0697[/C][C]0.0785[/C][C]0.0065[/C][C]14062968.2908[/C][C]1171914.0242[/C][C]1082.5498[/C][/ROW]
[ROW][C]58[/C][C]0.0723[/C][C]0.0831[/C][C]0.0069[/C][C]13046899.0309[/C][C]1087241.5859[/C][C]1042.7088[/C][/ROW]
[ROW][C]59[/C][C]0.0746[/C][C]0.0757[/C][C]0.0063[/C][C]9028101.6691[/C][C]752341.8058[/C][C]867.3764[/C][/ROW]
[ROW][C]60[/C][C]0.0767[/C][C]0.1035[/C][C]0.0086[/C][C]14030313.0176[/C][C]1169192.7515[/C][C]1081.2922[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36451&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36451&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.02130.04690.00393539125.5534294927.1294543.0719
500.03040.04310.00362967748.9089247312.4091497.3051
510.03720.05020.00423684409.5658307034.1305554.1066
520.04270.04680.00392844053.8828237004.4902486.8311
530.04770.05130.00433242248.1335270187.3445519.7955
540.05170.0370.00311453291.5167121107.6264348.0052
550.05630.08910.00748726022.4081727168.534852.7418
560.06460.08630.007215046977.10781253914.7591119.7834
570.06970.07850.006514062968.29081171914.02421082.5498
580.07230.08310.006913046899.03091087241.58591042.7088
590.07460.07570.00639028101.6691752341.8058867.3764
600.07670.10350.008614030313.01761169192.75151081.2922



Parameters (Session):
par1 = 12 ; par2 = -0.2 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = -0.2 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; 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,fx))
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')