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 computationSun, 26 Dec 2010 13:05:43 +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/2010/Dec/26/t1293368620ty0q14p7njzhkxe.htm/, Retrieved Mon, 06 May 2024 19:11:39 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=115581, Retrieved Mon, 06 May 2024 19:11:39 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact114
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA forecasting] [2010-12-26 13:05:43] [346ac46ef4f6bb745e48fc42fac6253b] [Current]
Feedback Forum

Post a new message
Dataseries X:
104.79
104.82
104.94
105.04
105.17
105.4
105.56
105.66
105.96
105.92
106.03
106.16
106.39
106.41
106.66
106.76
106.97
107.07
107.29
107.39
107.5
107.79
107.77
107.84
108.09
108.28
108.49
108.73
108.84
108.94
109.08
109.38
109.42
109.59
109.83
109.89
110.29
110.33
110.54
110.69
110.77
111.01
111.25
111.09
111.32
111.36
111.31
111.37
111.49
111.49
111.55
111.56
111.66
111.68
111.71
111.76
111.82
111.87
111.94
112.05




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 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 & 2 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=115581&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' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=115581&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=115581&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' @ 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])
36109.89-------
37110.29-------
38110.33-------
39110.54-------
40110.69-------
41110.77-------
42111.01-------
43111.25-------
44111.09-------
45111.32-------
46111.36-------
47111.31-------
48111.37-------
49111.49111.3296111.1297111.52950.05790.346110.3461
50111.49111.3405111.0677111.61330.14140.141410.4161
51111.55111.3516110.966111.73720.15660.240810.4627
52111.56111.3437110.8097111.87780.21370.22450.99180.4616
53111.66111.3596110.6972112.02210.18710.27660.95950.4878
54111.68111.3536110.5358112.17140.2170.23140.79490.4843
55111.71111.3347110.3569112.31250.22590.24440.56740.4718
56111.76111.383110.2452112.52090.25810.28660.69310.5089
57111.82111.372110.0613112.68280.25150.28090.5310.5012
58111.87111.3846109.9003112.86880.26080.28260.51290.5077
59111.94111.4133109.7513113.07530.26730.29510.54850.5204
60112.05111.4253109.5802113.27030.25350.29230.52340.5234

