Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationSat, 09 Apr 2011 16:37:22 +0000
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/Apr/09/t1302366894vwahl08yat9labv.htm/, Retrieved Wed, 08 May 2024 17:11:49 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=120426, Retrieved Wed, 08 May 2024 17:11:49 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact220
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Badge4u 45MM] [2011-04-09 16:37:22] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
4339,28
4453,46
4514,38
9751,95
10543,67
5846,57
6333,79
12964,54
8571,94
5603,00
6562,20
5389,82
6928,18
7110,56
7477,08
15570,30
16834,42
9334,84
10112,76
20699,61
13686,29
8945,94
10477,44
8605,60
11701,03
11397,00
12173,22
26296,62
28431,55
15765,66
17079,42
34959,55
23114,76
15108,72
17695,30
14533,98
18360,00
18700,00
18972,00
40936,00
44268,00
24548,00
26588,00
54400,00
35972,00
23528,00
27540,00
22644,00




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

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=120426&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' @ www.wessa.org







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[36])
248605.6-------
2511701.03-------
2611397-------
2712173.22-------
2826296.62-------
2928431.55-------
3015765.66-------
3117079.42-------
3234959.55-------
3323114.76-------
3415108.72-------
3517695.3-------
3614533.98-------
371836019200.619918609.376419810.64810.0035111
381870019208.691718559.487719880.60470.06890.993411
391897220352.679419608.911221124.65892e-04111
404093643151.122341464.431744906.42410.0067111
414426846654.441344719.804448672.77320.0102111
422454825870.399324739.615727052.8680.0142011
432658828026.253426741.667329372.54690.0181111
445440057366.404654620.854660249.96120.0219111
453597237929.85636041.081239917.61430.0268011
462352824792.509123511.848626142.92560.0332011
472754029036.896627485.045730676.36770.0368111
482264423849.346922533.569525241.9550.0449011

