Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 16 Dec 2008 13:23:56 -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/16/t1229459075wgbluqmdvqysq8c.htm/, Retrieved Sun, 19 May 2024 11:12:24 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=34178, Retrieved Sun, 19 May 2024 11:12:24 +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       [ARIMA Forecasting] [ARIMA forecasting] [2008-12-16 20:23:56] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum
2008-12-17 15:02:20 [Dave Bellekens] [reply
Stap 1: duidelijke en zeer volledige beschrijving. Je had nog kunnen vermelden dat de voorspelde waarde van periode 56 een p-waarde heeft van 0.0288. Deze waarde is kleiner dan de alpha fout van 5% en wijst er dus op de voorspelde waarde significant verschild van de werkelijke waarde.

Stap 2: we zien inderdaad dat de voorspelling ook de stijgende lijn volgt van de werkelijke waarden. Dit konden we ook afleiden uit de tabel in kolom 'P(F[t]>Y[t-1])'. Deze geeft de kans weer dat de waarde hoger ligt dan de waarde van de vorige periode.

Stap 3: duidelijke interpretatie van de %S.E. en de PE. We weten inderdaad dat de interpretatie moet gebeuren onder de assumptie 'Ceteris Paribus' en aangezien de waarde voor de 8ste maand zo verschilt kunnen we aannemen dat in die periode die assumptie mogelijk niet voldaan werd en er wél een gebeurtenis plaatsvond die invloed had op de reeks.

Stap 4: prima uitleg, niet aan toe te voegen.

Stap 5: we zien inderdaad dat de voorspelling mooi binnen de stippellijn blijft die het 95% betrouwbaarheidsinterval aanduidt en dus kunnen we besluiten dat dit een vrij goed voorspellingsmodel is.

Post a new message
Dataseries X:
101.2
100.5
98
106.6
90.1
96.9
125.9
112
100
123.9
79.8
83.4
113.6
112.9
104
109.9
99
106.3
128.9
111.1
102.9
130
87
87.5
117.6
103.4
110.8
112.6
102.5
112.4
135.6
105.1
127.7
137
91
90.5
122.4
123.3
124.3
120
118.1
119
142.7
123.6
129.6
151.6
110.4
99.2
130.5
136.2
129.7
128
121.6
135.8
143.8
147.5
136.2
156.6
123.3
100.4




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34178&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[48])
3690.5-------
37122.4-------
38123.3-------
39124.3-------
40120-------
41118.1-------
42119-------
43142.7-------
44123.6-------
45129.6-------
46151.6-------
47110.4-------
4899.2-------
49130.5132.8294119.3672146.29160.367310.93551
50136.2133.6529120.0398147.2660.35690.67510.9321
51129.7134.577120.8168148.33720.24360.40860.92841
52128130.2016116.298144.10520.37810.52820.92481
53121.6128.2268114.1833142.27020.17750.51260.92121
54135.8129.0525114.8726143.23240.17550.84850.91771
55143.8152.6788138.3657166.99190.1120.98960.91411
56147.5133.5056119.0624147.94870.02880.08120.91061
57136.2139.4329124.8628154.00310.33180.13890.9071
58156.6161.3608146.6666176.0550.26270.99960.90351
59123.3120.0892105.2737134.90470.335500.90.9971
60100.4108.818193.8841123.75210.13460.02870.89660.8966

