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:41:23 +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/t1302367139qoelbek9a8csukd.htm/, Retrieved Wed, 08 May 2024 19:59:08 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=120427, Retrieved Wed, 08 May 2024 19:59:08 +0000
QR Codes:

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

Post a new message
Dataseries X:
4594,54
4715,42
4779,94
10325,59
11163,89
6190,49
6706,37
13727,16
9076,18
5932,58
6948,22
5706,86
7335,72
7528,82
7916,90
16486,20
17824,68
9883,94
10707,62
21917,23
14491,37
9472,18
11093,76
9111,82
12389,33
12067,42
12889,30
27843,48
30103,99
16693,06
18084,10
37015,99
24474,46
15997,46
18736,20
15388,92
19440,00
19800,00
20088,00
43344,00
46872,00
25992,00
28152,00
57600,00
38088,00
24912,00
29160,00
23976,00




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

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

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







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])
249111.82-------
2512389.33-------
2612067.42-------
2712889.3-------
2827843.48-------
2930103.99-------
3016693.06-------
3118084.1-------
3237015.99-------
3324474.46-------
3415997.46-------
3518736.2-------
3615388.92-------
371944020330.022619704.035920975.89660.0035111
381980020338.611119651.252821050.01170.06890.993411
392008821549.868720762.386522367.21892e-04111
404334445689.313843903.486947547.78130.0067111
414687249398.698247350.347351535.65970.0102111
422599227392.116626194.865928644.08820.0142011
432815229674.780228314.684631100.20790.0181111
445760060740.743857833.803463793.79780.0219111
453808840160.9438161.135242265.5430.0268011
462491226250.833924894.889827680.63190.0332011
472916030744.875529101.798232480.72050.0368111
482397625252.200523859.072926726.67270.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 & 9111.82 & - & - & - & - & - & - & - \tabularnewline
25 & 12389.33 & - & - & - & - & - & - & - \tabularnewline
26 & 12067.42 & - & - & - & - & - & - & - \tabularnewline
27 & 12889.3 & - & - & - & - & - & - & - \tabularnewline
28 & 27843.48 & - & - & - & - & - & - & - \tabularnewline
29 & 30103.99 & - & - & - & - & - & - & - \tabularnewline
30 & 16693.06 & - & - & - & - & - & - & - \tabularnewline
31 & 18084.1 & - & - & - & - & - & - & - \tabularnewline
32 & 37015.99 & - & - & - & - & - & - & - \tabularnewline
33 & 24474.46 & - & - & - & - & - & - & - \tabularnewline
34 & 15997.46 & - & - & - & - & - & - & - \tabularnewline
35 & 18736.2 & - & - & - & - & - & - & - \tabularnewline
36 & 15388.92 & - & - & - & - & - & - & - \tabularnewline
37 & 19440 & 20330.0226 & 19704.0359 & 20975.8966 & 0.0035 & 1 & 1 & 1 \tabularnewline
38 & 19800 & 20338.6111 & 19651.2528 & 21050.0117 & 0.0689 & 0.9934 & 1 & 1 \tabularnewline
39 & 20088 & 21549.8687 & 20762.3865 & 22367.2189 & 2e-04 & 1 & 1 & 1 \tabularnewline
40 & 43344 & 45689.3138 & 43903.4869 & 47547.7813 & 0.0067 & 1 & 1 & 1 \tabularnewline
41 & 46872 & 49398.6982 & 47350.3473 & 51535.6597 & 0.0102 & 1 & 1 & 1 \tabularnewline
42 & 25992 & 27392.1166 & 26194.8659 & 28644.0882 & 0.0142 & 0 & 1 & 1 \tabularnewline
43 & 28152 & 29674.7802 & 28314.6846 & 31100.2079 & 0.0181 & 1 & 1 & 1 \tabularnewline
44 & 57600 & 60740.7438 & 57833.8034 & 63793.7978 & 0.0219 & 1 & 1 & 1 \tabularnewline
45 & 38088 & 40160.94 & 38161.1352 & 42265.543 & 0.0268 & 0 & 1 & 1 \tabularnewline
46 & 24912 & 26250.8339 & 24894.8898 & 27680.6319 & 0.0332 & 0 & 1 & 1 \tabularnewline
47 & 29160 & 30744.8755 & 29101.7982 & 32480.7205 & 0.0368 & 1 & 1 & 1 \tabularnewline
48 & 23976 & 25252.2005 & 23859.0729 & 26726.6727 & 0.0449 & 0 & 1 & 1 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=120427&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]9111.82[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]25[/C][C]12389.33[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]26[/C][C]12067.42[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]27[/C][C]12889.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]28[/C][C]27843.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]29[/C][C]30103.99[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]30[/C][C]16693.06[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]31[/C][C]18084.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]32[/C][C]37015.99[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]24474.46[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]15997.46[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]18736.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]15388.92[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]19440[/C][C]20330.0226[/C][C]19704.0359[/C][C]20975.8966[/C][C]0.0035[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]38[/C][C]19800[/C][C]20338.6111[/C][C]19651.2528[/C][C]21050.0117[/C][C]0.0689[/C][C]0.9934[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]39[/C][C]20088[/C][C]21549.8687[/C][C]20762.3865[/C][C]22367.2189[/C][C]2e-04[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]40[/C][C]43344[/C][C]45689.3138[/C][C]43903.4869[/C][C]47547.7813[/C][C]0.0067[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]41[/C][C]46872[/C][C]49398.6982[/C][C]47350.3473[/C][C]51535.6597[/C][C]0.0102[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]42[/C][C]25992[/C][C]27392.1166[/C][C]26194.8659[/C][C]28644.0882[/C][C]0.0142[/C][C]0[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]43[/C][C]28152[/C][C]29674.7802[/C][C]28314.6846[/C][C]31100.2079[/C][C]0.0181[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]44[/C][C]57600[/C][C]60740.7438[/C][C]57833.8034[/C][C]63793.7978[/C][C]0.0219[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]45[/C][C]38088[/C][C]40160.94[/C][C]38161.1352[/C][C]42265.543[/C][C]0.0268[/C][C]0[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]46[/C][C]24912[/C][C]26250.8339[/C][C]24894.8898[/C][C]27680.6319[/C][C]0.0332[/C][C]0[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]47[/C][C]29160[/C][C]30744.8755[/C][C]29101.7982[/C][C]32480.7205[/C][C]0.0368[/C][C]1[/C][C]1[/C][C]1[/C][/ROW]
[ROW][C]48[/C][C]23976[/C][C]25252.2005[/C][C]23859.0729[/C][C]26726.6727[/C][C]0.0449[/C][C]0[/C][C]1[/C][C]1[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=120427&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=120427&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])
249111.82-------
2512389.33-------
2612067.42-------
2712889.3-------
2827843.48-------
2930103.99-------
3016693.06-------
3118084.1-------
3237015.99-------
3324474.46-------
3415997.46-------
3518736.2-------
3615388.92-------
371944020330.022619704.035920975.89660.0035111
381980020338.611119651.252821050.01170.06890.993411
392008821549.868720762.386522367.21892e-04111
404334445689.313843903.486947547.78130.0067111
414687249398.698247350.347351535.65970.0102111
422599227392.116626194.865928644.08820.0142011
432815229674.780228314.684631100.20790.0181111
445760060740.743857833.803463793.79780.0219111
453808840160.9438161.135242265.5430.0268011
462491226250.833924894.889827680.63190.0332011
472916030744.875529101.798232480.72050.0368111
482397625252.200523859.072926726.67270.0449011







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
370.0162-0.04380792140.309400
380.0178-0.02650.0351290101.9051541121.1072735.6093
390.0194-0.06780.0462137060.21911073100.81121035.9058
400.0208-0.05130.04745500496.86482179949.82461476.4653
410.0221-0.05110.04816384203.88973020800.63761738.0451
420.0233-0.05110.04861960326.47652844054.94411686.4326
430.0245-0.05130.0492318859.44612769027.01581664.0394
440.0256-0.05170.04939864271.74863655932.60741912.0493
450.0267-0.05160.04964297080.16193727171.22461930.5883
460.0278-0.0510.04971792476.25133533701.72721879.8143
470.0288-0.05150.04992511830.46333440804.33961854.9405
480.0298-0.05050.051628687.82143289794.62981813.7791

