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 computationThu, 17 Dec 2009 13:42:31 -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/17/t1261082588d6058wbfhx65h1k.htm/, Retrieved Tue, 30 Apr 2024 04:16:00 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69104, Retrieved Tue, 30 Apr 2024 04:16:00 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact100
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
- R PD  [ARIMA Forecasting] [WorkShop10 (SHW)] [2009-12-14 19:20:00] [37daf76adc256428993ec4063536c760]
- R PD      [ARIMA Forecasting] [workshop 10 verbe...] [2009-12-17 20:42:31] [b653746fe14da1ddc21bd75262e8c46b] [Current]
Feedback Forum

Post a new message
Dataseries X:
5.4
5.4
5.6
5.7
5.8
5.8
5.8
5.9
6.1
6.4
6.4
6.3
6.2
6.2
6.3
6.4
6.5
6.6
6.6
6.6
6.8
7
7.2
7.3
7.5
7.6
7.6
7.7
7.7
7.7
7.7
7.6
7.7
7.9
7.9
7.9
7.8
7.6
7.4
7
7
7.2
7.5
7.8
7.8
7.7
7.6
7.6
7.5
7.5
7.6
7.6
7.9
7.6
7.5
7.5
7.6
7.7
7.8
7.9
7.9




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=69104&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=69104&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69104&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[49])
377.8-------
387.6-------
397.4-------
407-------
417-------
427.2-------
437.5-------
447.8-------
457.8-------
467.7-------
477.6-------
487.6-------
497.5-------
507.57.32947.09027.56860.08110.08110.01330.0811
517.66.98096.57.46190.00580.01720.04380.0172
527.66.48525.75867.21180.00130.00130.08250.0031
537.96.53835.57817.49850.00270.01510.1730.0248
547.66.78825.69217.88440.07330.02340.23080.1016
557.57.08775.88348.2920.25110.20220.25110.2511
567.57.36146.05388.66890.41770.41770.25540.4177
577.67.35495.94028.76960.36710.42030.26870.4203
587.77.26325.74988.77670.28580.33140.28580.3796
597.87.16975.56688.77260.22040.25840.29940.3432
607.97.16775.48178.85370.19730.23120.30760.3496
617.97.06445.29798.83090.17690.17690.31440.3144