\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[36]) \tabularnewline
24 & 8605.6 & - & - & - & - & - & - & - \tabularnewline
25 & 11701.03 & - & - & - & - & - & - & - \tabularnewline
26 & 11397 & - & - & - & - & - & - & - \tabularnewline
27 & 12173.22 & - & - & - & - & - & - & - \tabularnewline
28 & 26296.62 & - & - & - & - & - & - & - \tabularnewline
29 & 28431.55 & - & - & - & - & - & - & - \tabularnewline
30 & 15765.66 & - & - & - & - & - & - & - \tabularnewline
31 & 17079.42 & - & - & - & - & - & - & - \tabularnewline
32 & 34959.55 & - & - & - & - & - & - & - \tabularnewline
33 & 23114.76 & - & - & - & - & - & - & - \tabularnewline
34 & 15108.72 & - & - & - & - & - & - & - \tabularnewline
35 & 17695.3 & - & - & - & - & - & - & - \tabularnewline
36 & 14533.98 & - & - & - & - & - & - & - \tabularnewline
37 & 18360 & 19200.6199 & 18609.3764 & 19810.6481 & 0.0035 & 1 & 1 & 1 \tabularnewline
38 & 18700 & 19208.6917 & 18559.4877 & 19880.6047 & 0.0689 & 0.9934 & 1 & 1 \tabularnewline
39 & 18972 & 20352.6794 & 19608.9112 & 21124.6589 & 2e-04 & 1 & 1 & 1 \tabularnewline
40 & 40936 & 43151.1223 & 41464.4317 & 44906.4241 & 0.0067 & 1 & 1 & 1 \tabularnewline
41 & 44268 & 46654.4413 & 44719.8044 & 48672.7732 & 0.0102 & 1 & 1 & 1 \tabularnewline
42 & 24548 & 25870.3993 & 24739.6157 & 27052.868 & 0.0142 & 0 & 1 & 1 \tabularnewline
43 & 26588 & 28026.2534 & 26741.6673 & 29372.5469 & 0.0181 & 1 & 1 & 1 \tabularnewline
44 & 54400 & 57366.4046 & 54620.8546 & 60249.9612 & 0.0219 & 1 & 1 & 1 \tabularnewline
45 & 35972 & 37929.856 & 36041.0812 & 39917.6143 & 0.0268 & 0 & 1 & 1 \tabularnewline
46 & 23528 & 24792.5091 & 23511.8486 & 26142.9256 & 0.0332 & 0 & 1 & 1 \tabularnewline
47 & 27540 & 29036.8966 & 27485.0457 & 30676.3677 & 0.0368 & 1 & 1 & 1 \tabularnewline
48 & 22644 & 23849.3469 & 22533.5695 & 25241.955 & 0.0449 & 0 & 1 & 1 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=120426&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[36])[/C][/ROW]
[ROW][C]24[/C][C]8605.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]25[/C][C]11701.03[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]26[/C][C]11397[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]27[/C][C]12173.22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]28[/C][C]26296.62[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]29[/C][C]28431.55[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]30[/C][C]15765.66[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]31[/C][C]17079.42[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]32[/C][C]34959.55[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]23114.76[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]15108.72[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]17695.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]14533.98[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]18360[/C][C]19200.6199[/C][C]18609.3764[/C][C]19810.6481[/C][C]0.0035[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]38[/C][C]18700[/C][C]19208.6917[/C][C]18559.4877[/C][C]19880.6047[/C][C]0.0689[/C][C]0.9934[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]39[/C][C]18972[/C][C]20352.6794[/C][C]19608.9112[/C][C]21124.6589[/C][C]2e-04[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]40[/C][C]40936[/C][C]43151.1223[/C][C]41464.4317[/C][C]44906.4241[/C][C]0.0067[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]41[/C][C]44268[/C][C]46654.4413[/C][C]44719.8044[/C][C]48672.7732[/C][C]0.0102[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]42[/C][C]24548[/C][C]25870.3993[/C][C]24739.6157[/C][C]27052.868[/C][C]0.0142[/C][C]0[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]43[/C][C]26588[/C][C]28026.2534[/C][C]26741.6673[/C][C]29372.5469[/C][C]0.0181[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]44[/C][C]54400[/C][C]57366.4046[/C][C]54620.8546[/C][C]60249.9612[/C][C]0.0219[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]45[/C][C]35972[/C][C]37929.856[/C][C]36041.0812[/C][C]39917.6143[/C][C]0.0268[/C][C]0[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]46[/C][C]23528[/C][C]24792.5091[/C][C]23511.8486[/C][C]26142.9256[/C][C]0.0332[/C][C]0[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]47[/C][C]27540[/C][C]29036.8966[/C][C]27485.0457[/C][C]30676.3677[/C][C]0.0368[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]48[/C][C]22644[/C][C]23849.3469[/C][C]22533.5695[/C][C]25241.955[/C][C]0.0449[/C][C]0[/C][C]1[/C][C]1[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=120426&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=120426&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[36])
248605.6-------
2511701.03-------
2611397-------
2712173.22-------
2826296.62-------
2928431.55-------
3015765.66-------
3117079.42-------
3234959.55-------
3323114.76-------
3415108.72-------
3517695.3-------
3614533.98-------
371836019200.619918609.376419810.64810.0035111
381870019208.691718559.487719880.60470.06890.993411
391897220352.679419608.911221124.65892e-04111
404093643151.122341464.431744906.42410.0067111
414426846654.441344719.804448672.77320.0102111
422454825870.399324739.615727052.8680.0142011
432658828026.253426741.667329372.54690.0181111
445440057366.404654620.854660249.96120.0219111
453597237929.85636041.081239917.61430.0268011
462352824792.509123511.848626142.92560.0332011
472754029036.896627485.045730676.36770.0368111
482264423849.346922533.569525241.9550.0449011







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
370.0162-0.04380706641.866200
380.0178-0.02650.0351258767.2851482704.5757694.7694
390.0194-0.06780.0461906275.7227957228.2913978.3804
400.0208-0.05130.04744906766.95281944612.95671394.4938
410.0221-0.05120.04815695102.1842694710.80221641.5574
420.0233-0.05110.04861748739.79982537048.96841592.8117
430.0245-0.05130.0492068572.75192470123.79461571.6627
440.0256-0.05170.04938799555.9613261302.81541805.9078
450.0267-0.05160.04963833200.25993324846.97591823.4163
460.0278-0.0510.04971598983.333152260.61131775.4607
470.0288-0.05160.04992240699.54543069391.42351751.9679
480.0298-0.05050.051452861.11672934680.56461713.0909

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
37 & 0.0162 & -0.0438 & 0 & 706641.8662 & 0 & 0 \tabularnewline
38 & 0.0178 & -0.0265 & 0.0351 & 258767.2851 & 482704.5757 & 694.7694 \tabularnewline
39 & 0.0194 & -0.0678 & 0.046 & 1906275.7227 & 957228.2913 & 978.3804 \tabularnewline
40 & 0.0208 & -0.0513 & 0.0474 & 4906766.9528 & 1944612.9567 & 1394.4938 \tabularnewline
41 & 0.0221 & -0.0512 & 0.0481 & 5695102.184 & 2694710.8022 & 1641.5574 \tabularnewline
42 & 0.0233 & -0.0511 & 0.0486 & 1748739.7998 & 2537048.9684 & 1592.8117 \tabularnewline
43 & 0.0245 & -0.0513 & 0.049 & 2068572.7519 & 2470123.7946 & 1571.6627 \tabularnewline
44 & 0.0256 & -0.0517 & 0.0493 & 8799555.961 & 3261302.8154 & 1805.9078 \tabularnewline
45 & 0.0267 & -0.0516 & 0.0496 & 3833200.2599 & 3324846.9759 & 1823.4163 \tabularnewline
46 & 0.0278 & -0.051 & 0.0497 & 1598983.33 & 3152260.6113 & 1775.4607 \tabularnewline
47 & 0.0288 & -0.0516 & 0.0499 & 2240699.5454 & 3069391.4235 & 1751.9679 \tabularnewline
48 & 0.0298 & -0.0505 & 0.05 & 1452861.1167 & 2934680.5646 & 1713.0909 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=120426&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]37[/C][C]0.0162[/C][C]-0.0438[/C][C]0[/C][C]706641.8662[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]38[/C][C]0.0178[/C][C]-0.0265[/C][C]0.0351[/C][C]258767.2851[/C][C]482704.5757[/C][C]694.7694[/C][/ROW]
[ROW][C]39[/C][C]0.0194[/C][C]-0.0678[/C][C]0.046[/C][C]1906275.7227[/C][C]957228.2913[/C][C]978.3804[/C][/ROW]
[ROW][C]40[/C][C]0.0208[/C][C]-0.0513[/C][C]0.0474[/C][C]4906766.9528[/C][C]1944612.9567[/C][C]1394.4938[/C][/ROW]
[ROW][C]41[/C][C]0.0221[/C][C]-0.0512[/C][C]0.0481[/C][C]5695102.184[/C][C]2694710.8022[/C][C]1641.5574[/C][/ROW]
[ROW][C]42[/C][C]0.0233[/C][C]-0.0511[/C][C]0.0486[/C][C]1748739.7998[/C][C]2537048.9684[/C][C]1592.8117[/C][/ROW]
[ROW][C]43[/C][C]0.0245[/C][C]-0.0513[/C][C]0.049[/C][C]2068572.7519[/C][C]2470123.7946[/C][C]1571.6627[/C][/ROW]
[ROW][C]44[/C][C]0.0256[/C][C]-0.0517[/C][C]0.0493[/C][C]8799555.961[/C][C]3261302.8154[/C][C]1805.9078[/C][/ROW]
[ROW][C]45[/C][C]0.0267[/C][C]-0.0516[/C][C]0.0496[/C][C]3833200.2599[/C][C]3324846.9759[/C][C]1823.4163[/C][/ROW]
[ROW][C]46[/C][C]0.0278[/C][C]-0.051[/C][C]0.0497[/C][C]1598983.33[/C][C]3152260.6113[/C][C]1775.4607[/C][/ROW]
[ROW][C]47[/C][C]0.0288[/C][C]-0.0516[/C][C]0.0499[/C][C]2240699.5454[/C][C]3069391.4235[/C][C]1751.9679[/C][/ROW]
[ROW][C]48[/C][C]0.0298[/C][C]-0.0505[/C][C]0.05[/C][C]1452861.1167[/C][C]2934680.5646[/C][C]1713.0909[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=120426&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=120426&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
370.0162-0.04380706641.866200
380.0178-0.02650.0351258767.2851482704.5757694.7694
390.0194-0.06780.0461906275.7227957228.2913978.3804
400.0208-0.05130.04744906766.95281944612.95671394.4938
410.0221-0.05120.04815695102.1842694710.80221641.5574
420.0233-0.05110.04861748739.79982537048.96841592.8117
430.0245-0.05130.0492068572.75192470123.79461571.6627
440.0256-0.05170.04938799555.9613261302.81541805.9078
450.0267-0.05160.04963833200.25993324846.97591823.4163
460.0278-0.0510.04971598983.333152260.61131775.4607
470.0288-0.05160.04992240699.54543069391.42351751.9679
480.0298-0.05050.051452861.11672934680.56461713.0909



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