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 computationWed, 02 Dec 2009 12:18:36 -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/02/t12597815906scx60mkd32vfeg.htm/, Retrieved Sun, 28 Apr 2024 16:28:24 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=62537, Retrieved Sun, 28 Apr 2024 16:28:24 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact189
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2009-12-02 19:18:36] [c4328af89eba9af53ee195d6fed304d9] [Current]
Feedback Forum

Post a new message
Dataseries X:
1111.92
1131.13
1144.94
1113.89
1107.30
1120.68
1140.84
1101.72
1104.24
1114.58
1130.20
1173.78
1211.92
1181.27
1203.60
1180.59
1156.85
1191.50
1191.33
1234.18
1220.33
1228.81
1207.01
1249.48
1248.29
1280.08
1280.66
1302.88
1310.61
1270.05
1270.06
1278.53
1303.80
1335.83
1377.76
1400.63
1418.03
1437.90
1406.80
1420.83
1482.37
1530.63
1504.66
1455.18
1473.96
1527.29
1545.79
1479.63
1467.97
1378.60
1330.45
1326.41
1385.97
1399.62
1276.69
1269.42
1287.83
1164.17
968.67
888.61




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=62537&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[48])
361400.63-------
371418.03-------
381437.9-------
391406.8-------
401420.83-------
411482.37-------
421530.63-------
431504.66-------
441455.18-------
451473.96-------
461527.29-------
471545.79-------
481479.63-------
491467.971453.66731400.13691507.19770.30020.17090.9040.1709
501378.61443.82891358.93041528.72740.0660.28870.55440.2043
511330.451461.56191356.54971566.57420.00720.93920.84660.368
521326.411456.43971340.64051572.2390.01390.98350.72670.3473
531385.971443.63611318.02081569.25140.18410.96630.27280.2872
541399.621444.25461309.02911579.48020.25880.80090.10530.3041
551276.691448.12821302.86331593.39310.01040.74360.22280.3354
561269.421453.7311299.30761608.15440.00970.98770.49270.3712
571287.831444.74841281.76821607.72870.02960.98250.36270.3374
581164.171427.88741256.98491598.790.00120.94590.12710.2765
59968.671413.6471235.07741592.216600.99690.07350.2345
60888.611417.25651231.33241603.1805010.25540.2554