\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 & 109.89 & - & - & - & - & - & - & - \tabularnewline
37 & 110.29 & - & - & - & - & - & - & - \tabularnewline
38 & 110.33 & - & - & - & - & - & - & - \tabularnewline
39 & 110.54 & - & - & - & - & - & - & - \tabularnewline
40 & 110.69 & - & - & - & - & - & - & - \tabularnewline
41 & 110.77 & - & - & - & - & - & - & - \tabularnewline
42 & 111.01 & - & - & - & - & - & - & - \tabularnewline
43 & 111.25 & - & - & - & - & - & - & - \tabularnewline
44 & 111.09 & - & - & - & - & - & - & - \tabularnewline
45 & 111.32 & - & - & - & - & - & - & - \tabularnewline
46 & 111.36 & - & - & - & - & - & - & - \tabularnewline
47 & 111.31 & - & - & - & - & - & - & - \tabularnewline
48 & 111.37 & - & - & - & - & - & - & - \tabularnewline
49 & 111.49 & 111.3296 & 111.1297 & 111.5295 & 0.0579 & 0.3461 & 1 & 0.3461 \tabularnewline
50 & 111.49 & 111.3405 & 111.0677 & 111.6133 & 0.1414 & 0.1414 & 1 & 0.4161 \tabularnewline
51 & 111.55 & 111.3516 & 110.966 & 111.7372 & 0.1566 & 0.2408 & 1 & 0.4627 \tabularnewline
52 & 111.56 & 111.3437 & 110.8097 & 111.8778 & 0.2137 & 0.2245 & 0.9918 & 0.4616 \tabularnewline
53 & 111.66 & 111.3596 & 110.6972 & 112.0221 & 0.1871 & 0.2766 & 0.9595 & 0.4878 \tabularnewline
54 & 111.68 & 111.3536 & 110.5358 & 112.1714 & 0.217 & 0.2314 & 0.7949 & 0.4843 \tabularnewline
55 & 111.71 & 111.3347 & 110.3569 & 112.3125 & 0.2259 & 0.2444 & 0.5674 & 0.4718 \tabularnewline
56 & 111.76 & 111.383 & 110.2452 & 112.5209 & 0.2581 & 0.2866 & 0.6931 & 0.5089 \tabularnewline
57 & 111.82 & 111.372 & 110.0613 & 112.6828 & 0.2515 & 0.2809 & 0.531 & 0.5012 \tabularnewline
58 & 111.87 & 111.3846 & 109.9003 & 112.8688 & 0.2608 & 0.2826 & 0.5129 & 0.5077 \tabularnewline
59 & 111.94 & 111.4133 & 109.7513 & 113.0753 & 0.2673 & 0.2951 & 0.5485 & 0.5204 \tabularnewline
60 & 112.05 & 111.4253 & 109.5802 & 113.2703 & 0.2535 & 0.2923 & 0.5234 & 0.5234 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=115581&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]109.89[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]110.29[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]110.33[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]110.54[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]110.69[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]110.77[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]111.01[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]111.25[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]111.09[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]111.32[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]111.36[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]111.31[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]111.37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]111.49[/C][C]111.3296[/C][C]111.1297[/C][C]111.5295[/C][C]0.0579[/C][C]0.3461[/C][C]1[/C][C]0.3461[/C][/ROW]
[ROW][C]50[/C][C]111.49[/C][C]111.3405[/C][C]111.0677[/C][C]111.6133[/C][C]0.1414[/C][C]0.1414[/C][C]1[/C][C]0.4161[/C][/ROW]
[ROW][C]51[/C][C]111.55[/C][C]111.3516[/C][C]110.966[/C][C]111.7372[/C][C]0.1566[/C][C]0.2408[/C][C]1[/C][C]0.4627[/C][/ROW]
[ROW][C]52[/C][C]111.56[/C][C]111.3437[/C][C]110.8097[/C][C]111.8778[/C][C]0.2137[/C][C]0.2245[/C][C]0.9918[/C][C]0.4616[/C][/ROW]
[ROW][C]53[/C][C]111.66[/C][C]111.3596[/C][C]110.6972[/C][C]112.0221[/C][C]0.1871[/C][C]0.2766[/C][C]0.9595[/C][C]0.4878[/C][/ROW]
[ROW][C]54[/C][C]111.68[/C][C]111.3536[/C][C]110.5358[/C][C]112.1714[/C][C]0.217[/C][C]0.2314[/C][C]0.7949[/C][C]0.4843[/C][/ROW]
[ROW][C]55[/C][C]111.71[/C][C]111.3347[/C][C]110.3569[/C][C]112.3125[/C][C]0.2259[/C][C]0.2444[/C][C]0.5674[/C][C]0.4718[/C][/ROW]
[ROW][C]56[/C][C]111.76[/C][C]111.383[/C][C]110.2452[/C][C]112.5209[/C][C]0.2581[/C][C]0.2866[/C][C]0.6931[/C][C]0.5089[/C][/ROW]
[ROW][C]57[/C][C]111.82[/C][C]111.372[/C][C]110.0613[/C][C]112.6828[/C][C]0.2515[/C][C]0.2809[/C][C]0.531[/C][C]0.5012[/C][/ROW]
[ROW][C]58[/C][C]111.87[/C][C]111.3846[/C][C]109.9003[/C][C]112.8688[/C][C]0.2608[/C][C]0.2826[/C][C]0.5129[/C][C]0.5077[/C][/ROW]
[ROW][C]59[/C][C]111.94[/C][C]111.4133[/C][C]109.7513[/C][C]113.0753[/C][C]0.2673[/C][C]0.2951[/C][C]0.5485[/C][C]0.5204[/C][/ROW]
[ROW][C]60[/C][C]112.05[/C][C]111.4253[/C][C]109.5802[/C][C]113.2703[/C][C]0.2535[/C][C]0.2923[/C][C]0.5234[/C][C]0.5234[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=115581&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=115581&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])
36109.89-------
37110.29-------
38110.33-------
39110.54-------
40110.69-------
41110.77-------
42111.01-------
43111.25-------
44111.09-------
45111.32-------
46111.36-------
47111.31-------
48111.37-------
49111.49111.3296111.1297111.52950.05790.346110.3461
50111.49111.3405111.0677111.61330.14140.141410.4161
51111.55111.3516110.966111.73720.15660.240810.4627
52111.56111.3437110.8097111.87780.21370.22450.99180.4616
53111.66111.3596110.6972112.02210.18710.27660.95950.4878
54111.68111.3536110.5358112.17140.2170.23140.79490.4843
55111.71111.3347110.3569112.31250.22590.24440.56740.4718
56111.76111.383110.2452112.52090.25810.28660.69310.5089
57111.82111.372110.0613112.68280.25150.28090.5310.5012
58111.87111.3846109.9003112.86880.26080.28260.51290.5077
59111.94111.4133109.7513113.07530.26730.29510.54850.5204
60112.05111.4253109.5802113.27030.25350.29230.52340.5234







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
499e-040.001400.025700
500.00130.00130.00140.02230.0240.155
510.00180.00180.00150.03940.02910.1707
520.00240.00190.00160.04680.03360.1832
530.0030.00270.00180.09020.04490.2119
540.00370.00290.0020.10650.05520.2349
550.00450.00340.00220.14090.06740.2596
560.00520.00340.00240.14210.07670.277
570.0060.0040.00250.20070.09050.3009
580.00680.00440.00270.23560.1050.3241
590.00760.00470.00290.27740.12070.3474
600.00840.00560.00310.39030.14320.3784

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 9e-04 & 0.0014 & 0 & 0.0257 & 0 & 0 \tabularnewline
50 & 0.0013 & 0.0013 & 0.0014 & 0.0223 & 0.024 & 0.155 \tabularnewline
51 & 0.0018 & 0.0018 & 0.0015 & 0.0394 & 0.0291 & 0.1707 \tabularnewline
52 & 0.0024 & 0.0019 & 0.0016 & 0.0468 & 0.0336 & 0.1832 \tabularnewline
53 & 0.003 & 0.0027 & 0.0018 & 0.0902 & 0.0449 & 0.2119 \tabularnewline
54 & 0.0037 & 0.0029 & 0.002 & 0.1065 & 0.0552 & 0.2349 \tabularnewline
55 & 0.0045 & 0.0034 & 0.0022 & 0.1409 & 0.0674 & 0.2596 \tabularnewline
56 & 0.0052 & 0.0034 & 0.0024 & 0.1421 & 0.0767 & 0.277 \tabularnewline
57 & 0.006 & 0.004 & 0.0025 & 0.2007 & 0.0905 & 0.3009 \tabularnewline
58 & 0.0068 & 0.0044 & 0.0027 & 0.2356 & 0.105 & 0.3241 \tabularnewline
59 & 0.0076 & 0.0047 & 0.0029 & 0.2774 & 0.1207 & 0.3474 \tabularnewline
60 & 0.0084 & 0.0056 & 0.0031 & 0.3903 & 0.1432 & 0.3784 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=115581&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]9e-04[/C][C]0.0014[/C][C]0[/C][C]0.0257[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0013[/C][C]0.0013[/C][C]0.0014[/C][C]0.0223[/C][C]0.024[/C][C]0.155[/C][/ROW]
[ROW][C]51[/C][C]0.0018[/C][C]0.0018[/C][C]0.0015[/C][C]0.0394[/C][C]0.0291[/C][C]0.1707[/C][/ROW]
[ROW][C]52[/C][C]0.0024[/C][C]0.0019[/C][C]0.0016[/C][C]0.0468[/C][C]0.0336[/C][C]0.1832[/C][/ROW]
[ROW][C]53[/C][C]0.003[/C][C]0.0027[/C][C]0.0018[/C][C]0.0902[/C][C]0.0449[/C][C]0.2119[/C][/ROW]
[ROW][C]54[/C][C]0.0037[/C][C]0.0029[/C][C]0.002[/C][C]0.1065[/C][C]0.0552[/C][C]0.2349[/C][/ROW]
[ROW][C]55[/C][C]0.0045[/C][C]0.0034[/C][C]0.0022[/C][C]0.1409[/C][C]0.0674[/C][C]0.2596[/C][/ROW]
[ROW][C]56[/C][C]0.0052[/C][C]0.0034[/C][C]0.0024[/C][C]0.1421[/C][C]0.0767[/C][C]0.277[/C][/ROW]
[ROW][C]57[/C][C]0.006[/C][C]0.004[/C][C]0.0025[/C][C]0.2007[/C][C]0.0905[/C][C]0.3009[/C][/ROW]
[ROW][C]58[/C][C]0.0068[/C][C]0.0044[/C][C]0.0027[/C][C]0.2356[/C][C]0.105[/C][C]0.3241[/C][/ROW]
[ROW][C]59[/C][C]0.0076[/C][C]0.0047[/C][C]0.0029[/C][C]0.2774[/C][C]0.1207[/C][C]0.3474[/C][/ROW]
[ROW][C]60[/C][C]0.0084[/C][C]0.0056[/C][C]0.0031[/C][C]0.3903[/C][C]0.1432[/C][C]0.3784[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=115581&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=115581&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
499e-040.001400.025700
500.00130.00130.00140.02230.0240.155
510.00180.00180.00150.03940.02910.1707
520.00240.00190.00160.04680.03360.1832
530.0030.00270.00180.09020.04490.2119
540.00370.00290.0020.10650.05520.2349
550.00450.00340.00220.14090.06740.2596
560.00520.00340.00240.14210.07670.277
570.0060.0040.00250.20070.09050.3009
580.00680.00440.00270.23560.1050.3241
590.00760.00470.00290.27740.12070.3474
600.00840.00560.00310.39030.14320.3784



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