\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 & 792140.3094 & 0 & 0 \tabularnewline
38 & 0.0178 & -0.0265 & 0.0351 & 290101.9051 & 541121.1072 & 735.6093 \tabularnewline
39 & 0.0194 & -0.0678 & 0.046 & 2137060.2191 & 1073100.8112 & 1035.9058 \tabularnewline
40 & 0.0208 & -0.0513 & 0.0474 & 5500496.8648 & 2179949.8246 & 1476.4653 \tabularnewline
41 & 0.0221 & -0.0511 & 0.0481 & 6384203.8897 & 3020800.6376 & 1738.0451 \tabularnewline
42 & 0.0233 & -0.0511 & 0.0486 & 1960326.4765 & 2844054.9441 & 1686.4326 \tabularnewline
43 & 0.0245 & -0.0513 & 0.049 & 2318859.4461 & 2769027.0158 & 1664.0394 \tabularnewline
44 & 0.0256 & -0.0517 & 0.0493 & 9864271.7486 & 3655932.6074 & 1912.0493 \tabularnewline
45 & 0.0267 & -0.0516 & 0.0496 & 4297080.1619 & 3727171.2246 & 1930.5883 \tabularnewline
46 & 0.0278 & -0.051 & 0.0497 & 1792476.2513 & 3533701.7272 & 1879.8143 \tabularnewline
47 & 0.0288 & -0.0515 & 0.0499 & 2511830.4633 & 3440804.3396 & 1854.9405 \tabularnewline
48 & 0.0298 & -0.0505 & 0.05 & 1628687.8214 & 3289794.6298 & 1813.7791 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=120427&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]792140.3094[/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]290101.9051[/C][C]541121.1072[/C][C]735.6093[/C][/ROW]
[ROW][C]39[/C][C]0.0194[/C][C]-0.0678[/C][C]0.046[/C][C]2137060.2191[/C][C]1073100.8112[/C][C]1035.9058[/C][/ROW]
[ROW][C]40[/C][C]0.0208[/C][C]-0.0513[/C][C]0.0474[/C][C]5500496.8648[/C][C]2179949.8246[/C][C]1476.4653[/C][/ROW]
[ROW][C]41[/C][C]0.0221[/C][C]-0.0511[/C][C]0.0481[/C][C]6384203.8897[/C][C]3020800.6376[/C][C]1738.0451[/C][/ROW]
[ROW][C]42[/C][C]0.0233[/C][C]-0.0511[/C][C]0.0486[/C][C]1960326.4765[/C][C]2844054.9441[/C][C]1686.4326[/C][/ROW]
[ROW][C]43[/C][C]0.0245[/C][C]-0.0513[/C][C]0.049[/C][C]2318859.4461[/C][C]2769027.0158[/C][C]1664.0394[/C][/ROW]
[ROW][C]44[/C][C]0.0256[/C][C]-0.0517[/C][C]0.0493[/C][C]9864271.7486[/C][C]3655932.6074[/C][C]1912.0493[/C][/ROW]
[ROW][C]45[/C][C]0.0267[/C][C]-0.0516[/C][C]0.0496[/C][C]4297080.1619[/C][C]3727171.2246[/C][C]1930.5883[/C][/ROW]
[ROW][C]46[/C][C]0.0278[/C][C]-0.051[/C][C]0.0497[/C][C]1792476.2513[/C][C]3533701.7272[/C][C]1879.8143[/C][/ROW]
[ROW][C]47[/C][C]0.0288[/C][C]-0.0515[/C][C]0.0499[/C][C]2511830.4633[/C][C]3440804.3396[/C][C]1854.9405[/C][/ROW]
[ROW][C]48[/C][C]0.0298[/C][C]-0.0505[/C][C]0.05[/C][C]1628687.8214[/C][C]3289794.6298[/C][C]1813.7791[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=120427&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=120427&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.04380792140.309400
380.0178-0.02650.0351290101.9051541121.1072735.6093
390.0194-0.06780.0462137060.21911073100.81121035.9058
400.0208-0.05130.04745500496.86482179949.82461476.4653
410.0221-0.05110.04816384203.88973020800.63761738.0451
420.0233-0.05110.04861960326.47652844054.94411686.4326
430.0245-0.05130.0492318859.44612769027.01581664.0394
440.0256-0.05170.04939864271.74863655932.60741912.0493
450.0267-0.05160.04964297080.16193727171.22461930.5883
460.0278-0.0510.04971792476.25133533701.72721879.8143
470.0288-0.05150.04992511830.46333440804.33961854.9405
480.0298-0.05050.051628687.82143289794.62981813.7791



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')