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, 23 Dec 2008 12:37:29 -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/23/t1230061092zjxid6wvga48kct.htm/, Retrieved Sun, 19 May 2024 12:14:28 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=36380, Retrieved Sun, 19 May 2024 12:14:28 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact124
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2008-12-23 19:37:29] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
104.3
103.9
103.9
103.9
108.0
108.0
108.0
108.0
108.0
108.0
108.0
108.0
108.0
108.0
108.0
108.0
108.0
108.0
108.0
108.0
108.0
108.0
108.0
108.0
108.0
108.0
108.0
108.2
112.3
111.3
111.3
115.3
117.2
118.3
118.3
118.3
119.0
120.6
122.6
122.6
127.4
125.9
121.5
118.8
121.6
122.3
122.7
120.8
120.1
120.1
120.1
120.1
128.4
129.8
129.8
128.6
128.6
133.7
130.0
125.9
129.4
129.4
130.6
130.6
130.6
130.8
129.7
125.8
126.0
125.6
125.4
124.7
126.9
129.1




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36380&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 time3 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[62])
50120.1-------
51120.1-------
52120.1-------
53128.4-------
54129.8-------
55129.8-------
56128.6-------
57128.6-------
58133.7-------
59130-------
60125.9-------
61129.4-------
62129.4-------
63130.6129.2133125.635132.79160.22380.459310.4593
64130.6129.2484123.9962134.50070.3070.3070.99970.4774
65130.6132.8913126.8368138.94590.22910.77090.9270.8708
66130.8132.6444125.9378139.3510.29490.72490.79710.8285
67129.7131.035123.6585138.41150.36140.52490.62860.668
68125.8129.8048121.7979137.81180.16350.51020.6160.5395
69126130.765122.1892139.34080.13810.87180.68960.6225
70125.6132.0831122.9789141.18730.08140.90480.36390.7182
71125.4131.3955121.7896141.00140.11060.88150.61210.6581
72124.7129.8223119.7388139.90580.15970.8050.77710.5327
73126.9130.3066119.768140.84510.26320.85150.56690.5669
74129.1130.28119.3059141.2540.41650.7270.56240.5624

