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 computationSat, 11 Dec 2010 20:18:57 +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/11/t1292098645q2q8vsczcqj05xs.htm/, Retrieved Mon, 06 May 2024 11:49:20 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=108297, Retrieved Mon, 06 May 2024 11:49:20 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact144
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-20 10:30:19] [ebd107afac1bd6180acb277edd05815b]
- R PD    [ARIMA Forecasting] [ARIMA forecast aa...] [2010-12-11 20:18:57] [de8ccb310fbbdc3d90ae577a3e011cf9] [Current]
-   PD      [ARIMA Forecasting] [ARIMA forecast in...] [2010-12-12 16:26:01] [04d4386fa51dbd2ef12d0f1f80644886]
Feedback Forum

Post a new message
Dataseries X:
1606
1634
2013
1654
1003
1029
1052
1653
1918
1926
1862
1816
1712
1646
1555
1402
1047
891
940
1372
2012
1879
1667
1856
1771
1721
1773
1507
1033
1011
1111
1736
1865
2078
1947
1428
1500
1950
1591
1613
1077
880
1128
1320
1692
1575
1478
1500
1368
1563
1424
1274
1047
1049
1069
981
1540
1559
1459
1559




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=108297&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])
361428-------
371500-------
381950-------
391591-------
401613-------
411077-------
42880-------
431128-------
441320-------
451692-------
461575-------
471478-------
481500-------
4913681540.1771234.99871845.35530.13440.60180.60180.6018
5015631749.05871417.22842080.8890.13590.98780.11760.9294
5114241664.52941332.43441996.62430.07790.72550.66780.8342
5212741516.45611174.32391858.58840.08240.70180.29010.5376
5310471039.2795696.87411381.68490.48240.08950.41450.0042
541049956.2221613.8091298.63520.29770.30170.66879e-04
5510691112.2897769.23721455.34210.40230.64120.46420.0134
569811594.93191251.87741937.98632e-040.99870.94190.7062
5715401804.52461461.46962147.57970.065410.73990.9591
5815591908.76661565.67712251.8560.02290.98240.97170.9902
5914591789.40931446.31752132.50110.02950.9060.96240.9509
6015591451.58681108.49441794.67910.26970.48310.39110.3911

