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 06:21:52 -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/t1229954177wtzl51r8dy69a7h.htm/, Retrieved Sun, 12 May 2024 18:36:12 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=36067, Retrieved Sun, 12 May 2024 18:36:12 +0000
QR Codes:

Original text written by user:in samenwerking met katrien bourdiaudhy, stéphanie claes en kevin engels
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact193
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F     [Univariate Data Series] [blog 1e tijdreeks...] [2008-10-13 19:23:31] [7173087adebe3e3a714c80ea2417b3eb]
-   PD  [Univariate Data Series] [tijdreeksen opnie...] [2008-10-19 17:13:12] [7173087adebe3e3a714c80ea2417b3eb]
-   PD    [Univariate Data Series] [tijdreeksen opnie...] [2008-10-19 18:55:20] [7173087adebe3e3a714c80ea2417b3eb]
- RM        [Central Tendency] [central tendency ...] [2008-10-19 19:10:37] [7173087adebe3e3a714c80ea2417b3eb]
- RMP         [ARIMA Backward Selection] [arima backward st...] [2008-12-08 22:03:24] [7173087adebe3e3a714c80ea2417b3eb]
- RMP             [ARIMA Forecasting] [forecast bouwverg...] [2008-12-22 13:21:52] [95d95b0e883740fcbc85e18ec42dcafb] [Current]
Feedback Forum

Post a new message
Dataseries X:
5014
6153
6441
5584
6427
6062
5589
6216
5809
4989
6706
7174
6122
8075
6292
6337
8576
6077
5931
6288
7167
6054
6468
6401
6927
7914
7728
8699
8522
6481
7502
7778
7424
6941
8574
9169
7701
9035
7158
8195
8124
7073
7017
7390
7776
6197
6889
7087
6485
7654
6501
6313
7826
6589
6729
5684
8105
6391
5901
6758




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\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 & 5 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36067&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]5 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36067&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36067&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 time5 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







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])
369169-------
377701-------
389035-------
397158-------
408195-------
418124-------
427073-------
437017-------
447390-------
457776-------
466197-------
476889-------
487087-------
4964856569.14675196.13887942.15460.45220.22990.05310.2299
5076547500.31836028.33888972.29780.41890.91180.02050.709
5165016800.39465272.08148328.70770.35050.13680.32330.3566
5263137012.28975285.69018738.88920.21370.71920.08970.4662
5378267494.39015667.65419321.12610.3610.89750.24970.669
5465896370.13154469.62468270.63850.41070.06660.23430.2299
5567296403.65564402.35728404.9540.3750.4280.2740.2517
5656846678.12794597.34198758.91390.17450.48090.25130.3501
5781056749.21524601.52558896.90490.1080.83450.17440.3789
5863915963.15193746.77588179.5280.35260.02910.41810.1601
5959016765.16074486.79249043.5290.22860.62620.45760.3909
6067586996.26554662.42619330.1050.42070.82120.46960.4696

