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, 17 Dec 2008 14:12:00 -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/17/t1229548363mzojulenscoxmzi.htm/, Retrieved Sun, 19 May 2024 04:22:41 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=34560, Retrieved Sun, 19 May 2024 04:22:41 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact283
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Pearson Correlation] [Correlation: inve...] [2008-12-16 19:18:46] [5161246d1ccc1b670cc664d03050f084]
- RMPD  [Univariate Data Series] [] [2008-12-17 14:56:45] [b98453cac15ba1066b407e146608df68]
- RMP     [ARIMA Backward Selection] [] [2008-12-17 19:26:06] [b98453cac15ba1066b407e146608df68]
- RMP         [ARIMA Forecasting] [] [2008-12-17 21:12:00] [d76b387543b13b5e3afd8ff9e5fdc89f] [Current]
Feedback Forum

Post a new message
Dataseries X:
1721
1476
1842
2171
1670
1540
1266
897
1266
1519
1074
1435
1385
1440
1883
1822
1661
1774
1133
1361
1688
2216
2896
1382
1330
1419
1662
2040
2126
1649
1610
1952
2102
1749
2091
3036
2414
2097
2705
2431
4192
3990
2854
1966
2431
2763
2831
2023
2934
2489
3252
3018
3193
3976
2584
2512
2169
2504
1843
1408
2179
3690
2372
2494
3872
2786
2312
1599
3167
3433
2648
1978
1947
3113
2856
3174
3507
4174
2978
4428
2832
2930
3681
3253
1660
2208
3139
3409
3445
2410
3262
2897
2526
3982
4097
3403
3362
2708
3129
3550
2696
2885
2945
3600
3808
3671
4005




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34560&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[95])
833681-------
843253-------
851660-------
862208-------
873139-------
883409-------
893445-------
902410-------
913262-------
922897-------
932526-------
943982-------
954097-------
9634033490.99332154.91975655.44710.46820.29160.58530.2916
9733623298.04591927.8785642.00990.47870.4650.91460.252
9827083232.10921851.88055641.03870.33490.45790.79760.2408
9931293209.00721816.47995669.05630.47460.65510.52220.2396
10035503200.84121794.27525710.04050.39250.52240.43540.242
10126963197.94561776.7755755.85320.35030.39370.42490.2454
10228853196.91781761.1235803.27620.40730.64680.7230.2492
10329453196.55281746.32415851.11860.42630.5910.48070.2531
10436003196.42311732.02265898.95340.38490.57230.5860.2568
10538083196.37711718.08575946.63360.33150.38680.68360.2605
10636713196.36071704.45915994.11380.36980.33410.2910.264
10740053196.35491691.11646041.38470.28870.37180.26750.2675