\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[62]) \tabularnewline
50 & 120.1 & - & - & - & - & - & - & - \tabularnewline
51 & 120.1 & - & - & - & - & - & - & - \tabularnewline
52 & 120.1 & - & - & - & - & - & - & - \tabularnewline
53 & 128.4 & - & - & - & - & - & - & - \tabularnewline
54 & 129.8 & - & - & - & - & - & - & - \tabularnewline
55 & 129.8 & - & - & - & - & - & - & - \tabularnewline
56 & 128.6 & - & - & - & - & - & - & - \tabularnewline
57 & 128.6 & - & - & - & - & - & - & - \tabularnewline
58 & 133.7 & - & - & - & - & - & - & - \tabularnewline
59 & 130 & - & - & - & - & - & - & - \tabularnewline
60 & 125.9 & - & - & - & - & - & - & - \tabularnewline
61 & 129.4 & - & - & - & - & - & - & - \tabularnewline
62 & 129.4 & - & - & - & - & - & - & - \tabularnewline
63 & 130.6 & 129.2133 & 125.635 & 132.7916 & 0.2238 & 0.4593 & 1 & 0.4593 \tabularnewline
64 & 130.6 & 129.2484 & 123.9962 & 134.5007 & 0.307 & 0.307 & 0.9997 & 0.4774 \tabularnewline
65 & 130.6 & 132.8913 & 126.8368 & 138.9459 & 0.2291 & 0.7709 & 0.927 & 0.8708 \tabularnewline
66 & 130.8 & 132.6444 & 125.9378 & 139.351 & 0.2949 & 0.7249 & 0.7971 & 0.8285 \tabularnewline
67 & 129.7 & 131.035 & 123.6585 & 138.4115 & 0.3614 & 0.5249 & 0.6286 & 0.668 \tabularnewline
68 & 125.8 & 129.8048 & 121.7979 & 137.8118 & 0.1635 & 0.5102 & 0.616 & 0.5395 \tabularnewline
69 & 126 & 130.765 & 122.1892 & 139.3408 & 0.1381 & 0.8718 & 0.6896 & 0.6225 \tabularnewline
70 & 125.6 & 132.0831 & 122.9789 & 141.1873 & 0.0814 & 0.9048 & 0.3639 & 0.7182 \tabularnewline
71 & 125.4 & 131.3955 & 121.7896 & 141.0014 & 0.1106 & 0.8815 & 0.6121 & 0.6581 \tabularnewline
72 & 124.7 & 129.8223 & 119.7388 & 139.9058 & 0.1597 & 0.805 & 0.7771 & 0.5327 \tabularnewline
73 & 126.9 & 130.3066 & 119.768 & 140.8451 & 0.2632 & 0.8515 & 0.5669 & 0.5669 \tabularnewline
74 & 129.1 & 130.28 & 119.3059 & 141.254 & 0.4165 & 0.727 & 0.5624 & 0.5624 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36380&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[62])[/C][/ROW]
[ROW][C]50[/C][C]120.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]120.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]120.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]128.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]129.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]129.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]128.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]128.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]133.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]130[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]125.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]129.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]129.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]130.6[/C][C]129.2133[/C][C]125.635[/C][C]132.7916[/C][C]0.2238[/C][C]0.4593[/C][C]1[/C][C]0.4593[/C][/ROW]
[ROW][C]64[/C][C]130.6[/C][C]129.2484[/C][C]123.9962[/C][C]134.5007[/C][C]0.307[/C][C]0.307[/C][C]0.9997[/C][C]0.4774[/C][/ROW]
[ROW][C]65[/C][C]130.6[/C][C]132.8913[/C][C]126.8368[/C][C]138.9459[/C][C]0.2291[/C][C]0.7709[/C][C]0.927[/C][C]0.8708[/C][/ROW]
[ROW][C]66[/C][C]130.8[/C][C]132.6444[/C][C]125.9378[/C][C]139.351[/C][C]0.2949[/C][C]0.7249[/C][C]0.7971[/C][C]0.8285[/C][/ROW]
[ROW][C]67[/C][C]129.7[/C][C]131.035[/C][C]123.6585[/C][C]138.4115[/C][C]0.3614[/C][C]0.5249[/C][C]0.6286[/C][C]0.668[/C][/ROW]
[ROW][C]68[/C][C]125.8[/C][C]129.8048[/C][C]121.7979[/C][C]137.8118[/C][C]0.1635[/C][C]0.5102[/C][C]0.616[/C][C]0.5395[/C][/ROW]
[ROW][C]69[/C][C]126[/C][C]130.765[/C][C]122.1892[/C][C]139.3408[/C][C]0.1381[/C][C]0.8718[/C][C]0.6896[/C][C]0.6225[/C][/ROW]
[ROW][C]70[/C][C]125.6[/C][C]132.0831[/C][C]122.9789[/C][C]141.1873[/C][C]0.0814[/C][C]0.9048[/C][C]0.3639[/C][C]0.7182[/C][/ROW]
[ROW][C]71[/C][C]125.4[/C][C]131.3955[/C][C]121.7896[/C][C]141.0014[/C][C]0.1106[/C][C]0.8815[/C][C]0.6121[/C][C]0.6581[/C][/ROW]
[ROW][C]72[/C][C]124.7[/C][C]129.8223[/C][C]119.7388[/C][C]139.9058[/C][C]0.1597[/C][C]0.805[/C][C]0.7771[/C][C]0.5327[/C][/ROW]
[ROW][C]73[/C][C]126.9[/C][C]130.3066[/C][C]119.768[/C][C]140.8451[/C][C]0.2632[/C][C]0.8515[/C][C]0.5669[/C][C]0.5669[/C][/ROW]
[ROW][C]74[/C][C]129.1[/C][C]130.28[/C][C]119.3059[/C][C]141.254[/C][C]0.4165[/C][C]0.727[/C][C]0.5624[/C][C]0.5624[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36380&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36380&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[62])
50120.1-------
51120.1-------
52120.1-------
53128.4-------
54129.8-------
55129.8-------
56128.6-------
57128.6-------
58133.7-------
59130-------
60125.9-------
61129.4-------
62129.4-------
63130.6129.2133125.635132.79160.22380.459310.4593
64130.6129.2484123.9962134.50070.3070.3070.99970.4774
65130.6132.8913126.8368138.94590.22910.77090.9270.8708
66130.8132.6444125.9378139.3510.29490.72490.79710.8285
67129.7131.035123.6585138.41150.36140.52490.62860.668
68125.8129.8048121.7979137.81180.16350.51020.6160.5395
69126130.765122.1892139.34080.13810.87180.68960.6225
70125.6132.0831122.9789141.18730.08140.90480.36390.7182
71125.4131.3955121.7896141.00140.11060.88150.61210.6581
72124.7129.8223119.7388139.90580.15970.8050.77710.5327
73126.9130.3066119.768140.84510.26320.85150.56690.5669
74129.1130.28119.3059141.2540.41650.7270.56240.5624







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
630.01410.01079e-041.92290.16020.4003
640.02070.01059e-041.82670.15220.3902
650.0232-0.01720.00145.25020.43750.6614
660.0258-0.01390.00123.40190.28350.5324
670.0287-0.01028e-041.78220.14850.3854
680.0315-0.03090.002616.03881.33661.1561
690.0335-0.03640.00322.70521.89211.3755
700.0352-0.04910.004142.03073.50261.8715
710.0373-0.04560.003835.9462.99551.7308
720.0396-0.03950.003326.23812.18651.4787
730.0413-0.02610.002211.60480.96710.9834
740.043-0.00918e-041.39230.1160.3406

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
63 & 0.0141 & 0.0107 & 9e-04 & 1.9229 & 0.1602 & 0.4003 \tabularnewline
64 & 0.0207 & 0.0105 & 9e-04 & 1.8267 & 0.1522 & 0.3902 \tabularnewline
65 & 0.0232 & -0.0172 & 0.0014 & 5.2502 & 0.4375 & 0.6614 \tabularnewline
66 & 0.0258 & -0.0139 & 0.0012 & 3.4019 & 0.2835 & 0.5324 \tabularnewline
67 & 0.0287 & -0.0102 & 8e-04 & 1.7822 & 0.1485 & 0.3854 \tabularnewline
68 & 0.0315 & -0.0309 & 0.0026 & 16.0388 & 1.3366 & 1.1561 \tabularnewline
69 & 0.0335 & -0.0364 & 0.003 & 22.7052 & 1.8921 & 1.3755 \tabularnewline
70 & 0.0352 & -0.0491 & 0.0041 & 42.0307 & 3.5026 & 1.8715 \tabularnewline
71 & 0.0373 & -0.0456 & 0.0038 & 35.946 & 2.9955 & 1.7308 \tabularnewline
72 & 0.0396 & -0.0395 & 0.0033 & 26.2381 & 2.1865 & 1.4787 \tabularnewline
73 & 0.0413 & -0.0261 & 0.0022 & 11.6048 & 0.9671 & 0.9834 \tabularnewline
74 & 0.043 & -0.0091 & 8e-04 & 1.3923 & 0.116 & 0.3406 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36380&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]63[/C][C]0.0141[/C][C]0.0107[/C][C]9e-04[/C][C]1.9229[/C][C]0.1602[/C][C]0.4003[/C][/ROW]
[ROW][C]64[/C][C]0.0207[/C][C]0.0105[/C][C]9e-04[/C][C]1.8267[/C][C]0.1522[/C][C]0.3902[/C][/ROW]
[ROW][C]65[/C][C]0.0232[/C][C]-0.0172[/C][C]0.0014[/C][C]5.2502[/C][C]0.4375[/C][C]0.6614[/C][/ROW]
[ROW][C]66[/C][C]0.0258[/C][C]-0.0139[/C][C]0.0012[/C][C]3.4019[/C][C]0.2835[/C][C]0.5324[/C][/ROW]
[ROW][C]67[/C][C]0.0287[/C][C]-0.0102[/C][C]8e-04[/C][C]1.7822[/C][C]0.1485[/C][C]0.3854[/C][/ROW]
[ROW][C]68[/C][C]0.0315[/C][C]-0.0309[/C][C]0.0026[/C][C]16.0388[/C][C]1.3366[/C][C]1.1561[/C][/ROW]
[ROW][C]69[/C][C]0.0335[/C][C]-0.0364[/C][C]0.003[/C][C]22.7052[/C][C]1.8921[/C][C]1.3755[/C][/ROW]
[ROW][C]70[/C][C]0.0352[/C][C]-0.0491[/C][C]0.0041[/C][C]42.0307[/C][C]3.5026[/C][C]1.8715[/C][/ROW]
[ROW][C]71[/C][C]0.0373[/C][C]-0.0456[/C][C]0.0038[/C][C]35.946[/C][C]2.9955[/C][C]1.7308[/C][/ROW]
[ROW][C]72[/C][C]0.0396[/C][C]-0.0395[/C][C]0.0033[/C][C]26.2381[/C][C]2.1865[/C][C]1.4787[/C][/ROW]
[ROW][C]73[/C][C]0.0413[/C][C]-0.0261[/C][C]0.0022[/C][C]11.6048[/C][C]0.9671[/C][C]0.9834[/C][/ROW]
[ROW][C]74[/C][C]0.043[/C][C]-0.0091[/C][C]8e-04[/C][C]1.3923[/C][C]0.116[/C][C]0.3406[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36380&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36380&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
630.01410.01079e-041.92290.16020.4003
640.02070.01059e-041.82670.15220.3902
650.0232-0.01720.00145.25020.43750.6614
660.0258-0.01390.00123.40190.28350.5324
670.0287-0.01028e-041.78220.14850.3854
680.0315-0.03090.002616.03881.33661.1561
690.0335-0.03640.00322.70521.89211.3755
700.0352-0.04910.004142.03073.50261.8715
710.0373-0.04560.003835.9462.99551.7308
720.0396-0.03950.003326.23812.18651.4787
730.0413-0.02610.002211.60480.96710.9834
740.043-0.00918e-041.39230.1160.3406



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