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 computationSun, 20 Dec 2009 03:30:19 -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/20/t1261305230wptr9abq5adhuxn.htm/, Retrieved Sat, 27 Apr 2024 11:25:18 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69820, Retrieved Sat, 27 Apr 2024 11:25:18 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsshwpaper30
Estimated Impact139
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] [4407d6264e55b051ec65750e6dca2820] [Current]
- R PD    [ARIMA Forecasting] [ARIMA forecast aa...] [2010-12-11 20:18:57] [04d4386fa51dbd2ef12d0f1f80644886]
-   PD      [ARIMA Forecasting] [ARIMA forecast in...] [2010-12-12 16:26:01] [04d4386fa51dbd2ef12d0f1f80644886]
-   PD    [ARIMA Forecasting] [] [2010-12-24 16:16:47] [6e5489189f7de5cfbcc25dd35ae15009]
Feedback Forum

Post a new message
Dataseries X:
15912,8
13866,5
17823,2
17872
17420,4
16704,4
15991,2
16583,6
19123,5
17838,7
17209,4
18586,5
16258,1
15141,6
19202,1
17746,5
19090,1
18040,3
17515,5
17751,8
21072,4
17170
19439,5
19795,4
17574,9
16165,4
19464,6
19932,1
19961,2
17343,4
18924,2
18574,1
21350,6
18594,6
19823,1
20844,4
19640,2
17735,4
19813,6
22160
20664,3
17877,4
20906,5
21164,1
21374,4
22952,3
21343,5
23899,3
22392,9
18274,1
22786,7
22321,5
17842,2
16373,5
15993,8
16446,1
17729
16643
16196,7
18252,1
17304




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69820&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[49])
3719640.2-------
3817735.4-------
3919813.6-------
4022160-------
4120664.3-------
4217877.4-------
4320906.5-------
4421164.1-------
4521374.4-------
4622952.3-------
4721343.5-------
4823899.3-------
4922392.9-------
5018274.120309.303818611.802622006.80490.00940.00810.99850.0081
5122786.722429.187620680.166624178.20850.344310.99830.5162
5222321.524977.062823103.263126850.86260.00270.9890.99840.9966
5317842.223245.107221231.56125258.653500.81570.9940.7966
5416373.520556.57518522.425722590.724300.99550.99510.0384
5515993.823618.687221532.507325704.8671010.99460.8753
5616446.123815.653321634.723625996.5829010.99140.8995
571772924042.136321825.798326258.4744010.99080.9276
581664325645.396623376.43227914.3613010.990.9975
5916196.724008.236321675.701226340.7714010.98740.9127
6018252.126571.436724193.829528949.0439010.98620.9997
611730425074.15122647.929427500.3726010.98480.9848