\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 & 1400.63 & - & - & - & - & - & - & - \tabularnewline
37 & 1418.03 & - & - & - & - & - & - & - \tabularnewline
38 & 1437.9 & - & - & - & - & - & - & - \tabularnewline
39 & 1406.8 & - & - & - & - & - & - & - \tabularnewline
40 & 1420.83 & - & - & - & - & - & - & - \tabularnewline
41 & 1482.37 & - & - & - & - & - & - & - \tabularnewline
42 & 1530.63 & - & - & - & - & - & - & - \tabularnewline
43 & 1504.66 & - & - & - & - & - & - & - \tabularnewline
44 & 1455.18 & - & - & - & - & - & - & - \tabularnewline
45 & 1473.96 & - & - & - & - & - & - & - \tabularnewline
46 & 1527.29 & - & - & - & - & - & - & - \tabularnewline
47 & 1545.79 & - & - & - & - & - & - & - \tabularnewline
48 & 1479.63 & - & - & - & - & - & - & - \tabularnewline
49 & 1467.97 & 1453.6673 & 1400.1369 & 1507.1977 & 0.3002 & 0.1709 & 0.904 & 0.1709 \tabularnewline
50 & 1378.6 & 1443.8289 & 1358.9304 & 1528.7274 & 0.066 & 0.2887 & 0.5544 & 0.2043 \tabularnewline
51 & 1330.45 & 1461.5619 & 1356.5497 & 1566.5742 & 0.0072 & 0.9392 & 0.8466 & 0.368 \tabularnewline
52 & 1326.41 & 1456.4397 & 1340.6405 & 1572.239 & 0.0139 & 0.9835 & 0.7267 & 0.3473 \tabularnewline
53 & 1385.97 & 1443.6361 & 1318.0208 & 1569.2514 & 0.1841 & 0.9663 & 0.2728 & 0.2872 \tabularnewline
54 & 1399.62 & 1444.2546 & 1309.0291 & 1579.4802 & 0.2588 & 0.8009 & 0.1053 & 0.3041 \tabularnewline
55 & 1276.69 & 1448.1282 & 1302.8633 & 1593.3931 & 0.0104 & 0.7436 & 0.2228 & 0.3354 \tabularnewline
56 & 1269.42 & 1453.731 & 1299.3076 & 1608.1544 & 0.0097 & 0.9877 & 0.4927 & 0.3712 \tabularnewline
57 & 1287.83 & 1444.7484 & 1281.7682 & 1607.7287 & 0.0296 & 0.9825 & 0.3627 & 0.3374 \tabularnewline
58 & 1164.17 & 1427.8874 & 1256.9849 & 1598.79 & 0.0012 & 0.9459 & 0.1271 & 0.2765 \tabularnewline
59 & 968.67 & 1413.647 & 1235.0774 & 1592.2166 & 0 & 0.9969 & 0.0735 & 0.2345 \tabularnewline
60 & 888.61 & 1417.2565 & 1231.3324 & 1603.1805 & 0 & 1 & 0.2554 & 0.2554 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=62537&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]1400.63[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]1418.03[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]1437.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]1406.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]1420.83[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]1482.37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]1530.63[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]1504.66[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]1455.18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]1473.96[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]1527.29[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]1545.79[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]1479.63[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]1467.97[/C][C]1453.6673[/C][C]1400.1369[/C][C]1507.1977[/C][C]0.3002[/C][C]0.1709[/C][C]0.904[/C][C]0.1709[/C][/ROW]
[ROW][C]50[/C][C]1378.6[/C][C]1443.8289[/C][C]1358.9304[/C][C]1528.7274[/C][C]0.066[/C][C]0.2887[/C][C]0.5544[/C][C]0.2043[/C][/ROW]
[ROW][C]51[/C][C]1330.45[/C][C]1461.5619[/C][C]1356.5497[/C][C]1566.5742[/C][C]0.0072[/C][C]0.9392[/C][C]0.8466[/C][C]0.368[/C][/ROW]
[ROW][C]52[/C][C]1326.41[/C][C]1456.4397[/C][C]1340.6405[/C][C]1572.239[/C][C]0.0139[/C][C]0.9835[/C][C]0.7267[/C][C]0.3473[/C][/ROW]
[ROW][C]53[/C][C]1385.97[/C][C]1443.6361[/C][C]1318.0208[/C][C]1569.2514[/C][C]0.1841[/C][C]0.9663[/C][C]0.2728[/C][C]0.2872[/C][/ROW]
[ROW][C]54[/C][C]1399.62[/C][C]1444.2546[/C][C]1309.0291[/C][C]1579.4802[/C][C]0.2588[/C][C]0.8009[/C][C]0.1053[/C][C]0.3041[/C][/ROW]
[ROW][C]55[/C][C]1276.69[/C][C]1448.1282[/C][C]1302.8633[/C][C]1593.3931[/C][C]0.0104[/C][C]0.7436[/C][C]0.2228[/C][C]0.3354[/C][/ROW]
[ROW][C]56[/C][C]1269.42[/C][C]1453.731[/C][C]1299.3076[/C][C]1608.1544[/C][C]0.0097[/C][C]0.9877[/C][C]0.4927[/C][C]0.3712[/C][/ROW]
[ROW][C]57[/C][C]1287.83[/C][C]1444.7484[/C][C]1281.7682[/C][C]1607.7287[/C][C]0.0296[/C][C]0.9825[/C][C]0.3627[/C][C]0.3374[/C][/ROW]
[ROW][C]58[/C][C]1164.17[/C][C]1427.8874[/C][C]1256.9849[/C][C]1598.79[/C][C]0.0012[/C][C]0.9459[/C][C]0.1271[/C][C]0.2765[/C][/ROW]
[ROW][C]59[/C][C]968.67[/C][C]1413.647[/C][C]1235.0774[/C][C]1592.2166[/C][C]0[/C][C]0.9969[/C][C]0.0735[/C][C]0.2345[/C][/ROW]
[ROW][C]60[/C][C]888.61[/C][C]1417.2565[/C][C]1231.3324[/C][C]1603.1805[/C][C]0[/C][C]1[/C][C]0.2554[/C][C]0.2554[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=62537&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=62537&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])
361400.63-------
371418.03-------
381437.9-------
391406.8-------
401420.83-------
411482.37-------
421530.63-------
431504.66-------
441455.18-------
451473.96-------
461527.29-------
471545.79-------
481479.63-------
491467.971453.66731400.13691507.19770.30020.17090.9040.1709
501378.61443.82891358.93041528.72740.0660.28870.55440.2043
511330.451461.56191356.54971566.57420.00720.93920.84660.368
521326.411456.43971340.64051572.2390.01390.98350.72670.3473
531385.971443.63611318.02081569.25140.18410.96630.27280.2872
541399.621444.25461309.02911579.48020.25880.80090.10530.3041
551276.691448.12821302.86331593.39310.01040.74360.22280.3354
561269.421453.7311299.30761608.15440.00970.98770.49270.3712
571287.831444.74841281.76821607.72870.02960.98250.36270.3374
581164.171427.88741256.98491598.790.00120.94590.12710.2765
59968.671413.6471235.07741592.216600.99690.07350.2345
60888.611417.25651231.33241603.1805010.25540.2554







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.01880.00988e-04204.566917.04724.1288
500.03-0.04520.00384254.8107354.567618.83
510.0367-0.08970.007517190.33671432.528137.8488
520.0406-0.08930.007416907.73511408.977937.5364
530.0444-0.03990.00333325.3812277.115116.6468
540.0478-0.03090.00261992.2494166.020812.8849
550.0512-0.11840.009929391.0582449.254849.4899
560.0542-0.12680.010633970.53532830.877953.206
570.0576-0.10860.009124623.39452051.949545.2984
580.0611-0.18470.015469546.89015795.574276.1287
590.0644-0.31480.0262198004.531516500.3776128.4538
600.0669-0.3730.0311279467.069223288.9224152.6071

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0188 & 0.0098 & 8e-04 & 204.5669 & 17.0472 & 4.1288 \tabularnewline
50 & 0.03 & -0.0452 & 0.0038 & 4254.8107 & 354.5676 & 18.83 \tabularnewline
51 & 0.0367 & -0.0897 & 0.0075 & 17190.3367 & 1432.5281 & 37.8488 \tabularnewline
52 & 0.0406 & -0.0893 & 0.0074 & 16907.7351 & 1408.9779 & 37.5364 \tabularnewline
53 & 0.0444 & -0.0399 & 0.0033 & 3325.3812 & 277.1151 & 16.6468 \tabularnewline
54 & 0.0478 & -0.0309 & 0.0026 & 1992.2494 & 166.0208 & 12.8849 \tabularnewline
55 & 0.0512 & -0.1184 & 0.0099 & 29391.058 & 2449.2548 & 49.4899 \tabularnewline
56 & 0.0542 & -0.1268 & 0.0106 & 33970.5353 & 2830.8779 & 53.206 \tabularnewline
57 & 0.0576 & -0.1086 & 0.0091 & 24623.3945 & 2051.9495 & 45.2984 \tabularnewline
58 & 0.0611 & -0.1847 & 0.0154 & 69546.8901 & 5795.5742 & 76.1287 \tabularnewline
59 & 0.0644 & -0.3148 & 0.0262 & 198004.5315 & 16500.3776 & 128.4538 \tabularnewline
60 & 0.0669 & -0.373 & 0.0311 & 279467.0692 & 23288.9224 & 152.6071 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=62537&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.0188[/C][C]0.0098[/C][C]8e-04[/C][C]204.5669[/C][C]17.0472[/C][C]4.1288[/C][/ROW]
[ROW][C]50[/C][C]0.03[/C][C]-0.0452[/C][C]0.0038[/C][C]4254.8107[/C][C]354.5676[/C][C]18.83[/C][/ROW]
[ROW][C]51[/C][C]0.0367[/C][C]-0.0897[/C][C]0.0075[/C][C]17190.3367[/C][C]1432.5281[/C][C]37.8488[/C][/ROW]
[ROW][C]52[/C][C]0.0406[/C][C]-0.0893[/C][C]0.0074[/C][C]16907.7351[/C][C]1408.9779[/C][C]37.5364[/C][/ROW]
[ROW][C]53[/C][C]0.0444[/C][C]-0.0399[/C][C]0.0033[/C][C]3325.3812[/C][C]277.1151[/C][C]16.6468[/C][/ROW]
[ROW][C]54[/C][C]0.0478[/C][C]-0.0309[/C][C]0.0026[/C][C]1992.2494[/C][C]166.0208[/C][C]12.8849[/C][/ROW]
[ROW][C]55[/C][C]0.0512[/C][C]-0.1184[/C][C]0.0099[/C][C]29391.058[/C][C]2449.2548[/C][C]49.4899[/C][/ROW]
[ROW][C]56[/C][C]0.0542[/C][C]-0.1268[/C][C]0.0106[/C][C]33970.5353[/C][C]2830.8779[/C][C]53.206[/C][/ROW]
[ROW][C]57[/C][C]0.0576[/C][C]-0.1086[/C][C]0.0091[/C][C]24623.3945[/C][C]2051.9495[/C][C]45.2984[/C][/ROW]
[ROW][C]58[/C][C]0.0611[/C][C]-0.1847[/C][C]0.0154[/C][C]69546.8901[/C][C]5795.5742[/C][C]76.1287[/C][/ROW]
[ROW][C]59[/C][C]0.0644[/C][C]-0.3148[/C][C]0.0262[/C][C]198004.5315[/C][C]16500.3776[/C][C]128.4538[/C][/ROW]
[ROW][C]60[/C][C]0.0669[/C][C]-0.373[/C][C]0.0311[/C][C]279467.0692[/C][C]23288.9224[/C][C]152.6071[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=62537&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=62537&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.01880.00988e-04204.566917.04724.1288
500.03-0.04520.00384254.8107354.567618.83
510.0367-0.08970.007517190.33671432.528137.8488
520.0406-0.08930.007416907.73511408.977937.5364
530.0444-0.03990.00333325.3812277.115116.6468
540.0478-0.03090.00261992.2494166.020812.8849
550.0512-0.11840.009929391.0582449.254849.4899
560.0542-0.12680.010633970.53532830.877953.206
570.0576-0.10860.009124623.39452051.949545.2984
580.0611-0.18470.015469546.89015795.574276.1287
590.0644-0.31480.0262198004.531516500.3776128.4538
600.0669-0.3730.0311279467.069223288.9224152.6071



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