Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationTue, 06 Dec 2011 10:07:33 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/06/t13231840628bnr69t65r0dvwx.htm/, Retrieved Sun, 28 Apr 2024 20:44:54 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=151660, Retrieved Sun, 28 Apr 2024 20:44:54 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact109
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F     [ARIMA Forecasting] [WS9] [2010-12-08 16:43:35] [ec8d68d52c1e9c5e97bb689b42436a8c]
- R PD    [ARIMA Forecasting] [] [2011-12-06 15:07:33] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
19 819,6
17 512,40
18 831,10
20 175,50
21 470,90
19 929,70
22 465,90
19 618,40
18 600,20
17 271,00
18 524,10
18 830,40
19 293,30
15 802,20
17 283,00
19 534,60
16 787,00
17 144,00
18 587,40
15 434,00
14 922,40
15 794,30
16 032,10
16 065,00
16 236,80
12 521,00
14 762,10
15 446,90
13 635,00
14 212,60
15 021,70
14 134,30
13 721,40
14 384,50
15 638,60
19 711,60
20 359,80
16 141,40
20 056,90
20 605,50
19 325,80
20 547,70
19 211,20
19 009,50
18 746,80
16 471,50
18 957,20
20 515,20
18 374,40




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net

\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 & 2 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ jenkins.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151660&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]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ jenkins.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151660&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151660&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 time2 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net







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[37])
2516236.8-------
2612521-------
2714762.1-------
2815446.9-------
2913635-------
3014212.6-------
3115021.7-------
3214134.3-------
3313721.4-------
3414384.5-------
3515638.6-------
3619711.6-------
3720359.8-------
3816141.415524.114614514.512316533.7170.1154010
3920056.917907.574416651.045119164.10374e-040.997111e-04
4020605.519467.294717980.344420954.24510.06680.218510.1197
4119325.813848.240912165.518815530.9631000.59810
4220547.716203.134914344.656118061.613705e-040.98210
4319211.215996.872213977.952618015.79179e-0400.82810
4419009.514787.509912619.982316955.03761e-0400.72260
4518746.814848.329212541.749817154.90865e-042e-040.83090
4616471.517579.514815141.802320017.22740.18650.1740.99490.0127
4718957.217865.462115303.319220427.60490.20180.85690.95580.0282
4820515.221619.589418938.785524300.39330.20970.97420.91850.8215
4918374.421987.349819192.919124781.78050.00560.84910.87320.8732

