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 computationSat, 12 Dec 2009 07:01:21 -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/2009/Dec/12/t1260626705z2r7zxgx942cjdw.htm/, Retrieved Mon, 29 Apr 2024 11:23:45 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=66964, Retrieved Mon, 29 Apr 2024 11:23:45 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact162
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Bivariate Granger Causality] [] [2009-12-07 08:54:13] [b98453cac15ba1066b407e146608df68]
- R PD  [Bivariate Granger Causality] [] [2009-12-09 15:50:46] [4f76e114ed5e444b1133aad392380aad]
- RMPD      [ARIMA Forecasting] [workshop 10] [2009-12-12 14:01:21] [aef022288383377281176d9807aba5bf] [Current]
Feedback Forum

Post a new message
Dataseries X:
2,86
2,55
2,28
2,26
2,57
3,08
2,76
2,51
2,87
3,14
3,12
3,16
2,48
2,57
2,88
2,63
2,38
1,69
1,96
2,19
1,87
1,6
1,63
1,22
1,21
1,49
1,64
1,66
1,77
1,82
1,78
1,28
1,29
1,37
1,12
1,51
2,24
2,94
3,09
3,46
3,64
4,39
4,15
5,21
5,8
5,91
5,39
5,46
4,72
3,14
2,63
2,32
1,93
0,62
0,6
-0,37
-1,1
-1,68
-0,78
-1,19




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

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

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







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])
361.51-------
372.24-------
382.94-------
393.09-------
403.46-------
413.64-------
424.39-------
434.15-------
445.21-------
455.8-------
465.91-------
475.39-------
485.46-------
494.725.19874.49635.90120.09080.23310.233
503.144.94823.95485.94162e-040.673710.1563
512.634.89453.67796.11121e-040.99760.99820.1812
522.324.76213.35726.1673e-040.99850.96540.1651
531.934.69773.1276.26843e-040.99850.90660.1707
540.624.42932.70876.149900.99780.51780.1202
550.64.51522.65676.3736010.64990.1595
56-0.374.13582.1496.122600.99980.14460.0957
57-1.13.92461.81736.0319010.04060.0766
58-1.683.88531.6646.1065010.0370.0823
59-0.784.07141.74176.4011010.13360.1213
60-1.194.04631.6136.479600.99990.12740.1274

