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 computationMon, 22 Dec 2008 12:57:49 -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/22/t1229976266ql6goucygywy0uw.htm/, Retrieved Sun, 12 May 2024 17:09:45 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=36196, Retrieved Sun, 12 May 2024 17:09:45 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact160
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F     [Univariate Explorative Data Analysis] [Investigation Dis...] [2007-10-21 17:06:37] [b9964c45117f7aac638ab9056d451faa]
F    D  [Univariate Explorative Data Analysis] [Reproduce Q2] [2008-10-24 13:27:07] [deb3c14ac9e4607a6d84fc9d0e0e6cc2]
- RMPD    [(Partial) Autocorrelation Function] [Paper H5 Mannen (...] [2008-12-13 14:12:34] [deb3c14ac9e4607a6d84fc9d0e0e6cc2]
- RMP       [ARIMA Backward Selection] [Paper H6 Mannen A...] [2008-12-13 16:00:00] [deb3c14ac9e4607a6d84fc9d0e0e6cc2]
- RMP           [ARIMA Forecasting] [Paper H6 Mannen A...] [2008-12-22 19:57:49] [5e9e099b83e50415d7642e10d74756e4] [Current]
Feedback Forum

Post a new message
Dataseries X:
269645
267037
258113
262813
267413
267366
264777
258863
254844
254868
277267
285351
286602
283042
276687
277915
277128
277103
275037
270150
267140
264993
287259
291186
292300
288186
281477
282656
280190
280408
276836
275216
274352
271311
289802
290726
292300
278506
269826
265861
269034
264176
255198
253353
246057
235372
258556
260993
254663
250643
243422
247105
248541
245039
237080
237085
225554
226839
247934
248333
246969
245098
246263




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36196&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]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36196&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36196&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'George Udny Yule' @ 72.249.76.132







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[51])
39269826-------
40265861-------
41269034-------
42264176-------
43255198-------
44253353-------
45246057-------
46235372-------
47258556-------
48260993-------
49254663-------
50250643-------
51243422-------
52247105241292.2225233771.3728248813.07210.06490.289400.2894
53248541242948.0474232311.9598253584.13510.15140.221800.4652
54245039239754.9589226728.4651252781.45260.21330.09311e-040.2906
55237080232727.8414217686.142247769.54070.28530.05430.00170.0817
56237085230564.3416213747.2104247381.47270.22360.22380.0040.067
57225554225143.2743206721.0302243565.51850.48260.1020.0130.0259
58226839217177.0254197278.7275237075.32330.17060.20460.03650.0049
59247934239216.2803217944.1051260488.45550.21090.87290.03740.3492
60248333241616.8236219054.2747264179.37260.27980.29160.04620.4377
61246969237876.0009214092.9861261659.01580.22680.19440.08330.3238
62245098231701.7862206758.0878256645.48460.14630.11510.06830.1785
63246263224197.8116198145.0884250250.53470.04850.05790.07410.0741