\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 & 9169 & - & - & - & - & - & - & - \tabularnewline
37 & 7701 & - & - & - & - & - & - & - \tabularnewline
38 & 9035 & - & - & - & - & - & - & - \tabularnewline
39 & 7158 & - & - & - & - & - & - & - \tabularnewline
40 & 8195 & - & - & - & - & - & - & - \tabularnewline
41 & 8124 & - & - & - & - & - & - & - \tabularnewline
42 & 7073 & - & - & - & - & - & - & - \tabularnewline
43 & 7017 & - & - & - & - & - & - & - \tabularnewline
44 & 7390 & - & - & - & - & - & - & - \tabularnewline
45 & 7776 & - & - & - & - & - & - & - \tabularnewline
46 & 6197 & - & - & - & - & - & - & - \tabularnewline
47 & 6889 & - & - & - & - & - & - & - \tabularnewline
48 & 7087 & - & - & - & - & - & - & - \tabularnewline
49 & 6485 & 6569.1467 & 5196.1388 & 7942.1546 & 0.4522 & 0.2299 & 0.0531 & 0.2299 \tabularnewline
50 & 7654 & 7500.3183 & 6028.3388 & 8972.2978 & 0.4189 & 0.9118 & 0.0205 & 0.709 \tabularnewline
51 & 6501 & 6800.3946 & 5272.0814 & 8328.7077 & 0.3505 & 0.1368 & 0.3233 & 0.3566 \tabularnewline
52 & 6313 & 7012.2897 & 5285.6901 & 8738.8892 & 0.2137 & 0.7192 & 0.0897 & 0.4662 \tabularnewline
53 & 7826 & 7494.3901 & 5667.6541 & 9321.1261 & 0.361 & 0.8975 & 0.2497 & 0.669 \tabularnewline
54 & 6589 & 6370.1315 & 4469.6246 & 8270.6385 & 0.4107 & 0.0666 & 0.2343 & 0.2299 \tabularnewline
55 & 6729 & 6403.6556 & 4402.3572 & 8404.954 & 0.375 & 0.428 & 0.274 & 0.2517 \tabularnewline
56 & 5684 & 6678.1279 & 4597.3419 & 8758.9139 & 0.1745 & 0.4809 & 0.2513 & 0.3501 \tabularnewline
57 & 8105 & 6749.2152 & 4601.5255 & 8896.9049 & 0.108 & 0.8345 & 0.1744 & 0.3789 \tabularnewline
58 & 6391 & 5963.1519 & 3746.7758 & 8179.528 & 0.3526 & 0.0291 & 0.4181 & 0.1601 \tabularnewline
59 & 5901 & 6765.1607 & 4486.7924 & 9043.529 & 0.2286 & 0.6262 & 0.4576 & 0.3909 \tabularnewline
60 & 6758 & 6996.2655 & 4662.4261 & 9330.105 & 0.4207 & 0.8212 & 0.4696 & 0.4696 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36067&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]9169[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]7701[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]9035[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]7158[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]8195[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]8124[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]7073[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]7017[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]7390[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]7776[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]6197[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]6889[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]7087[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]6485[/C][C]6569.1467[/C][C]5196.1388[/C][C]7942.1546[/C][C]0.4522[/C][C]0.2299[/C][C]0.0531[/C][C]0.2299[/C][/ROW]
[ROW][C]50[/C][C]7654[/C][C]7500.3183[/C][C]6028.3388[/C][C]8972.2978[/C][C]0.4189[/C][C]0.9118[/C][C]0.0205[/C][C]0.709[/C][/ROW]
[ROW][C]51[/C][C]6501[/C][C]6800.3946[/C][C]5272.0814[/C][C]8328.7077[/C][C]0.3505[/C][C]0.1368[/C][C]0.3233[/C][C]0.3566[/C][/ROW]
[ROW][C]52[/C][C]6313[/C][C]7012.2897[/C][C]5285.6901[/C][C]8738.8892[/C][C]0.2137[/C][C]0.7192[/C][C]0.0897[/C][C]0.4662[/C][/ROW]
[ROW][C]53[/C][C]7826[/C][C]7494.3901[/C][C]5667.6541[/C][C]9321.1261[/C][C]0.361[/C][C]0.8975[/C][C]0.2497[/C][C]0.669[/C][/ROW]
[ROW][C]54[/C][C]6589[/C][C]6370.1315[/C][C]4469.6246[/C][C]8270.6385[/C][C]0.4107[/C][C]0.0666[/C][C]0.2343[/C][C]0.2299[/C][/ROW]
[ROW][C]55[/C][C]6729[/C][C]6403.6556[/C][C]4402.3572[/C][C]8404.954[/C][C]0.375[/C][C]0.428[/C][C]0.274[/C][C]0.2517[/C][/ROW]
[ROW][C]56[/C][C]5684[/C][C]6678.1279[/C][C]4597.3419[/C][C]8758.9139[/C][C]0.1745[/C][C]0.4809[/C][C]0.2513[/C][C]0.3501[/C][/ROW]
[ROW][C]57[/C][C]8105[/C][C]6749.2152[/C][C]4601.5255[/C][C]8896.9049[/C][C]0.108[/C][C]0.8345[/C][C]0.1744[/C][C]0.3789[/C][/ROW]
[ROW][C]58[/C][C]6391[/C][C]5963.1519[/C][C]3746.7758[/C][C]8179.528[/C][C]0.3526[/C][C]0.0291[/C][C]0.4181[/C][C]0.1601[/C][/ROW]
[ROW][C]59[/C][C]5901[/C][C]6765.1607[/C][C]4486.7924[/C][C]9043.529[/C][C]0.2286[/C][C]0.6262[/C][C]0.4576[/C][C]0.3909[/C][/ROW]
[ROW][C]60[/C][C]6758[/C][C]6996.2655[/C][C]4662.4261[/C][C]9330.105[/C][C]0.4207[/C][C]0.8212[/C][C]0.4696[/C][C]0.4696[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36067&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36067&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])
369169-------
377701-------
389035-------
397158-------
408195-------
418124-------
427073-------
437017-------
447390-------
457776-------
466197-------
476889-------
487087-------
4964856569.14675196.13887942.15460.45220.22990.05310.2299
5076547500.31836028.33888972.29780.41890.91180.02050.709
5165016800.39465272.08148328.70770.35050.13680.32330.3566
5263137012.28975285.69018738.88920.21370.71920.08970.4662
5378267494.39015667.65419321.12610.3610.89750.24970.669
5465896370.13154469.62468270.63850.41070.06660.23430.2299
5567296403.65564402.35728404.9540.3750.4280.2740.2517
5656846678.12794597.34198758.91390.17450.48090.25130.3501
5781056749.21524601.52558896.90490.1080.83450.17440.3789
5863915963.15193746.77588179.5280.35260.02910.41810.1601
5959016765.16074486.79249043.5290.22860.62620.45760.3909
6067586996.26554662.42619330.1050.42070.82120.46960.4696







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.1066-0.01280.00117080.6646590.055424.2911
500.10010.02050.001723618.07511968.172944.3641
510.1147-0.0440.003789637.09867469.758286.4278
520.1256-0.09970.0083489006.01940750.5016201.8675
530.12440.04420.0037109965.10619163.758895.7275
540.15220.03440.002947903.39883991.949963.1819
550.15950.05080.0042105848.97718820.748193.9188
560.159-0.14890.0124988290.344482357.5287286.98
570.16240.20090.01671838152.4722153179.3727391.3814
580.18960.07170.006183054.003515254.5003123.5091
590.1718-0.12770.0106746773.735462231.1446249.4617
600.1702-0.03410.002856770.46874730.872468.7813

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.1066 & -0.0128 & 0.0011 & 7080.6646 & 590.0554 & 24.2911 \tabularnewline
50 & 0.1001 & 0.0205 & 0.0017 & 23618.0751 & 1968.1729 & 44.3641 \tabularnewline
51 & 0.1147 & -0.044 & 0.0037 & 89637.0986 & 7469.7582 & 86.4278 \tabularnewline
52 & 0.1256 & -0.0997 & 0.0083 & 489006.019 & 40750.5016 & 201.8675 \tabularnewline
53 & 0.1244 & 0.0442 & 0.0037 & 109965.1061 & 9163.7588 & 95.7275 \tabularnewline
54 & 0.1522 & 0.0344 & 0.0029 & 47903.3988 & 3991.9499 & 63.1819 \tabularnewline
55 & 0.1595 & 0.0508 & 0.0042 & 105848.9771 & 8820.7481 & 93.9188 \tabularnewline
56 & 0.159 & -0.1489 & 0.0124 & 988290.3444 & 82357.5287 & 286.98 \tabularnewline
57 & 0.1624 & 0.2009 & 0.0167 & 1838152.4722 & 153179.3727 & 391.3814 \tabularnewline
58 & 0.1896 & 0.0717 & 0.006 & 183054.0035 & 15254.5003 & 123.5091 \tabularnewline
59 & 0.1718 & -0.1277 & 0.0106 & 746773.7354 & 62231.1446 & 249.4617 \tabularnewline
60 & 0.1702 & -0.0341 & 0.0028 & 56770.4687 & 4730.8724 & 68.7813 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36067&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.1066[/C][C]-0.0128[/C][C]0.0011[/C][C]7080.6646[/C][C]590.0554[/C][C]24.2911[/C][/ROW]
[ROW][C]50[/C][C]0.1001[/C][C]0.0205[/C][C]0.0017[/C][C]23618.0751[/C][C]1968.1729[/C][C]44.3641[/C][/ROW]
[ROW][C]51[/C][C]0.1147[/C][C]-0.044[/C][C]0.0037[/C][C]89637.0986[/C][C]7469.7582[/C][C]86.4278[/C][/ROW]
[ROW][C]52[/C][C]0.1256[/C][C]-0.0997[/C][C]0.0083[/C][C]489006.019[/C][C]40750.5016[/C][C]201.8675[/C][/ROW]
[ROW][C]53[/C][C]0.1244[/C][C]0.0442[/C][C]0.0037[/C][C]109965.1061[/C][C]9163.7588[/C][C]95.7275[/C][/ROW]
[ROW][C]54[/C][C]0.1522[/C][C]0.0344[/C][C]0.0029[/C][C]47903.3988[/C][C]3991.9499[/C][C]63.1819[/C][/ROW]
[ROW][C]55[/C][C]0.1595[/C][C]0.0508[/C][C]0.0042[/C][C]105848.9771[/C][C]8820.7481[/C][C]93.9188[/C][/ROW]
[ROW][C]56[/C][C]0.159[/C][C]-0.1489[/C][C]0.0124[/C][C]988290.3444[/C][C]82357.5287[/C][C]286.98[/C][/ROW]
[ROW][C]57[/C][C]0.1624[/C][C]0.2009[/C][C]0.0167[/C][C]1838152.4722[/C][C]153179.3727[/C][C]391.3814[/C][/ROW]
[ROW][C]58[/C][C]0.1896[/C][C]0.0717[/C][C]0.006[/C][C]183054.0035[/C][C]15254.5003[/C][C]123.5091[/C][/ROW]
[ROW][C]59[/C][C]0.1718[/C][C]-0.1277[/C][C]0.0106[/C][C]746773.7354[/C][C]62231.1446[/C][C]249.4617[/C][/ROW]
[ROW][C]60[/C][C]0.1702[/C][C]-0.0341[/C][C]0.0028[/C][C]56770.4687[/C][C]4730.8724[/C][C]68.7813[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36067&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36067&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.1066-0.01280.00117080.6646590.055424.2911
500.10010.02050.001723618.07511968.172944.3641
510.1147-0.0440.003789637.09867469.758286.4278
520.1256-0.09970.0083489006.01940750.5016201.8675
530.12440.04420.0037109965.10619163.758895.7275
540.15220.03440.002947903.39883991.949963.1819
550.15950.05080.0042105848.97718820.748193.9188
560.159-0.14890.0124988290.344482357.5287286.98
570.16240.20090.01671838152.4722153179.3727391.3814
580.18960.07170.006183054.003515254.5003123.5091
590.1718-0.12770.0106746773.735462231.1446249.4617
600.1702-0.03410.002856770.46874730.872468.7813



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