\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[49]) \tabularnewline
37 & 19640.2 & - & - & - & - & - & - & - \tabularnewline
38 & 17735.4 & - & - & - & - & - & - & - \tabularnewline
39 & 19813.6 & - & - & - & - & - & - & - \tabularnewline
40 & 22160 & - & - & - & - & - & - & - \tabularnewline
41 & 20664.3 & - & - & - & - & - & - & - \tabularnewline
42 & 17877.4 & - & - & - & - & - & - & - \tabularnewline
43 & 20906.5 & - & - & - & - & - & - & - \tabularnewline
44 & 21164.1 & - & - & - & - & - & - & - \tabularnewline
45 & 21374.4 & - & - & - & - & - & - & - \tabularnewline
46 & 22952.3 & - & - & - & - & - & - & - \tabularnewline
47 & 21343.5 & - & - & - & - & - & - & - \tabularnewline
48 & 23899.3 & - & - & - & - & - & - & - \tabularnewline
49 & 22392.9 & - & - & - & - & - & - & - \tabularnewline
50 & 18274.1 & 20309.3038 & 18611.8026 & 22006.8049 & 0.0094 & 0.0081 & 0.9985 & 0.0081 \tabularnewline
51 & 22786.7 & 22429.1876 & 20680.1666 & 24178.2085 & 0.3443 & 1 & 0.9983 & 0.5162 \tabularnewline
52 & 22321.5 & 24977.0628 & 23103.2631 & 26850.8626 & 0.0027 & 0.989 & 0.9984 & 0.9966 \tabularnewline
53 & 17842.2 & 23245.1072 & 21231.561 & 25258.6535 & 0 & 0.8157 & 0.994 & 0.7966 \tabularnewline
54 & 16373.5 & 20556.575 & 18522.4257 & 22590.7243 & 0 & 0.9955 & 0.9951 & 0.0384 \tabularnewline
55 & 15993.8 & 23618.6872 & 21532.5073 & 25704.8671 & 0 & 1 & 0.9946 & 0.8753 \tabularnewline
56 & 16446.1 & 23815.6533 & 21634.7236 & 25996.5829 & 0 & 1 & 0.9914 & 0.8995 \tabularnewline
57 & 17729 & 24042.1363 & 21825.7983 & 26258.4744 & 0 & 1 & 0.9908 & 0.9276 \tabularnewline
58 & 16643 & 25645.3966 & 23376.432 & 27914.3613 & 0 & 1 & 0.99 & 0.9975 \tabularnewline
59 & 16196.7 & 24008.2363 & 21675.7012 & 26340.7714 & 0 & 1 & 0.9874 & 0.9127 \tabularnewline
60 & 18252.1 & 26571.4367 & 24193.8295 & 28949.0439 & 0 & 1 & 0.9862 & 0.9997 \tabularnewline
61 & 17304 & 25074.151 & 22647.9294 & 27500.3726 & 0 & 1 & 0.9848 & 0.9848 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69820&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[49])[/C][/ROW]
[ROW][C]37[/C][C]19640.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]17735.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]19813.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]22160[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]20664.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]17877.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]20906.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]21164.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]21374.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]22952.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]21343.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]23899.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]22392.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]18274.1[/C][C]20309.3038[/C][C]18611.8026[/C][C]22006.8049[/C][C]0.0094[/C][C]0.0081[/C][C]0.9985[/C][C]0.0081[/C][/ROW]
[ROW][C]51[/C][C]22786.7[/C][C]22429.1876[/C][C]20680.1666[/C][C]24178.2085[/C][C]0.3443[/C][C]1[/C][C]0.9983[/C][C]0.5162[/C][/ROW]
[ROW][C]52[/C][C]22321.5[/C][C]24977.0628[/C][C]23103.2631[/C][C]26850.8626[/C][C]0.0027[/C][C]0.989[/C][C]0.9984[/C][C]0.9966[/C][/ROW]
[ROW][C]53[/C][C]17842.2[/C][C]23245.1072[/C][C]21231.561[/C][C]25258.6535[/C][C]0[/C][C]0.8157[/C][C]0.994[/C][C]0.7966[/C][/ROW]
[ROW][C]54[/C][C]16373.5[/C][C]20556.575[/C][C]18522.4257[/C][C]22590.7243[/C][C]0[/C][C]0.9955[/C][C]0.9951[/C][C]0.0384[/C][/ROW]
[ROW][C]55[/C][C]15993.8[/C][C]23618.6872[/C][C]21532.5073[/C][C]25704.8671[/C][C]0[/C][C]1[/C][C]0.9946[/C][C]0.8753[/C][/ROW]
[ROW][C]56[/C][C]16446.1[/C][C]23815.6533[/C][C]21634.7236[/C][C]25996.5829[/C][C]0[/C][C]1[/C][C]0.9914[/C][C]0.8995[/C][/ROW]
[ROW][C]57[/C][C]17729[/C][C]24042.1363[/C][C]21825.7983[/C][C]26258.4744[/C][C]0[/C][C]1[/C][C]0.9908[/C][C]0.9276[/C][/ROW]
[ROW][C]58[/C][C]16643[/C][C]25645.3966[/C][C]23376.432[/C][C]27914.3613[/C][C]0[/C][C]1[/C][C]0.99[/C][C]0.9975[/C][/ROW]
[ROW][C]59[/C][C]16196.7[/C][C]24008.2363[/C][C]21675.7012[/C][C]26340.7714[/C][C]0[/C][C]1[/C][C]0.9874[/C][C]0.9127[/C][/ROW]
[ROW][C]60[/C][C]18252.1[/C][C]26571.4367[/C][C]24193.8295[/C][C]28949.0439[/C][C]0[/C][C]1[/C][C]0.9862[/C][C]0.9997[/C][/ROW]
[ROW][C]61[/C][C]17304[/C][C]25074.151[/C][C]22647.9294[/C][C]27500.3726[/C][C]0[/C][C]1[/C][C]0.9848[/C][C]0.9848[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69820&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69820&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[49])
3719640.2-------
3817735.4-------
3919813.6-------
4022160-------
4120664.3-------
4217877.4-------
4320906.5-------
4421164.1-------
4521374.4-------
4622952.3-------
4721343.5-------
4823899.3-------
4922392.9-------
5018274.120309.303818611.802622006.80490.00940.00810.99850.0081
5122786.722429.187620680.166624178.20850.344310.99830.5162
5222321.524977.062823103.263126850.86260.00270.9890.99840.9966
5317842.223245.107221231.56125258.653500.81570.9940.7966
5416373.520556.57518522.425722590.724300.99550.99510.0384
5515993.823618.687221532.507325704.8671010.99460.8753
5616446.123815.653321634.723625996.5829010.99140.8995
571772924042.136321825.798326258.4744010.99080.9276
581664325645.396623376.43227914.3613010.990.9975
5916196.724008.236321675.701226340.7714010.98740.9127
6018252.126571.436724193.829528949.0439010.98620.9997
611730425074.15122647.929427500.3726010.98480.9848







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.0426-0.100204142054.380500
510.03980.01590.0581127815.14272134934.76161461.1416
520.0383-0.10630.07427052013.89813773961.14041942.6686
530.0442-0.23240.113729191406.382810128322.4513182.5025
540.0505-0.20350.131717498116.581411602281.27713406.2122
550.0451-0.32280.163558138904.238519358385.1044399.8165
560.0467-0.30940.184454310315.137524351517.96594934.7257
570.047-0.26260.194239855690.507126289539.53365127.3326
580.0451-0.3510.211681043144.980132373273.47215689.7516
590.0496-0.32540.22361020099.497535237956.07465936.1567
600.0457-0.31310.231269211362.912838326447.60546190.8358
610.0494-0.30990.237760375246.664640163847.5276337.4954

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0426 & -0.1002 & 0 & 4142054.3805 & 0 & 0 \tabularnewline
51 & 0.0398 & 0.0159 & 0.0581 & 127815.1427 & 2134934.7616 & 1461.1416 \tabularnewline
52 & 0.0383 & -0.1063 & 0.0742 & 7052013.8981 & 3773961.1404 & 1942.6686 \tabularnewline
53 & 0.0442 & -0.2324 & 0.1137 & 29191406.3828 & 10128322.451 & 3182.5025 \tabularnewline
54 & 0.0505 & -0.2035 & 0.1317 & 17498116.5814 & 11602281.2771 & 3406.2122 \tabularnewline
55 & 0.0451 & -0.3228 & 0.1635 & 58138904.2385 & 19358385.104 & 4399.8165 \tabularnewline
56 & 0.0467 & -0.3094 & 0.1844 & 54310315.1375 & 24351517.9659 & 4934.7257 \tabularnewline
57 & 0.047 & -0.2626 & 0.1942 & 39855690.5071 & 26289539.5336 & 5127.3326 \tabularnewline
58 & 0.0451 & -0.351 & 0.2116 & 81043144.9801 & 32373273.4721 & 5689.7516 \tabularnewline
59 & 0.0496 & -0.3254 & 0.223 & 61020099.4975 & 35237956.0746 & 5936.1567 \tabularnewline
60 & 0.0457 & -0.3131 & 0.2312 & 69211362.9128 & 38326447.6054 & 6190.8358 \tabularnewline
61 & 0.0494 & -0.3099 & 0.2377 & 60375246.6646 & 40163847.527 & 6337.4954 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69820&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]50[/C][C]0.0426[/C][C]-0.1002[/C][C]0[/C][C]4142054.3805[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]0.0398[/C][C]0.0159[/C][C]0.0581[/C][C]127815.1427[/C][C]2134934.7616[/C][C]1461.1416[/C][/ROW]
[ROW][C]52[/C][C]0.0383[/C][C]-0.1063[/C][C]0.0742[/C][C]7052013.8981[/C][C]3773961.1404[/C][C]1942.6686[/C][/ROW]
[ROW][C]53[/C][C]0.0442[/C][C]-0.2324[/C][C]0.1137[/C][C]29191406.3828[/C][C]10128322.451[/C][C]3182.5025[/C][/ROW]
[ROW][C]54[/C][C]0.0505[/C][C]-0.2035[/C][C]0.1317[/C][C]17498116.5814[/C][C]11602281.2771[/C][C]3406.2122[/C][/ROW]
[ROW][C]55[/C][C]0.0451[/C][C]-0.3228[/C][C]0.1635[/C][C]58138904.2385[/C][C]19358385.104[/C][C]4399.8165[/C][/ROW]
[ROW][C]56[/C][C]0.0467[/C][C]-0.3094[/C][C]0.1844[/C][C]54310315.1375[/C][C]24351517.9659[/C][C]4934.7257[/C][/ROW]
[ROW][C]57[/C][C]0.047[/C][C]-0.2626[/C][C]0.1942[/C][C]39855690.5071[/C][C]26289539.5336[/C][C]5127.3326[/C][/ROW]
[ROW][C]58[/C][C]0.0451[/C][C]-0.351[/C][C]0.2116[/C][C]81043144.9801[/C][C]32373273.4721[/C][C]5689.7516[/C][/ROW]
[ROW][C]59[/C][C]0.0496[/C][C]-0.3254[/C][C]0.223[/C][C]61020099.4975[/C][C]35237956.0746[/C][C]5936.1567[/C][/ROW]
[ROW][C]60[/C][C]0.0457[/C][C]-0.3131[/C][C]0.2312[/C][C]69211362.9128[/C][C]38326447.6054[/C][C]6190.8358[/C][/ROW]
[ROW][C]61[/C][C]0.0494[/C][C]-0.3099[/C][C]0.2377[/C][C]60375246.6646[/C][C]40163847.527[/C][C]6337.4954[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69820&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69820&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
500.0426-0.100204142054.380500
510.03980.01590.0581127815.14272134934.76161461.1416
520.0383-0.10630.07427052013.89813773961.14041942.6686
530.0442-0.23240.113729191406.382810128322.4513182.5025
540.0505-0.20350.131717498116.581411602281.27713406.2122
550.0451-0.32280.163558138904.238519358385.1044399.8165
560.0467-0.30940.184454310315.137524351517.96594934.7257
570.047-0.26260.194239855690.507126289539.53365127.3326
580.0451-0.3510.211681043144.980132373273.47215689.7516
590.0496-0.32540.22361020099.497535237956.07465936.1567
600.0457-0.31310.231269211362.912838326447.60546190.8358
610.0494-0.30990.237760375246.664640163847.5276337.4954



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