\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[95]) \tabularnewline
83 & 3681 & - & - & - & - & - & - & - \tabularnewline
84 & 3253 & - & - & - & - & - & - & - \tabularnewline
85 & 1660 & - & - & - & - & - & - & - \tabularnewline
86 & 2208 & - & - & - & - & - & - & - \tabularnewline
87 & 3139 & - & - & - & - & - & - & - \tabularnewline
88 & 3409 & - & - & - & - & - & - & - \tabularnewline
89 & 3445 & - & - & - & - & - & - & - \tabularnewline
90 & 2410 & - & - & - & - & - & - & - \tabularnewline
91 & 3262 & - & - & - & - & - & - & - \tabularnewline
92 & 2897 & - & - & - & - & - & - & - \tabularnewline
93 & 2526 & - & - & - & - & - & - & - \tabularnewline
94 & 3982 & - & - & - & - & - & - & - \tabularnewline
95 & 4097 & - & - & - & - & - & - & - \tabularnewline
96 & 3403 & 3490.9933 & 2154.9197 & 5655.4471 & 0.4682 & 0.2916 & 0.5853 & 0.2916 \tabularnewline
97 & 3362 & 3298.0459 & 1927.878 & 5642.0099 & 0.4787 & 0.465 & 0.9146 & 0.252 \tabularnewline
98 & 2708 & 3232.1092 & 1851.8805 & 5641.0387 & 0.3349 & 0.4579 & 0.7976 & 0.2408 \tabularnewline
99 & 3129 & 3209.0072 & 1816.4799 & 5669.0563 & 0.4746 & 0.6551 & 0.5222 & 0.2396 \tabularnewline
100 & 3550 & 3200.8412 & 1794.2752 & 5710.0405 & 0.3925 & 0.5224 & 0.4354 & 0.242 \tabularnewline
101 & 2696 & 3197.9456 & 1776.775 & 5755.8532 & 0.3503 & 0.3937 & 0.4249 & 0.2454 \tabularnewline
102 & 2885 & 3196.9178 & 1761.123 & 5803.2762 & 0.4073 & 0.6468 & 0.723 & 0.2492 \tabularnewline
103 & 2945 & 3196.5528 & 1746.3241 & 5851.1186 & 0.4263 & 0.591 & 0.4807 & 0.2531 \tabularnewline
104 & 3600 & 3196.4231 & 1732.0226 & 5898.9534 & 0.3849 & 0.5723 & 0.586 & 0.2568 \tabularnewline
105 & 3808 & 3196.3771 & 1718.0857 & 5946.6336 & 0.3315 & 0.3868 & 0.6836 & 0.2605 \tabularnewline
106 & 3671 & 3196.3607 & 1704.4591 & 5994.1138 & 0.3698 & 0.3341 & 0.291 & 0.264 \tabularnewline
107 & 4005 & 3196.3549 & 1691.1164 & 6041.3847 & 0.2887 & 0.3718 & 0.2675 & 0.2675 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34560&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[95])[/C][/ROW]
[ROW][C]83[/C][C]3681[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]84[/C][C]3253[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]1660[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]2208[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]3139[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]3409[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]3445[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]2410[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]3262[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]2897[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]2526[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]3982[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]4097[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]3403[/C][C]3490.9933[/C][C]2154.9197[/C][C]5655.4471[/C][C]0.4682[/C][C]0.2916[/C][C]0.5853[/C][C]0.2916[/C][/ROW]
[ROW][C]97[/C][C]3362[/C][C]3298.0459[/C][C]1927.878[/C][C]5642.0099[/C][C]0.4787[/C][C]0.465[/C][C]0.9146[/C][C]0.252[/C][/ROW]
[ROW][C]98[/C][C]2708[/C][C]3232.1092[/C][C]1851.8805[/C][C]5641.0387[/C][C]0.3349[/C][C]0.4579[/C][C]0.7976[/C][C]0.2408[/C][/ROW]
[ROW][C]99[/C][C]3129[/C][C]3209.0072[/C][C]1816.4799[/C][C]5669.0563[/C][C]0.4746[/C][C]0.6551[/C][C]0.5222[/C][C]0.2396[/C][/ROW]
[ROW][C]100[/C][C]3550[/C][C]3200.8412[/C][C]1794.2752[/C][C]5710.0405[/C][C]0.3925[/C][C]0.5224[/C][C]0.4354[/C][C]0.242[/C][/ROW]
[ROW][C]101[/C][C]2696[/C][C]3197.9456[/C][C]1776.775[/C][C]5755.8532[/C][C]0.3503[/C][C]0.3937[/C][C]0.4249[/C][C]0.2454[/C][/ROW]
[ROW][C]102[/C][C]2885[/C][C]3196.9178[/C][C]1761.123[/C][C]5803.2762[/C][C]0.4073[/C][C]0.6468[/C][C]0.723[/C][C]0.2492[/C][/ROW]
[ROW][C]103[/C][C]2945[/C][C]3196.5528[/C][C]1746.3241[/C][C]5851.1186[/C][C]0.4263[/C][C]0.591[/C][C]0.4807[/C][C]0.2531[/C][/ROW]
[ROW][C]104[/C][C]3600[/C][C]3196.4231[/C][C]1732.0226[/C][C]5898.9534[/C][C]0.3849[/C][C]0.5723[/C][C]0.586[/C][C]0.2568[/C][/ROW]
[ROW][C]105[/C][C]3808[/C][C]3196.3771[/C][C]1718.0857[/C][C]5946.6336[/C][C]0.3315[/C][C]0.3868[/C][C]0.6836[/C][C]0.2605[/C][/ROW]
[ROW][C]106[/C][C]3671[/C][C]3196.3607[/C][C]1704.4591[/C][C]5994.1138[/C][C]0.3698[/C][C]0.3341[/C][C]0.291[/C][C]0.264[/C][/ROW]
[ROW][C]107[/C][C]4005[/C][C]3196.3549[/C][C]1691.1164[/C][C]6041.3847[/C][C]0.2887[/C][C]0.3718[/C][C]0.2675[/C][C]0.2675[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34560&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34560&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[95])
833681-------
843253-------
851660-------
862208-------
873139-------
883409-------
893445-------
902410-------
913262-------
922897-------
932526-------
943982-------
954097-------
9634033490.99332154.91975655.44710.46820.29160.58530.2916
9733623298.04591927.8785642.00990.47870.4650.91460.252
9827083232.10921851.88055641.03870.33490.45790.79760.2408
9931293209.00721816.47995669.05630.47460.65510.52220.2396
10035503200.84121794.27525710.04050.39250.52240.43540.242
10126963197.94561776.7755755.85320.35030.39370.42490.2454
10228853196.91781761.1235803.27620.40730.64680.7230.2492
10329453196.55281746.32415851.11860.42630.5910.48070.2531
10436003196.42311732.02265898.95340.38490.57230.5860.2568
10538083196.37711718.08575946.63360.33150.38680.68360.2605
10636713196.36071704.45915994.11380.36980.33410.2910.264
10740053196.35491691.11646041.38470.28870.37180.26750.2675







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
960.3163-0.02520.00217742.8252645.235425.4015
970.36260.01940.00164090.1252340.843818.462
980.3803-0.16220.0135274690.409122890.8674151.2973
990.3911-0.02490.00216401.1472533.428923.0961
1000.40.10910.0091121911.881710159.3235100.7935
1010.4081-0.1570.0131251949.421420995.7851144.8992
1020.416-0.09760.008197292.69748107.724890.0429
1030.4237-0.07870.006663278.78985273.232572.617
1040.43140.12630.0105162874.302513572.8585116.5026
1050.4390.19130.0159374082.612531173.551176.5603
1060.44660.14850.0124225282.454918773.5379137.0166
1070.45410.2530.0211653906.895854492.2413233.4357

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
96 & 0.3163 & -0.0252 & 0.0021 & 7742.8252 & 645.2354 & 25.4015 \tabularnewline
97 & 0.3626 & 0.0194 & 0.0016 & 4090.1252 & 340.8438 & 18.462 \tabularnewline
98 & 0.3803 & -0.1622 & 0.0135 & 274690.4091 & 22890.8674 & 151.2973 \tabularnewline
99 & 0.3911 & -0.0249 & 0.0021 & 6401.1472 & 533.4289 & 23.0961 \tabularnewline
100 & 0.4 & 0.1091 & 0.0091 & 121911.8817 & 10159.3235 & 100.7935 \tabularnewline
101 & 0.4081 & -0.157 & 0.0131 & 251949.4214 & 20995.7851 & 144.8992 \tabularnewline
102 & 0.416 & -0.0976 & 0.0081 & 97292.6974 & 8107.7248 & 90.0429 \tabularnewline
103 & 0.4237 & -0.0787 & 0.0066 & 63278.7898 & 5273.2325 & 72.617 \tabularnewline
104 & 0.4314 & 0.1263 & 0.0105 & 162874.3025 & 13572.8585 & 116.5026 \tabularnewline
105 & 0.439 & 0.1913 & 0.0159 & 374082.6125 & 31173.551 & 176.5603 \tabularnewline
106 & 0.4466 & 0.1485 & 0.0124 & 225282.4549 & 18773.5379 & 137.0166 \tabularnewline
107 & 0.4541 & 0.253 & 0.0211 & 653906.8958 & 54492.2413 & 233.4357 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34560&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]96[/C][C]0.3163[/C][C]-0.0252[/C][C]0.0021[/C][C]7742.8252[/C][C]645.2354[/C][C]25.4015[/C][/ROW]
[ROW][C]97[/C][C]0.3626[/C][C]0.0194[/C][C]0.0016[/C][C]4090.1252[/C][C]340.8438[/C][C]18.462[/C][/ROW]
[ROW][C]98[/C][C]0.3803[/C][C]-0.1622[/C][C]0.0135[/C][C]274690.4091[/C][C]22890.8674[/C][C]151.2973[/C][/ROW]
[ROW][C]99[/C][C]0.3911[/C][C]-0.0249[/C][C]0.0021[/C][C]6401.1472[/C][C]533.4289[/C][C]23.0961[/C][/ROW]
[ROW][C]100[/C][C]0.4[/C][C]0.1091[/C][C]0.0091[/C][C]121911.8817[/C][C]10159.3235[/C][C]100.7935[/C][/ROW]
[ROW][C]101[/C][C]0.4081[/C][C]-0.157[/C][C]0.0131[/C][C]251949.4214[/C][C]20995.7851[/C][C]144.8992[/C][/ROW]
[ROW][C]102[/C][C]0.416[/C][C]-0.0976[/C][C]0.0081[/C][C]97292.6974[/C][C]8107.7248[/C][C]90.0429[/C][/ROW]
[ROW][C]103[/C][C]0.4237[/C][C]-0.0787[/C][C]0.0066[/C][C]63278.7898[/C][C]5273.2325[/C][C]72.617[/C][/ROW]
[ROW][C]104[/C][C]0.4314[/C][C]0.1263[/C][C]0.0105[/C][C]162874.3025[/C][C]13572.8585[/C][C]116.5026[/C][/ROW]
[ROW][C]105[/C][C]0.439[/C][C]0.1913[/C][C]0.0159[/C][C]374082.6125[/C][C]31173.551[/C][C]176.5603[/C][/ROW]
[ROW][C]106[/C][C]0.4466[/C][C]0.1485[/C][C]0.0124[/C][C]225282.4549[/C][C]18773.5379[/C][C]137.0166[/C][/ROW]
[ROW][C]107[/C][C]0.4541[/C][C]0.253[/C][C]0.0211[/C][C]653906.8958[/C][C]54492.2413[/C][C]233.4357[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34560&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34560&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
960.3163-0.02520.00217742.8252645.235425.4015
970.36260.01940.00164090.1252340.843818.462
980.3803-0.16220.0135274690.409122890.8674151.2973
990.3911-0.02490.00216401.1472533.428923.0961
1000.40.10910.0091121911.881710159.3235100.7935
1010.4081-0.1570.0131251949.421420995.7851144.8992
1020.416-0.09760.008197292.69748107.724890.0429
1030.4237-0.07870.006663278.78985273.232572.617
1040.43140.12630.0105162874.302513572.8585116.5026
1050.4390.19130.0159374082.612531173.551176.5603
1060.44660.14850.0124225282.454918773.5379137.0166
1070.45410.2530.0211653906.895854492.2413233.4357



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