\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[51]) \tabularnewline
39 & 269826 & - & - & - & - & - & - & - \tabularnewline
40 & 265861 & - & - & - & - & - & - & - \tabularnewline
41 & 269034 & - & - & - & - & - & - & - \tabularnewline
42 & 264176 & - & - & - & - & - & - & - \tabularnewline
43 & 255198 & - & - & - & - & - & - & - \tabularnewline
44 & 253353 & - & - & - & - & - & - & - \tabularnewline
45 & 246057 & - & - & - & - & - & - & - \tabularnewline
46 & 235372 & - & - & - & - & - & - & - \tabularnewline
47 & 258556 & - & - & - & - & - & - & - \tabularnewline
48 & 260993 & - & - & - & - & - & - & - \tabularnewline
49 & 254663 & - & - & - & - & - & - & - \tabularnewline
50 & 250643 & - & - & - & - & - & - & - \tabularnewline
51 & 243422 & - & - & - & - & - & - & - \tabularnewline
52 & 247105 & 241292.2225 & 233771.3728 & 248813.0721 & 0.0649 & 0.2894 & 0 & 0.2894 \tabularnewline
53 & 248541 & 242948.0474 & 232311.9598 & 253584.1351 & 0.1514 & 0.2218 & 0 & 0.4652 \tabularnewline
54 & 245039 & 239754.9589 & 226728.4651 & 252781.4526 & 0.2133 & 0.0931 & 1e-04 & 0.2906 \tabularnewline
55 & 237080 & 232727.8414 & 217686.142 & 247769.5407 & 0.2853 & 0.0543 & 0.0017 & 0.0817 \tabularnewline
56 & 237085 & 230564.3416 & 213747.2104 & 247381.4727 & 0.2236 & 0.2238 & 0.004 & 0.067 \tabularnewline
57 & 225554 & 225143.2743 & 206721.0302 & 243565.5185 & 0.4826 & 0.102 & 0.013 & 0.0259 \tabularnewline
58 & 226839 & 217177.0254 & 197278.7275 & 237075.3233 & 0.1706 & 0.2046 & 0.0365 & 0.0049 \tabularnewline
59 & 247934 & 239216.2803 & 217944.1051 & 260488.4555 & 0.2109 & 0.8729 & 0.0374 & 0.3492 \tabularnewline
60 & 248333 & 241616.8236 & 219054.2747 & 264179.3726 & 0.2798 & 0.2916 & 0.0462 & 0.4377 \tabularnewline
61 & 246969 & 237876.0009 & 214092.9861 & 261659.0158 & 0.2268 & 0.1944 & 0.0833 & 0.3238 \tabularnewline
62 & 245098 & 231701.7862 & 206758.0878 & 256645.4846 & 0.1463 & 0.1151 & 0.0683 & 0.1785 \tabularnewline
63 & 246263 & 224197.8116 & 198145.0884 & 250250.5347 & 0.0485 & 0.0579 & 0.0741 & 0.0741 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36196&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[51])[/C][/ROW]
[ROW][C]39[/C][C]269826[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]265861[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]269034[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]264176[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]255198[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]253353[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]246057[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]235372[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]258556[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]260993[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]254663[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]250643[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]243422[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]247105[/C][C]241292.2225[/C][C]233771.3728[/C][C]248813.0721[/C][C]0.0649[/C][C]0.2894[/C][C]0[/C][C]0.2894[/C][/ROW]
[ROW][C]53[/C][C]248541[/C][C]242948.0474[/C][C]232311.9598[/C][C]253584.1351[/C][C]0.1514[/C][C]0.2218[/C][C]0[/C][C]0.4652[/C][/ROW]
[ROW][C]54[/C][C]245039[/C][C]239754.9589[/C][C]226728.4651[/C][C]252781.4526[/C][C]0.2133[/C][C]0.0931[/C][C]1e-04[/C][C]0.2906[/C][/ROW]
[ROW][C]55[/C][C]237080[/C][C]232727.8414[/C][C]217686.142[/C][C]247769.5407[/C][C]0.2853[/C][C]0.0543[/C][C]0.0017[/C][C]0.0817[/C][/ROW]
[ROW][C]56[/C][C]237085[/C][C]230564.3416[/C][C]213747.2104[/C][C]247381.4727[/C][C]0.2236[/C][C]0.2238[/C][C]0.004[/C][C]0.067[/C][/ROW]
[ROW][C]57[/C][C]225554[/C][C]225143.2743[/C][C]206721.0302[/C][C]243565.5185[/C][C]0.4826[/C][C]0.102[/C][C]0.013[/C][C]0.0259[/C][/ROW]
[ROW][C]58[/C][C]226839[/C][C]217177.0254[/C][C]197278.7275[/C][C]237075.3233[/C][C]0.1706[/C][C]0.2046[/C][C]0.0365[/C][C]0.0049[/C][/ROW]
[ROW][C]59[/C][C]247934[/C][C]239216.2803[/C][C]217944.1051[/C][C]260488.4555[/C][C]0.2109[/C][C]0.8729[/C][C]0.0374[/C][C]0.3492[/C][/ROW]
[ROW][C]60[/C][C]248333[/C][C]241616.8236[/C][C]219054.2747[/C][C]264179.3726[/C][C]0.2798[/C][C]0.2916[/C][C]0.0462[/C][C]0.4377[/C][/ROW]
[ROW][C]61[/C][C]246969[/C][C]237876.0009[/C][C]214092.9861[/C][C]261659.0158[/C][C]0.2268[/C][C]0.1944[/C][C]0.0833[/C][C]0.3238[/C][/ROW]
[ROW][C]62[/C][C]245098[/C][C]231701.7862[/C][C]206758.0878[/C][C]256645.4846[/C][C]0.1463[/C][C]0.1151[/C][C]0.0683[/C][C]0.1785[/C][/ROW]
[ROW][C]63[/C][C]246263[/C][C]224197.8116[/C][C]198145.0884[/C][C]250250.5347[/C][C]0.0485[/C][C]0.0579[/C][C]0.0741[/C][C]0.0741[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36196&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36196&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[51])
39269826-------
40265861-------
41269034-------
42264176-------
43255198-------
44253353-------
45246057-------
46235372-------
47258556-------
48260993-------
49254663-------
50250643-------
51243422-------
52247105241292.2225233771.3728248813.07210.06490.289400.2894
53248541242948.0474232311.9598253584.13510.15140.221800.4652
54245039239754.9589226728.4651252781.45260.21330.09311e-040.2906
55237080232727.8414217686.142247769.54070.28530.05430.00170.0817
56237085230564.3416213747.2104247381.47270.22360.22380.0040.067
57225554225143.2743206721.0302243565.51850.48260.1020.0130.0259
58226839217177.0254197278.7275237075.32330.17060.20460.03650.0049
59247934239216.2803217944.1051260488.45550.21090.87290.03740.3492
60248333241616.8236219054.2747264179.37260.27980.29160.04620.4377
61246969237876.0009214092.9861261659.01580.22680.19440.08330.3238
62245098231701.7862206758.0878256645.48460.14630.11510.06830.1785
63246263224197.8116198145.0884250250.53470.04850.05790.07410.0741







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
520.01590.02410.00233788382.8352815698.56961678.0043
530.02230.0230.001931281118.46252606759.87191614.5463
540.02770.0220.001827921090.65892326757.55491525.3713
550.0330.01870.001618941284.74981578440.39581256.36
560.03720.02830.002442518986.57273543248.88111882.352
570.04170.00182e-04168695.579314057.9649118.5663
580.04670.04450.003793353753.15697779479.42972789.1718
590.04540.03640.00375998637.07936333219.75662516.5889
600.04760.02780.002345107024.9423758918.74521938.7931
610.0510.03820.003282682632.48926890219.37412624.9227
620.05490.05780.0048179458544.791714954878.73263867.1538
630.05930.09840.0082486872540.276340572711.68976369.6712

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
52 & 0.0159 & 0.0241 & 0.002 & 33788382.835 & 2815698.5696 & 1678.0043 \tabularnewline
53 & 0.0223 & 0.023 & 0.0019 & 31281118.4625 & 2606759.8719 & 1614.5463 \tabularnewline
54 & 0.0277 & 0.022 & 0.0018 & 27921090.6589 & 2326757.5549 & 1525.3713 \tabularnewline
55 & 0.033 & 0.0187 & 0.0016 & 18941284.7498 & 1578440.3958 & 1256.36 \tabularnewline
56 & 0.0372 & 0.0283 & 0.0024 & 42518986.5727 & 3543248.8811 & 1882.352 \tabularnewline
57 & 0.0417 & 0.0018 & 2e-04 & 168695.5793 & 14057.9649 & 118.5663 \tabularnewline
58 & 0.0467 & 0.0445 & 0.0037 & 93353753.1569 & 7779479.4297 & 2789.1718 \tabularnewline
59 & 0.0454 & 0.0364 & 0.003 & 75998637.0793 & 6333219.7566 & 2516.5889 \tabularnewline
60 & 0.0476 & 0.0278 & 0.0023 & 45107024.942 & 3758918.7452 & 1938.7931 \tabularnewline
61 & 0.051 & 0.0382 & 0.0032 & 82682632.4892 & 6890219.3741 & 2624.9227 \tabularnewline
62 & 0.0549 & 0.0578 & 0.0048 & 179458544.7917 & 14954878.7326 & 3867.1538 \tabularnewline
63 & 0.0593 & 0.0984 & 0.0082 & 486872540.2763 & 40572711.6897 & 6369.6712 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36196&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]52[/C][C]0.0159[/C][C]0.0241[/C][C]0.002[/C][C]33788382.835[/C][C]2815698.5696[/C][C]1678.0043[/C][/ROW]
[ROW][C]53[/C][C]0.0223[/C][C]0.023[/C][C]0.0019[/C][C]31281118.4625[/C][C]2606759.8719[/C][C]1614.5463[/C][/ROW]
[ROW][C]54[/C][C]0.0277[/C][C]0.022[/C][C]0.0018[/C][C]27921090.6589[/C][C]2326757.5549[/C][C]1525.3713[/C][/ROW]
[ROW][C]55[/C][C]0.033[/C][C]0.0187[/C][C]0.0016[/C][C]18941284.7498[/C][C]1578440.3958[/C][C]1256.36[/C][/ROW]
[ROW][C]56[/C][C]0.0372[/C][C]0.0283[/C][C]0.0024[/C][C]42518986.5727[/C][C]3543248.8811[/C][C]1882.352[/C][/ROW]
[ROW][C]57[/C][C]0.0417[/C][C]0.0018[/C][C]2e-04[/C][C]168695.5793[/C][C]14057.9649[/C][C]118.5663[/C][/ROW]
[ROW][C]58[/C][C]0.0467[/C][C]0.0445[/C][C]0.0037[/C][C]93353753.1569[/C][C]7779479.4297[/C][C]2789.1718[/C][/ROW]
[ROW][C]59[/C][C]0.0454[/C][C]0.0364[/C][C]0.003[/C][C]75998637.0793[/C][C]6333219.7566[/C][C]2516.5889[/C][/ROW]
[ROW][C]60[/C][C]0.0476[/C][C]0.0278[/C][C]0.0023[/C][C]45107024.942[/C][C]3758918.7452[/C][C]1938.7931[/C][/ROW]
[ROW][C]61[/C][C]0.051[/C][C]0.0382[/C][C]0.0032[/C][C]82682632.4892[/C][C]6890219.3741[/C][C]2624.9227[/C][/ROW]
[ROW][C]62[/C][C]0.0549[/C][C]0.0578[/C][C]0.0048[/C][C]179458544.7917[/C][C]14954878.7326[/C][C]3867.1538[/C][/ROW]
[ROW][C]63[/C][C]0.0593[/C][C]0.0984[/C][C]0.0082[/C][C]486872540.2763[/C][C]40572711.6897[/C][C]6369.6712[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36196&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36196&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
520.01590.02410.00233788382.8352815698.56961678.0043
530.02230.0230.001931281118.46252606759.87191614.5463
540.02770.0220.001827921090.65892326757.55491525.3713
550.0330.01870.001618941284.74981578440.39581256.36
560.03720.02830.002442518986.57273543248.88111882.352
570.04170.00182e-04168695.579314057.9649118.5663
580.04670.04450.003793353753.15697779479.42972789.1718
590.04540.03640.00375998637.07936333219.75662516.5889
600.04760.02780.002345107024.9423758918.74521938.7931
610.0510.03820.003282682632.48926890219.37412624.9227
620.05490.05780.0048179458544.791714954878.73263867.1538
630.05930.09840.0082486872540.276340572711.68976369.6712



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