\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 & 1.51 & - & - & - & - & - & - & - \tabularnewline
37 & 2.24 & - & - & - & - & - & - & - \tabularnewline
38 & 2.94 & - & - & - & - & - & - & - \tabularnewline
39 & 3.09 & - & - & - & - & - & - & - \tabularnewline
40 & 3.46 & - & - & - & - & - & - & - \tabularnewline
41 & 3.64 & - & - & - & - & - & - & - \tabularnewline
42 & 4.39 & - & - & - & - & - & - & - \tabularnewline
43 & 4.15 & - & - & - & - & - & - & - \tabularnewline
44 & 5.21 & - & - & - & - & - & - & - \tabularnewline
45 & 5.8 & - & - & - & - & - & - & - \tabularnewline
46 & 5.91 & - & - & - & - & - & - & - \tabularnewline
47 & 5.39 & - & - & - & - & - & - & - \tabularnewline
48 & 5.46 & - & - & - & - & - & - & - \tabularnewline
49 & 4.72 & 5.1987 & 4.4963 & 5.9012 & 0.0908 & 0.233 & 1 & 0.233 \tabularnewline
50 & 3.14 & 4.9482 & 3.9548 & 5.9416 & 2e-04 & 0.6737 & 1 & 0.1563 \tabularnewline
51 & 2.63 & 4.8945 & 3.6779 & 6.1112 & 1e-04 & 0.9976 & 0.9982 & 0.1812 \tabularnewline
52 & 2.32 & 4.7621 & 3.3572 & 6.167 & 3e-04 & 0.9985 & 0.9654 & 0.1651 \tabularnewline
53 & 1.93 & 4.6977 & 3.127 & 6.2684 & 3e-04 & 0.9985 & 0.9066 & 0.1707 \tabularnewline
54 & 0.62 & 4.4293 & 2.7087 & 6.1499 & 0 & 0.9978 & 0.5178 & 0.1202 \tabularnewline
55 & 0.6 & 4.5152 & 2.6567 & 6.3736 & 0 & 1 & 0.6499 & 0.1595 \tabularnewline
56 & -0.37 & 4.1358 & 2.149 & 6.1226 & 0 & 0.9998 & 0.1446 & 0.0957 \tabularnewline
57 & -1.1 & 3.9246 & 1.8173 & 6.0319 & 0 & 1 & 0.0406 & 0.0766 \tabularnewline
58 & -1.68 & 3.8853 & 1.664 & 6.1065 & 0 & 1 & 0.037 & 0.0823 \tabularnewline
59 & -0.78 & 4.0714 & 1.7417 & 6.4011 & 0 & 1 & 0.1336 & 0.1213 \tabularnewline
60 & -1.19 & 4.0463 & 1.613 & 6.4796 & 0 & 0.9999 & 0.1274 & 0.1274 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66964&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]1.51[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]2.24[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]2.94[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]3.09[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]3.46[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]3.64[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]4.39[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]4.15[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]5.21[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]5.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]5.91[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]5.39[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]5.46[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]4.72[/C][C]5.1987[/C][C]4.4963[/C][C]5.9012[/C][C]0.0908[/C][C]0.233[/C][C]1[/C][C]0.233[/C][/ROW]
[ROW][C]50[/C][C]3.14[/C][C]4.9482[/C][C]3.9548[/C][C]5.9416[/C][C]2e-04[/C][C]0.6737[/C][C]1[/C][C]0.1563[/C][/ROW]
[ROW][C]51[/C][C]2.63[/C][C]4.8945[/C][C]3.6779[/C][C]6.1112[/C][C]1e-04[/C][C]0.9976[/C][C]0.9982[/C][C]0.1812[/C][/ROW]
[ROW][C]52[/C][C]2.32[/C][C]4.7621[/C][C]3.3572[/C][C]6.167[/C][C]3e-04[/C][C]0.9985[/C][C]0.9654[/C][C]0.1651[/C][/ROW]
[ROW][C]53[/C][C]1.93[/C][C]4.6977[/C][C]3.127[/C][C]6.2684[/C][C]3e-04[/C][C]0.9985[/C][C]0.9066[/C][C]0.1707[/C][/ROW]
[ROW][C]54[/C][C]0.62[/C][C]4.4293[/C][C]2.7087[/C][C]6.1499[/C][C]0[/C][C]0.9978[/C][C]0.5178[/C][C]0.1202[/C][/ROW]
[ROW][C]55[/C][C]0.6[/C][C]4.5152[/C][C]2.6567[/C][C]6.3736[/C][C]0[/C][C]1[/C][C]0.6499[/C][C]0.1595[/C][/ROW]
[ROW][C]56[/C][C]-0.37[/C][C]4.1358[/C][C]2.149[/C][C]6.1226[/C][C]0[/C][C]0.9998[/C][C]0.1446[/C][C]0.0957[/C][/ROW]
[ROW][C]57[/C][C]-1.1[/C][C]3.9246[/C][C]1.8173[/C][C]6.0319[/C][C]0[/C][C]1[/C][C]0.0406[/C][C]0.0766[/C][/ROW]
[ROW][C]58[/C][C]-1.68[/C][C]3.8853[/C][C]1.664[/C][C]6.1065[/C][C]0[/C][C]1[/C][C]0.037[/C][C]0.0823[/C][/ROW]
[ROW][C]59[/C][C]-0.78[/C][C]4.0714[/C][C]1.7417[/C][C]6.4011[/C][C]0[/C][C]1[/C][C]0.1336[/C][C]0.1213[/C][/ROW]
[ROW][C]60[/C][C]-1.19[/C][C]4.0463[/C][C]1.613[/C][C]6.4796[/C][C]0[/C][C]0.9999[/C][C]0.1274[/C][C]0.1274[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66964&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66964&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])
361.51-------
372.24-------
382.94-------
393.09-------
403.46-------
413.64-------
424.39-------
434.15-------
445.21-------
455.8-------
465.91-------
475.39-------
485.46-------
494.725.19874.49635.90120.09080.23310.233
503.144.94823.95485.94162e-040.673710.1563
512.634.89453.67796.11121e-040.99760.99820.1812
522.324.76213.35726.1673e-040.99850.96540.1651
531.934.69773.1276.26843e-040.99850.90660.1707
540.624.42932.70876.149900.99780.51780.1202
550.64.51522.65676.3736010.64990.1595
56-0.374.13582.1496.122600.99980.14460.0957
57-1.13.92461.81736.0319010.04060.0766
58-1.683.88531.6646.1065010.0370.0823
59-0.784.07141.74176.4011010.13360.1213
60-1.194.04631.6136.479600.99990.12740.1274







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0689-0.092100.229200
500.1024-0.36540.22883.26961.74941.3227
510.1268-0.46270.30675.12812.87561.6958
520.1505-0.51280.35835.96393.64771.9099
530.1706-0.58920.40447.66014.45022.1095
540.1982-0.860.480414.51056.12692.4753
550.21-0.86710.535615.32857.44142.7279
560.2451-1.08950.604820.30229.0493.0082
570.2739-1.28030.679925.24710.84883.2937
580.2917-1.43240.755130.972212.86113.5862
590.2919-1.19160.794823.535813.83153.7191
600.3068-1.29410.836427.41914.96383.8683

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0689 & -0.0921 & 0 & 0.2292 & 0 & 0 \tabularnewline
50 & 0.1024 & -0.3654 & 0.2288 & 3.2696 & 1.7494 & 1.3227 \tabularnewline
51 & 0.1268 & -0.4627 & 0.3067 & 5.1281 & 2.8756 & 1.6958 \tabularnewline
52 & 0.1505 & -0.5128 & 0.3583 & 5.9639 & 3.6477 & 1.9099 \tabularnewline
53 & 0.1706 & -0.5892 & 0.4044 & 7.6601 & 4.4502 & 2.1095 \tabularnewline
54 & 0.1982 & -0.86 & 0.4804 & 14.5105 & 6.1269 & 2.4753 \tabularnewline
55 & 0.21 & -0.8671 & 0.5356 & 15.3285 & 7.4414 & 2.7279 \tabularnewline
56 & 0.2451 & -1.0895 & 0.6048 & 20.3022 & 9.049 & 3.0082 \tabularnewline
57 & 0.2739 & -1.2803 & 0.6799 & 25.247 & 10.8488 & 3.2937 \tabularnewline
58 & 0.2917 & -1.4324 & 0.7551 & 30.9722 & 12.8611 & 3.5862 \tabularnewline
59 & 0.2919 & -1.1916 & 0.7948 & 23.5358 & 13.8315 & 3.7191 \tabularnewline
60 & 0.3068 & -1.2941 & 0.8364 & 27.419 & 14.9638 & 3.8683 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66964&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.0689[/C][C]-0.0921[/C][C]0[/C][C]0.2292[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.1024[/C][C]-0.3654[/C][C]0.2288[/C][C]3.2696[/C][C]1.7494[/C][C]1.3227[/C][/ROW]
[ROW][C]51[/C][C]0.1268[/C][C]-0.4627[/C][C]0.3067[/C][C]5.1281[/C][C]2.8756[/C][C]1.6958[/C][/ROW]
[ROW][C]52[/C][C]0.1505[/C][C]-0.5128[/C][C]0.3583[/C][C]5.9639[/C][C]3.6477[/C][C]1.9099[/C][/ROW]
[ROW][C]53[/C][C]0.1706[/C][C]-0.5892[/C][C]0.4044[/C][C]7.6601[/C][C]4.4502[/C][C]2.1095[/C][/ROW]
[ROW][C]54[/C][C]0.1982[/C][C]-0.86[/C][C]0.4804[/C][C]14.5105[/C][C]6.1269[/C][C]2.4753[/C][/ROW]
[ROW][C]55[/C][C]0.21[/C][C]-0.8671[/C][C]0.5356[/C][C]15.3285[/C][C]7.4414[/C][C]2.7279[/C][/ROW]
[ROW][C]56[/C][C]0.2451[/C][C]-1.0895[/C][C]0.6048[/C][C]20.3022[/C][C]9.049[/C][C]3.0082[/C][/ROW]
[ROW][C]57[/C][C]0.2739[/C][C]-1.2803[/C][C]0.6799[/C][C]25.247[/C][C]10.8488[/C][C]3.2937[/C][/ROW]
[ROW][C]58[/C][C]0.2917[/C][C]-1.4324[/C][C]0.7551[/C][C]30.9722[/C][C]12.8611[/C][C]3.5862[/C][/ROW]
[ROW][C]59[/C][C]0.2919[/C][C]-1.1916[/C][C]0.7948[/C][C]23.5358[/C][C]13.8315[/C][C]3.7191[/C][/ROW]
[ROW][C]60[/C][C]0.3068[/C][C]-1.2941[/C][C]0.8364[/C][C]27.419[/C][C]14.9638[/C][C]3.8683[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66964&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66964&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.0689-0.092100.229200
500.1024-0.36540.22883.26961.74941.3227
510.1268-0.46270.30675.12812.87561.6958
520.1505-0.51280.35835.96393.64771.9099
530.1706-0.58920.40447.66014.45022.1095
540.1982-0.860.480414.51056.12692.4753
550.21-0.86710.535615.32857.44142.7279
560.2451-1.08950.604820.30229.0493.0082
570.2739-1.28030.679925.24710.84883.2937
580.2917-1.43240.755130.972212.86113.5862
590.2919-1.19160.794823.535813.83153.7191
600.3068-1.29410.836427.41914.96383.8683



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