\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[37]) \tabularnewline
25 & 16236.8 & - & - & - & - & - & - & - \tabularnewline
26 & 12521 & - & - & - & - & - & - & - \tabularnewline
27 & 14762.1 & - & - & - & - & - & - & - \tabularnewline
28 & 15446.9 & - & - & - & - & - & - & - \tabularnewline
29 & 13635 & - & - & - & - & - & - & - \tabularnewline
30 & 14212.6 & - & - & - & - & - & - & - \tabularnewline
31 & 15021.7 & - & - & - & - & - & - & - \tabularnewline
32 & 14134.3 & - & - & - & - & - & - & - \tabularnewline
33 & 13721.4 & - & - & - & - & - & - & - \tabularnewline
34 & 14384.5 & - & - & - & - & - & - & - \tabularnewline
35 & 15638.6 & - & - & - & - & - & - & - \tabularnewline
36 & 19711.6 & - & - & - & - & - & - & - \tabularnewline
37 & 20359.8 & - & - & - & - & - & - & - \tabularnewline
38 & 16141.4 & 15524.1146 & 14514.5123 & 16533.717 & 0.1154 & 0 & 1 & 0 \tabularnewline
39 & 20056.9 & 17907.5744 & 16651.0451 & 19164.1037 & 4e-04 & 0.9971 & 1 & 1e-04 \tabularnewline
40 & 20605.5 & 19467.2947 & 17980.3444 & 20954.2451 & 0.0668 & 0.2185 & 1 & 0.1197 \tabularnewline
41 & 19325.8 & 13848.2409 & 12165.5188 & 15530.9631 & 0 & 0 & 0.5981 & 0 \tabularnewline
42 & 20547.7 & 16203.1349 & 14344.6561 & 18061.6137 & 0 & 5e-04 & 0.9821 & 0 \tabularnewline
43 & 19211.2 & 15996.8722 & 13977.9526 & 18015.7917 & 9e-04 & 0 & 0.8281 & 0 \tabularnewline
44 & 19009.5 & 14787.5099 & 12619.9823 & 16955.0376 & 1e-04 & 0 & 0.7226 & 0 \tabularnewline
45 & 18746.8 & 14848.3292 & 12541.7498 & 17154.9086 & 5e-04 & 2e-04 & 0.8309 & 0 \tabularnewline
46 & 16471.5 & 17579.5148 & 15141.8023 & 20017.2274 & 0.1865 & 0.174 & 0.9949 & 0.0127 \tabularnewline
47 & 18957.2 & 17865.4621 & 15303.3192 & 20427.6049 & 0.2018 & 0.8569 & 0.9558 & 0.0282 \tabularnewline
48 & 20515.2 & 21619.5894 & 18938.7855 & 24300.3933 & 0.2097 & 0.9742 & 0.9185 & 0.8215 \tabularnewline
49 & 18374.4 & 21987.3498 & 19192.9191 & 24781.7805 & 0.0056 & 0.8491 & 0.8732 & 0.8732 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151660&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[37])[/C][/ROW]
[ROW][C]25[/C][C]16236.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]26[/C][C]12521[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]27[/C][C]14762.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]28[/C][C]15446.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]29[/C][C]13635[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]30[/C][C]14212.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]31[/C][C]15021.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]32[/C][C]14134.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]13721.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]14384.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]15638.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]19711.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]20359.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]16141.4[/C][C]15524.1146[/C][C]14514.5123[/C][C]16533.717[/C][C]0.1154[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[ROW][C]39[/C][C]20056.9[/C][C]17907.5744[/C][C]16651.0451[/C][C]19164.1037[/C][C]4e-04[/C][C]0.9971[/C][C]1[/C][C]1e-04[/C][/ROW]
[ROW][C]40[/C][C]20605.5[/C][C]19467.2947[/C][C]17980.3444[/C][C]20954.2451[/C][C]0.0668[/C][C]0.2185[/C][C]1[/C][C]0.1197[/C][/ROW]
[ROW][C]41[/C][C]19325.8[/C][C]13848.2409[/C][C]12165.5188[/C][C]15530.9631[/C][C]0[/C][C]0[/C][C]0.5981[/C][C]0[/C][/ROW]
[ROW][C]42[/C][C]20547.7[/C][C]16203.1349[/C][C]14344.6561[/C][C]18061.6137[/C][C]0[/C][C]5e-04[/C][C]0.9821[/C][C]0[/C][/ROW]
[ROW][C]43[/C][C]19211.2[/C][C]15996.8722[/C][C]13977.9526[/C][C]18015.7917[/C][C]9e-04[/C][C]0[/C][C]0.8281[/C][C]0[/C][/ROW]
[ROW][C]44[/C][C]19009.5[/C][C]14787.5099[/C][C]12619.9823[/C][C]16955.0376[/C][C]1e-04[/C][C]0[/C][C]0.7226[/C][C]0[/C][/ROW]
[ROW][C]45[/C][C]18746.8[/C][C]14848.3292[/C][C]12541.7498[/C][C]17154.9086[/C][C]5e-04[/C][C]2e-04[/C][C]0.8309[/C][C]0[/C][/ROW]
[ROW][C]46[/C][C]16471.5[/C][C]17579.5148[/C][C]15141.8023[/C][C]20017.2274[/C][C]0.1865[/C][C]0.174[/C][C]0.9949[/C][C]0.0127[/C][/ROW]
[ROW][C]47[/C][C]18957.2[/C][C]17865.4621[/C][C]15303.3192[/C][C]20427.6049[/C][C]0.2018[/C][C]0.8569[/C][C]0.9558[/C][C]0.0282[/C][/ROW]
[ROW][C]48[/C][C]20515.2[/C][C]21619.5894[/C][C]18938.7855[/C][C]24300.3933[/C][C]0.2097[/C][C]0.9742[/C][C]0.9185[/C][C]0.8215[/C][/ROW]
[ROW][C]49[/C][C]18374.4[/C][C]21987.3498[/C][C]19192.9191[/C][C]24781.7805[/C][C]0.0056[/C][C]0.8491[/C][C]0.8732[/C][C]0.8732[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151660&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151660&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[37])
2516236.8-------
2612521-------
2714762.1-------
2815446.9-------
2913635-------
3014212.6-------
3115021.7-------
3214134.3-------
3313721.4-------
3414384.5-------
3515638.6-------
3619711.6-------
3720359.8-------
3816141.415524.114614514.512316533.7170.1154010
3920056.917907.574416651.045119164.10374e-040.997111e-04
4020605.519467.294717980.344420954.24510.06680.218510.1197
4119325.813848.240912165.518815530.9631000.59810
4220547.716203.134914344.656118061.613705e-040.98210
4319211.215996.872213977.952618015.79179e-0400.82810
4419009.514787.509912619.982316955.03761e-0400.72260
4518746.814848.329212541.749817154.90865e-042e-040.83090
4616471.517579.514815141.802320017.22740.18650.1740.99490.0127
4718957.217865.462115303.319220427.60490.20180.85690.95580.0282
4820515.221619.589418938.785524300.39330.20970.97420.91850.8215
4918374.421987.349819192.919124781.78050.00560.84910.87320.8732







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
380.03320.03980381041.239300
390.03580.120.07994619600.6352500320.93711581.2403
400.0390.05850.07281295511.22182098717.69871448.6952
410.0620.39550.153430003653.38159074951.61943012.466
420.05850.26810.176418875245.882211035010.47193321.8986
430.06440.20090.180510331903.52310917825.98053304.2134
440.07480.28550.195517825200.05511904593.70543450.3034
450.07930.26260.203915198074.586912316278.81563509.4556
460.0707-0.0630.18821227696.869911084214.1553329.2963
470.07320.06110.17551191891.714610094981.91093177.2601
480.0633-0.05110.16421219675.88559288135.90863047.6443
490.0648-0.16430.164213053406.09619601908.42423098.6946

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
38 & 0.0332 & 0.0398 & 0 & 381041.2393 & 0 & 0 \tabularnewline
39 & 0.0358 & 0.12 & 0.0799 & 4619600.635 & 2500320.9371 & 1581.2403 \tabularnewline
40 & 0.039 & 0.0585 & 0.0728 & 1295511.2218 & 2098717.6987 & 1448.6952 \tabularnewline
41 & 0.062 & 0.3955 & 0.1534 & 30003653.3815 & 9074951.6194 & 3012.466 \tabularnewline
42 & 0.0585 & 0.2681 & 0.1764 & 18875245.8822 & 11035010.4719 & 3321.8986 \tabularnewline
43 & 0.0644 & 0.2009 & 0.1805 & 10331903.523 & 10917825.9805 & 3304.2134 \tabularnewline
44 & 0.0748 & 0.2855 & 0.1955 & 17825200.055 & 11904593.7054 & 3450.3034 \tabularnewline
45 & 0.0793 & 0.2626 & 0.2039 & 15198074.5869 & 12316278.8156 & 3509.4556 \tabularnewline
46 & 0.0707 & -0.063 & 0.1882 & 1227696.8699 & 11084214.155 & 3329.2963 \tabularnewline
47 & 0.0732 & 0.0611 & 0.1755 & 1191891.7146 & 10094981.9109 & 3177.2601 \tabularnewline
48 & 0.0633 & -0.0511 & 0.1642 & 1219675.8855 & 9288135.9086 & 3047.6443 \tabularnewline
49 & 0.0648 & -0.1643 & 0.1642 & 13053406.0961 & 9601908.4242 & 3098.6946 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151660&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]38[/C][C]0.0332[/C][C]0.0398[/C][C]0[/C][C]381041.2393[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]39[/C][C]0.0358[/C][C]0.12[/C][C]0.0799[/C][C]4619600.635[/C][C]2500320.9371[/C][C]1581.2403[/C][/ROW]
[ROW][C]40[/C][C]0.039[/C][C]0.0585[/C][C]0.0728[/C][C]1295511.2218[/C][C]2098717.6987[/C][C]1448.6952[/C][/ROW]
[ROW][C]41[/C][C]0.062[/C][C]0.3955[/C][C]0.1534[/C][C]30003653.3815[/C][C]9074951.6194[/C][C]3012.466[/C][/ROW]
[ROW][C]42[/C][C]0.0585[/C][C]0.2681[/C][C]0.1764[/C][C]18875245.8822[/C][C]11035010.4719[/C][C]3321.8986[/C][/ROW]
[ROW][C]43[/C][C]0.0644[/C][C]0.2009[/C][C]0.1805[/C][C]10331903.523[/C][C]10917825.9805[/C][C]3304.2134[/C][/ROW]
[ROW][C]44[/C][C]0.0748[/C][C]0.2855[/C][C]0.1955[/C][C]17825200.055[/C][C]11904593.7054[/C][C]3450.3034[/C][/ROW]
[ROW][C]45[/C][C]0.0793[/C][C]0.2626[/C][C]0.2039[/C][C]15198074.5869[/C][C]12316278.8156[/C][C]3509.4556[/C][/ROW]
[ROW][C]46[/C][C]0.0707[/C][C]-0.063[/C][C]0.1882[/C][C]1227696.8699[/C][C]11084214.155[/C][C]3329.2963[/C][/ROW]
[ROW][C]47[/C][C]0.0732[/C][C]0.0611[/C][C]0.1755[/C][C]1191891.7146[/C][C]10094981.9109[/C][C]3177.2601[/C][/ROW]
[ROW][C]48[/C][C]0.0633[/C][C]-0.0511[/C][C]0.1642[/C][C]1219675.8855[/C][C]9288135.9086[/C][C]3047.6443[/C][/ROW]
[ROW][C]49[/C][C]0.0648[/C][C]-0.1643[/C][C]0.1642[/C][C]13053406.0961[/C][C]9601908.4242[/C][C]3098.6946[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151660&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151660&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
380.03320.03980381041.239300
390.03580.120.07994619600.6352500320.93711581.2403
400.0390.05850.07281295511.22182098717.69871448.6952
410.0620.39550.153430003653.38159074951.61943012.466
420.05850.26810.176418875245.882211035010.47193321.8986
430.06440.20090.180510331903.52310917825.98053304.2134
440.07480.28550.195517825200.05511904593.70543450.3034
450.07930.26260.203915198074.586912316278.81563509.4556
460.0707-0.0630.18821227696.869911084214.1553329.2963
470.07320.06110.17551191891.714610094981.91093177.2601
480.0633-0.05110.16421219675.88559288135.90863047.6443
490.0648-0.16430.164213053406.09619601908.42423098.6946



Parameters (Session):
par1 = Default ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 12 ; par6 = White Noise ; par7 = 0.95 ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 2 ; 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')