\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[49]) \tabularnewline
37 & 7.8 & - & - & - & - & - & - & - \tabularnewline
38 & 7.6 & - & - & - & - & - & - & - \tabularnewline
39 & 7.4 & - & - & - & - & - & - & - \tabularnewline
40 & 7 & - & - & - & - & - & - & - \tabularnewline
41 & 7 & - & - & - & - & - & - & - \tabularnewline
42 & 7.2 & - & - & - & - & - & - & - \tabularnewline
43 & 7.5 & - & - & - & - & - & - & - \tabularnewline
44 & 7.8 & - & - & - & - & - & - & - \tabularnewline
45 & 7.8 & - & - & - & - & - & - & - \tabularnewline
46 & 7.7 & - & - & - & - & - & - & - \tabularnewline
47 & 7.6 & - & - & - & - & - & - & - \tabularnewline
48 & 7.6 & - & - & - & - & - & - & - \tabularnewline
49 & 7.5 & - & - & - & - & - & - & - \tabularnewline
50 & 7.5 & 7.3294 & 7.0902 & 7.5686 & 0.0811 & 0.0811 & 0.0133 & 0.0811 \tabularnewline
51 & 7.6 & 6.9809 & 6.5 & 7.4619 & 0.0058 & 0.0172 & 0.0438 & 0.0172 \tabularnewline
52 & 7.6 & 6.4852 & 5.7586 & 7.2118 & 0.0013 & 0.0013 & 0.0825 & 0.0031 \tabularnewline
53 & 7.9 & 6.5383 & 5.5781 & 7.4985 & 0.0027 & 0.0151 & 0.173 & 0.0248 \tabularnewline
54 & 7.6 & 6.7882 & 5.6921 & 7.8844 & 0.0733 & 0.0234 & 0.2308 & 0.1016 \tabularnewline
55 & 7.5 & 7.0877 & 5.8834 & 8.292 & 0.2511 & 0.2022 & 0.2511 & 0.2511 \tabularnewline
56 & 7.5 & 7.3614 & 6.0538 & 8.6689 & 0.4177 & 0.4177 & 0.2554 & 0.4177 \tabularnewline
57 & 7.6 & 7.3549 & 5.9402 & 8.7696 & 0.3671 & 0.4203 & 0.2687 & 0.4203 \tabularnewline
58 & 7.7 & 7.2632 & 5.7498 & 8.7767 & 0.2858 & 0.3314 & 0.2858 & 0.3796 \tabularnewline
59 & 7.8 & 7.1697 & 5.5668 & 8.7726 & 0.2204 & 0.2584 & 0.2994 & 0.3432 \tabularnewline
60 & 7.9 & 7.1677 & 5.4817 & 8.8537 & 0.1973 & 0.2312 & 0.3076 & 0.3496 \tabularnewline
61 & 7.9 & 7.0644 & 5.2979 & 8.8309 & 0.1769 & 0.1769 & 0.3144 & 0.3144 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69104&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[49])[/C][/ROW]
[ROW][C]37[/C][C]7.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]7.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]7.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]7.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]7.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]7.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]7.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]7.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]7.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]7.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]7.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]7.5[/C][C]7.3294[/C][C]7.0902[/C][C]7.5686[/C][C]0.0811[/C][C]0.0811[/C][C]0.0133[/C][C]0.0811[/C][/ROW]
[ROW][C]51[/C][C]7.6[/C][C]6.9809[/C][C]6.5[/C][C]7.4619[/C][C]0.0058[/C][C]0.0172[/C][C]0.0438[/C][C]0.0172[/C][/ROW]
[ROW][C]52[/C][C]7.6[/C][C]6.4852[/C][C]5.7586[/C][C]7.2118[/C][C]0.0013[/C][C]0.0013[/C][C]0.0825[/C][C]0.0031[/C][/ROW]
[ROW][C]53[/C][C]7.9[/C][C]6.5383[/C][C]5.5781[/C][C]7.4985[/C][C]0.0027[/C][C]0.0151[/C][C]0.173[/C][C]0.0248[/C][/ROW]
[ROW][C]54[/C][C]7.6[/C][C]6.7882[/C][C]5.6921[/C][C]7.8844[/C][C]0.0733[/C][C]0.0234[/C][C]0.2308[/C][C]0.1016[/C][/ROW]
[ROW][C]55[/C][C]7.5[/C][C]7.0877[/C][C]5.8834[/C][C]8.292[/C][C]0.2511[/C][C]0.2022[/C][C]0.2511[/C][C]0.2511[/C][/ROW]
[ROW][C]56[/C][C]7.5[/C][C]7.3614[/C][C]6.0538[/C][C]8.6689[/C][C]0.4177[/C][C]0.4177[/C][C]0.2554[/C][C]0.4177[/C][/ROW]
[ROW][C]57[/C][C]7.6[/C][C]7.3549[/C][C]5.9402[/C][C]8.7696[/C][C]0.3671[/C][C]0.4203[/C][C]0.2687[/C][C]0.4203[/C][/ROW]
[ROW][C]58[/C][C]7.7[/C][C]7.2632[/C][C]5.7498[/C][C]8.7767[/C][C]0.2858[/C][C]0.3314[/C][C]0.2858[/C][C]0.3796[/C][/ROW]
[ROW][C]59[/C][C]7.8[/C][C]7.1697[/C][C]5.5668[/C][C]8.7726[/C][C]0.2204[/C][C]0.2584[/C][C]0.2994[/C][C]0.3432[/C][/ROW]
[ROW][C]60[/C][C]7.9[/C][C]7.1677[/C][C]5.4817[/C][C]8.8537[/C][C]0.1973[/C][C]0.2312[/C][C]0.3076[/C][C]0.3496[/C][/ROW]
[ROW][C]61[/C][C]7.9[/C][C]7.0644[/C][C]5.2979[/C][C]8.8309[/C][C]0.1769[/C][C]0.1769[/C][C]0.3144[/C][C]0.3144[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69104&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69104&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[49])
377.8-------
387.6-------
397.4-------
407-------
417-------
427.2-------
437.5-------
447.8-------
457.8-------
467.7-------
477.6-------
487.6-------
497.5-------
507.57.32947.09027.56860.08110.08110.01330.0811
517.66.98096.57.46190.00580.01720.04380.0172
527.66.48525.75867.21180.00130.00130.08250.0031
537.96.53835.57817.49850.00270.01510.1730.0248
547.66.78825.69217.88440.07330.02340.23080.1016
557.57.08775.88348.2920.25110.20220.25110.2511
567.57.36146.05388.66890.41770.41770.25540.4177
577.67.35495.94028.76960.36710.42030.26870.4203
587.77.26325.74988.77670.28580.33140.28580.3796
597.87.16975.56688.77260.22040.25840.29940.3432
607.97.16775.48178.85370.19730.23120.30760.3496
617.97.06445.29798.83090.17690.17690.31440.3144







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.01660.023300.029100
510.03520.08870.0560.38330.20620.4541
520.05720.17190.09461.24280.55170.7428
530.07490.20830.1231.85420.87730.9367
540.08240.11960.12230.6590.83370.9131
550.08670.05820.11160.170.72310.8503
560.09060.01880.09840.01920.62250.789
570.09810.03330.09030.06010.55220.7431
580.10630.06010.08690.19080.5120.7156
590.11410.08790.0870.39730.50060.7075
600.120.10220.08840.53620.50380.7098
610.12760.11830.09090.69820.520.7211

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0166 & 0.0233 & 0 & 0.0291 & 0 & 0 \tabularnewline
51 & 0.0352 & 0.0887 & 0.056 & 0.3833 & 0.2062 & 0.4541 \tabularnewline
52 & 0.0572 & 0.1719 & 0.0946 & 1.2428 & 0.5517 & 0.7428 \tabularnewline
53 & 0.0749 & 0.2083 & 0.123 & 1.8542 & 0.8773 & 0.9367 \tabularnewline
54 & 0.0824 & 0.1196 & 0.1223 & 0.659 & 0.8337 & 0.9131 \tabularnewline
55 & 0.0867 & 0.0582 & 0.1116 & 0.17 & 0.7231 & 0.8503 \tabularnewline
56 & 0.0906 & 0.0188 & 0.0984 & 0.0192 & 0.6225 & 0.789 \tabularnewline
57 & 0.0981 & 0.0333 & 0.0903 & 0.0601 & 0.5522 & 0.7431 \tabularnewline
58 & 0.1063 & 0.0601 & 0.0869 & 0.1908 & 0.512 & 0.7156 \tabularnewline
59 & 0.1141 & 0.0879 & 0.087 & 0.3973 & 0.5006 & 0.7075 \tabularnewline
60 & 0.12 & 0.1022 & 0.0884 & 0.5362 & 0.5038 & 0.7098 \tabularnewline
61 & 0.1276 & 0.1183 & 0.0909 & 0.6982 & 0.52 & 0.7211 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69104&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]50[/C][C]0.0166[/C][C]0.0233[/C][C]0[/C][C]0.0291[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]0.0352[/C][C]0.0887[/C][C]0.056[/C][C]0.3833[/C][C]0.2062[/C][C]0.4541[/C][/ROW]
[ROW][C]52[/C][C]0.0572[/C][C]0.1719[/C][C]0.0946[/C][C]1.2428[/C][C]0.5517[/C][C]0.7428[/C][/ROW]
[ROW][C]53[/C][C]0.0749[/C][C]0.2083[/C][C]0.123[/C][C]1.8542[/C][C]0.8773[/C][C]0.9367[/C][/ROW]
[ROW][C]54[/C][C]0.0824[/C][C]0.1196[/C][C]0.1223[/C][C]0.659[/C][C]0.8337[/C][C]0.9131[/C][/ROW]
[ROW][C]55[/C][C]0.0867[/C][C]0.0582[/C][C]0.1116[/C][C]0.17[/C][C]0.7231[/C][C]0.8503[/C][/ROW]
[ROW][C]56[/C][C]0.0906[/C][C]0.0188[/C][C]0.0984[/C][C]0.0192[/C][C]0.6225[/C][C]0.789[/C][/ROW]
[ROW][C]57[/C][C]0.0981[/C][C]0.0333[/C][C]0.0903[/C][C]0.0601[/C][C]0.5522[/C][C]0.7431[/C][/ROW]
[ROW][C]58[/C][C]0.1063[/C][C]0.0601[/C][C]0.0869[/C][C]0.1908[/C][C]0.512[/C][C]0.7156[/C][/ROW]
[ROW][C]59[/C][C]0.1141[/C][C]0.0879[/C][C]0.087[/C][C]0.3973[/C][C]0.5006[/C][C]0.7075[/C][/ROW]
[ROW][C]60[/C][C]0.12[/C][C]0.1022[/C][C]0.0884[/C][C]0.5362[/C][C]0.5038[/C][C]0.7098[/C][/ROW]
[ROW][C]61[/C][C]0.1276[/C][C]0.1183[/C][C]0.0909[/C][C]0.6982[/C][C]0.52[/C][C]0.7211[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69104&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69104&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
500.01660.023300.029100
510.03520.08870.0560.38330.20620.4541
520.05720.17190.09461.24280.55170.7428
530.07490.20830.1231.85420.87730.9367
540.08240.11960.12230.6590.83370.9131
550.08670.05820.11160.170.72310.8503
560.09060.01880.09840.01920.62250.789
570.09810.03330.09030.06010.55220.7431
580.10630.06010.08690.19080.5120.7156
590.11410.08790.0870.39730.50060.7075
600.120.10220.08840.53620.50380.7098
610.12760.11830.09090.69820.520.7211



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