\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 & 1428 & - & - & - & - & - & - & - \tabularnewline
37 & 1500 & - & - & - & - & - & - & - \tabularnewline
38 & 1950 & - & - & - & - & - & - & - \tabularnewline
39 & 1591 & - & - & - & - & - & - & - \tabularnewline
40 & 1613 & - & - & - & - & - & - & - \tabularnewline
41 & 1077 & - & - & - & - & - & - & - \tabularnewline
42 & 880 & - & - & - & - & - & - & - \tabularnewline
43 & 1128 & - & - & - & - & - & - & - \tabularnewline
44 & 1320 & - & - & - & - & - & - & - \tabularnewline
45 & 1692 & - & - & - & - & - & - & - \tabularnewline
46 & 1575 & - & - & - & - & - & - & - \tabularnewline
47 & 1478 & - & - & - & - & - & - & - \tabularnewline
48 & 1500 & - & - & - & - & - & - & - \tabularnewline
49 & 1368 & 1540.177 & 1234.9987 & 1845.3553 & 0.1344 & 0.6018 & 0.6018 & 0.6018 \tabularnewline
50 & 1563 & 1749.0587 & 1417.2284 & 2080.889 & 0.1359 & 0.9878 & 0.1176 & 0.9294 \tabularnewline
51 & 1424 & 1664.5294 & 1332.4344 & 1996.6243 & 0.0779 & 0.7255 & 0.6678 & 0.8342 \tabularnewline
52 & 1274 & 1516.4561 & 1174.3239 & 1858.5884 & 0.0824 & 0.7018 & 0.2901 & 0.5376 \tabularnewline
53 & 1047 & 1039.2795 & 696.8741 & 1381.6849 & 0.4824 & 0.0895 & 0.4145 & 0.0042 \tabularnewline
54 & 1049 & 956.2221 & 613.809 & 1298.6352 & 0.2977 & 0.3017 & 0.6687 & 9e-04 \tabularnewline
55 & 1069 & 1112.2897 & 769.2372 & 1455.3421 & 0.4023 & 0.6412 & 0.4642 & 0.0134 \tabularnewline
56 & 981 & 1594.9319 & 1251.8774 & 1937.9863 & 2e-04 & 0.9987 & 0.9419 & 0.7062 \tabularnewline
57 & 1540 & 1804.5246 & 1461.4696 & 2147.5797 & 0.0654 & 1 & 0.7399 & 0.9591 \tabularnewline
58 & 1559 & 1908.7666 & 1565.6771 & 2251.856 & 0.0229 & 0.9824 & 0.9717 & 0.9902 \tabularnewline
59 & 1459 & 1789.4093 & 1446.3175 & 2132.5011 & 0.0295 & 0.906 & 0.9624 & 0.9509 \tabularnewline
60 & 1559 & 1451.5868 & 1108.4944 & 1794.6791 & 0.2697 & 0.4831 & 0.3911 & 0.3911 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=108297&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]1428[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]1500[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]1950[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]1591[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]1613[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]1077[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]880[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]1128[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]1320[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]1692[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]1575[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]1478[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]1500[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]1368[/C][C]1540.177[/C][C]1234.9987[/C][C]1845.3553[/C][C]0.1344[/C][C]0.6018[/C][C]0.6018[/C][C]0.6018[/C][/ROW]
[ROW][C]50[/C][C]1563[/C][C]1749.0587[/C][C]1417.2284[/C][C]2080.889[/C][C]0.1359[/C][C]0.9878[/C][C]0.1176[/C][C]0.9294[/C][/ROW]
[ROW][C]51[/C][C]1424[/C][C]1664.5294[/C][C]1332.4344[/C][C]1996.6243[/C][C]0.0779[/C][C]0.7255[/C][C]0.6678[/C][C]0.8342[/C][/ROW]
[ROW][C]52[/C][C]1274[/C][C]1516.4561[/C][C]1174.3239[/C][C]1858.5884[/C][C]0.0824[/C][C]0.7018[/C][C]0.2901[/C][C]0.5376[/C][/ROW]
[ROW][C]53[/C][C]1047[/C][C]1039.2795[/C][C]696.8741[/C][C]1381.6849[/C][C]0.4824[/C][C]0.0895[/C][C]0.4145[/C][C]0.0042[/C][/ROW]
[ROW][C]54[/C][C]1049[/C][C]956.2221[/C][C]613.809[/C][C]1298.6352[/C][C]0.2977[/C][C]0.3017[/C][C]0.6687[/C][C]9e-04[/C][/ROW]
[ROW][C]55[/C][C]1069[/C][C]1112.2897[/C][C]769.2372[/C][C]1455.3421[/C][C]0.4023[/C][C]0.6412[/C][C]0.4642[/C][C]0.0134[/C][/ROW]
[ROW][C]56[/C][C]981[/C][C]1594.9319[/C][C]1251.8774[/C][C]1937.9863[/C][C]2e-04[/C][C]0.9987[/C][C]0.9419[/C][C]0.7062[/C][/ROW]
[ROW][C]57[/C][C]1540[/C][C]1804.5246[/C][C]1461.4696[/C][C]2147.5797[/C][C]0.0654[/C][C]1[/C][C]0.7399[/C][C]0.9591[/C][/ROW]
[ROW][C]58[/C][C]1559[/C][C]1908.7666[/C][C]1565.6771[/C][C]2251.856[/C][C]0.0229[/C][C]0.9824[/C][C]0.9717[/C][C]0.9902[/C][/ROW]
[ROW][C]59[/C][C]1459[/C][C]1789.4093[/C][C]1446.3175[/C][C]2132.5011[/C][C]0.0295[/C][C]0.906[/C][C]0.9624[/C][C]0.9509[/C][/ROW]
[ROW][C]60[/C][C]1559[/C][C]1451.5868[/C][C]1108.4944[/C][C]1794.6791[/C][C]0.2697[/C][C]0.4831[/C][C]0.3911[/C][C]0.3911[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=108297&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=108297&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])
361428-------
371500-------
381950-------
391591-------
401613-------
411077-------
42880-------
431128-------
441320-------
451692-------
461575-------
471478-------
481500-------
4913681540.1771234.99871845.35530.13440.60180.60180.6018
5015631749.05871417.22842080.8890.13590.98780.11760.9294
5114241664.52941332.43441996.62430.07790.72550.66780.8342
5212741516.45611174.32391858.58840.08240.70180.29010.5376
5310471039.2795696.87411381.68490.48240.08950.41450.0042
541049956.2221613.8091298.63520.29770.30170.66879e-04
5510691112.2897769.23721455.34210.40230.64120.46420.0134
569811594.93191251.87741937.98632e-040.99870.94190.7062
5715401804.52461461.46962147.57970.065410.73990.9591
5815591908.76661565.67712251.8560.02290.98240.97170.9902
5914591789.40931446.31752132.50110.02950.9060.96240.9509
6015591451.58681108.49441794.67910.26970.48310.39110.3911







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.1011-0.1118029644.920400
500.0968-0.10640.109134617.837532131.3789179.2523
510.1018-0.14450.120957854.376240705.7114201.7566
520.1151-0.15990.130658784.979145225.5283212.6629
530.16810.00740.10659.605836192.3438190.2429
540.18270.0970.10458607.732531594.9086177.7496
550.1574-0.03890.09511873.993927349.0636165.3755
560.1097-0.38490.1314376912.322671044.471266.5417
570.097-0.14660.13369973.275770925.4493266.3183
580.0917-0.18320.1381122336.646576066.569275.8017
590.0978-0.18460.1423109170.297379075.9988281.2045
600.12060.0740.136611537.605473447.7994271.0125

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.1011 & -0.1118 & 0 & 29644.9204 & 0 & 0 \tabularnewline
50 & 0.0968 & -0.1064 & 0.1091 & 34617.8375 & 32131.3789 & 179.2523 \tabularnewline
51 & 0.1018 & -0.1445 & 0.1209 & 57854.3762 & 40705.7114 & 201.7566 \tabularnewline
52 & 0.1151 & -0.1599 & 0.1306 & 58784.9791 & 45225.5283 & 212.6629 \tabularnewline
53 & 0.1681 & 0.0074 & 0.106 & 59.6058 & 36192.3438 & 190.2429 \tabularnewline
54 & 0.1827 & 0.097 & 0.1045 & 8607.7325 & 31594.9086 & 177.7496 \tabularnewline
55 & 0.1574 & -0.0389 & 0.0951 & 1873.9939 & 27349.0636 & 165.3755 \tabularnewline
56 & 0.1097 & -0.3849 & 0.1314 & 376912.3226 & 71044.471 & 266.5417 \tabularnewline
57 & 0.097 & -0.1466 & 0.133 & 69973.2757 & 70925.4493 & 266.3183 \tabularnewline
58 & 0.0917 & -0.1832 & 0.1381 & 122336.6465 & 76066.569 & 275.8017 \tabularnewline
59 & 0.0978 & -0.1846 & 0.1423 & 109170.2973 & 79075.9988 & 281.2045 \tabularnewline
60 & 0.1206 & 0.074 & 0.1366 & 11537.6054 & 73447.7994 & 271.0125 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=108297&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.1011[/C][C]-0.1118[/C][C]0[/C][C]29644.9204[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0968[/C][C]-0.1064[/C][C]0.1091[/C][C]34617.8375[/C][C]32131.3789[/C][C]179.2523[/C][/ROW]
[ROW][C]51[/C][C]0.1018[/C][C]-0.1445[/C][C]0.1209[/C][C]57854.3762[/C][C]40705.7114[/C][C]201.7566[/C][/ROW]
[ROW][C]52[/C][C]0.1151[/C][C]-0.1599[/C][C]0.1306[/C][C]58784.9791[/C][C]45225.5283[/C][C]212.6629[/C][/ROW]
[ROW][C]53[/C][C]0.1681[/C][C]0.0074[/C][C]0.106[/C][C]59.6058[/C][C]36192.3438[/C][C]190.2429[/C][/ROW]
[ROW][C]54[/C][C]0.1827[/C][C]0.097[/C][C]0.1045[/C][C]8607.7325[/C][C]31594.9086[/C][C]177.7496[/C][/ROW]
[ROW][C]55[/C][C]0.1574[/C][C]-0.0389[/C][C]0.0951[/C][C]1873.9939[/C][C]27349.0636[/C][C]165.3755[/C][/ROW]
[ROW][C]56[/C][C]0.1097[/C][C]-0.3849[/C][C]0.1314[/C][C]376912.3226[/C][C]71044.471[/C][C]266.5417[/C][/ROW]
[ROW][C]57[/C][C]0.097[/C][C]-0.1466[/C][C]0.133[/C][C]69973.2757[/C][C]70925.4493[/C][C]266.3183[/C][/ROW]
[ROW][C]58[/C][C]0.0917[/C][C]-0.1832[/C][C]0.1381[/C][C]122336.6465[/C][C]76066.569[/C][C]275.8017[/C][/ROW]
[ROW][C]59[/C][C]0.0978[/C][C]-0.1846[/C][C]0.1423[/C][C]109170.2973[/C][C]79075.9988[/C][C]281.2045[/C][/ROW]
[ROW][C]60[/C][C]0.1206[/C][C]0.074[/C][C]0.1366[/C][C]11537.6054[/C][C]73447.7994[/C][C]271.0125[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=108297&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=108297&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.1011-0.1118029644.920400
500.0968-0.10640.109134617.837532131.3789179.2523
510.1018-0.14450.120957854.376240705.7114201.7566
520.1151-0.15990.130658784.979145225.5283212.6629
530.16810.00740.10659.605836192.3438190.2429
540.18270.0970.10458607.732531594.9086177.7496
550.1574-0.03890.09511873.993927349.0636165.3755
560.1097-0.38490.1314376912.322671044.471266.5417
570.097-0.14660.13369973.275770925.4493266.3183
580.0917-0.18320.1381122336.646576066.569275.8017
590.0978-0.18460.1423109170.297379075.9988281.2045
600.12060.0740.136611537.605473447.7994271.0125



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