\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 & 90.5 & - & - & - & - & - & - & - \tabularnewline
37 & 122.4 & - & - & - & - & - & - & - \tabularnewline
38 & 123.3 & - & - & - & - & - & - & - \tabularnewline
39 & 124.3 & - & - & - & - & - & - & - \tabularnewline
40 & 120 & - & - & - & - & - & - & - \tabularnewline
41 & 118.1 & - & - & - & - & - & - & - \tabularnewline
42 & 119 & - & - & - & - & - & - & - \tabularnewline
43 & 142.7 & - & - & - & - & - & - & - \tabularnewline
44 & 123.6 & - & - & - & - & - & - & - \tabularnewline
45 & 129.6 & - & - & - & - & - & - & - \tabularnewline
46 & 151.6 & - & - & - & - & - & - & - \tabularnewline
47 & 110.4 & - & - & - & - & - & - & - \tabularnewline
48 & 99.2 & - & - & - & - & - & - & - \tabularnewline
49 & 130.5 & 132.8294 & 119.3672 & 146.2916 & 0.3673 & 1 & 0.9355 & 1 \tabularnewline
50 & 136.2 & 133.6529 & 120.0398 & 147.266 & 0.3569 & 0.6751 & 0.932 & 1 \tabularnewline
51 & 129.7 & 134.577 & 120.8168 & 148.3372 & 0.2436 & 0.4086 & 0.9284 & 1 \tabularnewline
52 & 128 & 130.2016 & 116.298 & 144.1052 & 0.3781 & 0.5282 & 0.9248 & 1 \tabularnewline
53 & 121.6 & 128.2268 & 114.1833 & 142.2702 & 0.1775 & 0.5126 & 0.9212 & 1 \tabularnewline
54 & 135.8 & 129.0525 & 114.8726 & 143.2324 & 0.1755 & 0.8485 & 0.9177 & 1 \tabularnewline
55 & 143.8 & 152.6788 & 138.3657 & 166.9919 & 0.112 & 0.9896 & 0.9141 & 1 \tabularnewline
56 & 147.5 & 133.5056 & 119.0624 & 147.9487 & 0.0288 & 0.0812 & 0.9106 & 1 \tabularnewline
57 & 136.2 & 139.4329 & 124.8628 & 154.0031 & 0.3318 & 0.1389 & 0.907 & 1 \tabularnewline
58 & 156.6 & 161.3608 & 146.6666 & 176.055 & 0.2627 & 0.9996 & 0.9035 & 1 \tabularnewline
59 & 123.3 & 120.0892 & 105.2737 & 134.9047 & 0.3355 & 0 & 0.9 & 0.9971 \tabularnewline
60 & 100.4 & 108.8181 & 93.8841 & 123.7521 & 0.1346 & 0.0287 & 0.8966 & 0.8966 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34178&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]90.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]122.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]123.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]124.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]120[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]118.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]119[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]142.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]123.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]129.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]151.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]110.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]99.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]130.5[/C][C]132.8294[/C][C]119.3672[/C][C]146.2916[/C][C]0.3673[/C][C]1[/C][C]0.9355[/C][C]1[/C][/ROW]
[ROW][C]50[/C][C]136.2[/C][C]133.6529[/C][C]120.0398[/C][C]147.266[/C][C]0.3569[/C][C]0.6751[/C][C]0.932[/C][C]1[/C][/ROW]
[ROW][C]51[/C][C]129.7[/C][C]134.577[/C][C]120.8168[/C][C]148.3372[/C][C]0.2436[/C][C]0.4086[/C][C]0.9284[/C][C]1[/C][/ROW]
[ROW][C]52[/C][C]128[/C][C]130.2016[/C][C]116.298[/C][C]144.1052[/C][C]0.3781[/C][C]0.5282[/C][C]0.9248[/C][C]1[/C][/ROW]
[ROW][C]53[/C][C]121.6[/C][C]128.2268[/C][C]114.1833[/C][C]142.2702[/C][C]0.1775[/C][C]0.5126[/C][C]0.9212[/C][C]1[/C][/ROW]
[ROW][C]54[/C][C]135.8[/C][C]129.0525[/C][C]114.8726[/C][C]143.2324[/C][C]0.1755[/C][C]0.8485[/C][C]0.9177[/C][C]1[/C][/ROW]
[ROW][C]55[/C][C]143.8[/C][C]152.6788[/C][C]138.3657[/C][C]166.9919[/C][C]0.112[/C][C]0.9896[/C][C]0.9141[/C][C]1[/C][/ROW]
[ROW][C]56[/C][C]147.5[/C][C]133.5056[/C][C]119.0624[/C][C]147.9487[/C][C]0.0288[/C][C]0.0812[/C][C]0.9106[/C][C]1[/C][/ROW]
[ROW][C]57[/C][C]136.2[/C][C]139.4329[/C][C]124.8628[/C][C]154.0031[/C][C]0.3318[/C][C]0.1389[/C][C]0.907[/C][C]1[/C][/ROW]
[ROW][C]58[/C][C]156.6[/C][C]161.3608[/C][C]146.6666[/C][C]176.055[/C][C]0.2627[/C][C]0.9996[/C][C]0.9035[/C][C]1[/C][/ROW]
[ROW][C]59[/C][C]123.3[/C][C]120.0892[/C][C]105.2737[/C][C]134.9047[/C][C]0.3355[/C][C]0[/C][C]0.9[/C][C]0.9971[/C][/ROW]
[ROW][C]60[/C][C]100.4[/C][C]108.8181[/C][C]93.8841[/C][C]123.7521[/C][C]0.1346[/C][C]0.0287[/C][C]0.8966[/C][C]0.8966[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34178&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34178&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])
3690.5-------
37122.4-------
38123.3-------
39124.3-------
40120-------
41118.1-------
42119-------
43142.7-------
44123.6-------
45129.6-------
46151.6-------
47110.4-------
4899.2-------
49130.5132.8294119.3672146.29160.367310.93551
50136.2133.6529120.0398147.2660.35690.67510.9321
51129.7134.577120.8168148.33720.24360.40860.92841
52128130.2016116.298144.10520.37810.52820.92481
53121.6128.2268114.1833142.27020.17750.51260.92121
54135.8129.0525114.8726143.23240.17550.84850.91771
55143.8152.6788138.3657166.99190.1120.98960.91411
56147.5133.5056119.0624147.94870.02880.08120.91061
57136.2139.4329124.8628154.00310.33180.13890.9071
58156.6161.3608146.6666176.0550.26270.99960.90351
59123.3120.0892105.2737134.90470.335500.90.9971
60100.4108.818193.8841123.75210.13460.02870.89660.8966







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0517-0.01750.00155.42610.45220.6724
500.0520.01910.00166.48770.54060.7353
510.0522-0.03620.00323.78481.98211.4079
520.0545-0.01690.00144.8470.40390.6355
530.0559-0.05170.004343.91413.65951.913
540.05610.05230.004445.52893.79411.9478
550.0478-0.05820.004878.83246.56942.5631
560.05520.10480.0087195.844116.32034.0398
570.0533-0.02320.001910.45170.8710.9333
580.0465-0.02950.002522.66521.88881.3743
590.06290.02670.002210.30920.85910.9269
600.07-0.07740.006470.8655.90542.4301

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0517 & -0.0175 & 0.0015 & 5.4261 & 0.4522 & 0.6724 \tabularnewline
50 & 0.052 & 0.0191 & 0.0016 & 6.4877 & 0.5406 & 0.7353 \tabularnewline
51 & 0.0522 & -0.0362 & 0.003 & 23.7848 & 1.9821 & 1.4079 \tabularnewline
52 & 0.0545 & -0.0169 & 0.0014 & 4.847 & 0.4039 & 0.6355 \tabularnewline
53 & 0.0559 & -0.0517 & 0.0043 & 43.9141 & 3.6595 & 1.913 \tabularnewline
54 & 0.0561 & 0.0523 & 0.0044 & 45.5289 & 3.7941 & 1.9478 \tabularnewline
55 & 0.0478 & -0.0582 & 0.0048 & 78.8324 & 6.5694 & 2.5631 \tabularnewline
56 & 0.0552 & 0.1048 & 0.0087 & 195.8441 & 16.3203 & 4.0398 \tabularnewline
57 & 0.0533 & -0.0232 & 0.0019 & 10.4517 & 0.871 & 0.9333 \tabularnewline
58 & 0.0465 & -0.0295 & 0.0025 & 22.6652 & 1.8888 & 1.3743 \tabularnewline
59 & 0.0629 & 0.0267 & 0.0022 & 10.3092 & 0.8591 & 0.9269 \tabularnewline
60 & 0.07 & -0.0774 & 0.0064 & 70.865 & 5.9054 & 2.4301 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34178&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.0517[/C][C]-0.0175[/C][C]0.0015[/C][C]5.4261[/C][C]0.4522[/C][C]0.6724[/C][/ROW]
[ROW][C]50[/C][C]0.052[/C][C]0.0191[/C][C]0.0016[/C][C]6.4877[/C][C]0.5406[/C][C]0.7353[/C][/ROW]
[ROW][C]51[/C][C]0.0522[/C][C]-0.0362[/C][C]0.003[/C][C]23.7848[/C][C]1.9821[/C][C]1.4079[/C][/ROW]
[ROW][C]52[/C][C]0.0545[/C][C]-0.0169[/C][C]0.0014[/C][C]4.847[/C][C]0.4039[/C][C]0.6355[/C][/ROW]
[ROW][C]53[/C][C]0.0559[/C][C]-0.0517[/C][C]0.0043[/C][C]43.9141[/C][C]3.6595[/C][C]1.913[/C][/ROW]
[ROW][C]54[/C][C]0.0561[/C][C]0.0523[/C][C]0.0044[/C][C]45.5289[/C][C]3.7941[/C][C]1.9478[/C][/ROW]
[ROW][C]55[/C][C]0.0478[/C][C]-0.0582[/C][C]0.0048[/C][C]78.8324[/C][C]6.5694[/C][C]2.5631[/C][/ROW]
[ROW][C]56[/C][C]0.0552[/C][C]0.1048[/C][C]0.0087[/C][C]195.8441[/C][C]16.3203[/C][C]4.0398[/C][/ROW]
[ROW][C]57[/C][C]0.0533[/C][C]-0.0232[/C][C]0.0019[/C][C]10.4517[/C][C]0.871[/C][C]0.9333[/C][/ROW]
[ROW][C]58[/C][C]0.0465[/C][C]-0.0295[/C][C]0.0025[/C][C]22.6652[/C][C]1.8888[/C][C]1.3743[/C][/ROW]
[ROW][C]59[/C][C]0.0629[/C][C]0.0267[/C][C]0.0022[/C][C]10.3092[/C][C]0.8591[/C][C]0.9269[/C][/ROW]
[ROW][C]60[/C][C]0.07[/C][C]-0.0774[/C][C]0.0064[/C][C]70.865[/C][C]5.9054[/C][C]2.4301[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34178&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34178&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.0517-0.01750.00155.42610.45220.6724
500.0520.01910.00166.48770.54060.7353
510.0522-0.03620.00323.78481.98211.4079
520.0545-0.01690.00144.8470.40390.6355
530.0559-0.05170.004343.91413.65951.913
540.05610.05230.004445.52893.79411.9478
550.0478-0.05820.004878.83246.56942.5631
560.05520.10480.0087195.844116.32034.0398
570.0533-0.02320.001910.45170.8710.9333
580.0465-0.02950.002522.66521.88881.3743
590.06290.02670.002210.30920.85910.9269
600.07-0.07740.006470.8655.90542.4301



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