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 computationWed, 29 Dec 2010 22:19:17 +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/29/t12936610338i0q4ws8etvw9dp.htm/, Retrieved Fri, 03 May 2024 10:48:55 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=117171, Retrieved Fri, 03 May 2024 10:48:55 +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] [] [2010-12-29 22:19:17] [76d5107cfd0c78d23318a36a1ce43bff] [Current]
- R P     [ARIMA Forecasting] [] [2011-12-21 21:03:41] [3931071255a6f7f4a767409781cc5f7d]
-   P       [ARIMA Forecasting] [] [2011-12-21 21:30:16] [3931071255a6f7f4a767409781cc5f7d]
Feedback Forum

Post a new message
Dataseries X:
5.921
4.561
4.399
4.249
4.211
4.081
4.131
4.071
3.841
4.109
4.354
4.402
4.954
4.137
4.561
4.210
4.429
4.190
4.196
4.226
3.878
3.931
4.115
4.679
5.385
4.387
4.552
4.325
4.179
4.054
4.075
4.147
4.046
4.368
4.097
4.821
4.965
4.425
4.601
4.521
4.193
4.039
4.099
4.109
4.024
4.245
4.252
5.136
5.037
4.230
4.408
4.119
4.083
4.010
4.148
3.952
3.843
4.164
4.075
4.708




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' @ 72.249.76.132

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

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







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])
364.821-------
374.965-------
384.425-------
394.601-------
404.521-------
414.193-------
424.039-------
434.099-------
444.109-------
454.024-------
464.245-------
474.252-------
485.136-------
495.0375.26644.83365.69920.14940.72270.91390.7227
504.234.44873.98634.91110.1770.00630.540.0018
514.4084.59454.12815.0610.21660.93720.48910.0114
524.1194.43363.96664.90060.09340.54270.35680.0016
534.0834.21813.75114.68520.28530.66130.5421e-04
544.014.06193.59484.5290.41390.46470.53820
554.1484.10553.63844.57260.42920.65570.51090
563.9524.12863.66154.59570.22930.46760.53280
573.8434.00443.53734.47150.24910.58710.46730
584.1644.23583.76874.70290.38170.95030.48451e-04
594.0754.20833.74124.67540.28790.57380.42730
604.7084.9784.51095.4450.12870.99990.25360.2536

\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 & 4.821 & - & - & - & - & - & - & - \tabularnewline
37 & 4.965 & - & - & - & - & - & - & - \tabularnewline
38 & 4.425 & - & - & - & - & - & - & - \tabularnewline
39 & 4.601 & - & - & - & - & - & - & - \tabularnewline
40 & 4.521 & - & - & - & - & - & - & - \tabularnewline
41 & 4.193 & - & - & - & - & - & - & - \tabularnewline
42 & 4.039 & - & - & - & - & - & - & - \tabularnewline
43 & 4.099 & - & - & - & - & - & - & - \tabularnewline
44 & 4.109 & - & - & - & - & - & - & - \tabularnewline
45 & 4.024 & - & - & - & - & - & - & - \tabularnewline
46 & 4.245 & - & - & - & - & - & - & - \tabularnewline
47 & 4.252 & - & - & - & - & - & - & - \tabularnewline
48 & 5.136 & - & - & - & - & - & - & - \tabularnewline
49 & 5.037 & 5.2664 & 4.8336 & 5.6992 & 0.1494 & 0.7227 & 0.9139 & 0.7227 \tabularnewline
50 & 4.23 & 4.4487 & 3.9863 & 4.9111 & 0.177 & 0.0063 & 0.54 & 0.0018 \tabularnewline
51 & 4.408 & 4.5945 & 4.1281 & 5.061 & 0.2166 & 0.9372 & 0.4891 & 0.0114 \tabularnewline
52 & 4.119 & 4.4336 & 3.9666 & 4.9006 & 0.0934 & 0.5427 & 0.3568 & 0.0016 \tabularnewline
53 & 4.083 & 4.2181 & 3.7511 & 4.6852 & 0.2853 & 0.6613 & 0.542 & 1e-04 \tabularnewline
54 & 4.01 & 4.0619 & 3.5948 & 4.529 & 0.4139 & 0.4647 & 0.5382 & 0 \tabularnewline
55 & 4.148 & 4.1055 & 3.6384 & 4.5726 & 0.4292 & 0.6557 & 0.5109 & 0 \tabularnewline
56 & 3.952 & 4.1286 & 3.6615 & 4.5957 & 0.2293 & 0.4676 & 0.5328 & 0 \tabularnewline
57 & 3.843 & 4.0044 & 3.5373 & 4.4715 & 0.2491 & 0.5871 & 0.4673 & 0 \tabularnewline
58 & 4.164 & 4.2358 & 3.7687 & 4.7029 & 0.3817 & 0.9503 & 0.4845 & 1e-04 \tabularnewline
59 & 4.075 & 4.2083 & 3.7412 & 4.6754 & 0.2879 & 0.5738 & 0.4273 & 0 \tabularnewline
60 & 4.708 & 4.978 & 4.5109 & 5.445 & 0.1287 & 0.9999 & 0.2536 & 0.2536 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117171&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]4.821[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]4.965[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]4.425[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]4.601[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]4.521[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]4.193[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]4.039[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]4.099[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]4.109[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]4.024[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]4.245[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]4.252[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]5.136[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]5.037[/C][C]5.2664[/C][C]4.8336[/C][C]5.6992[/C][C]0.1494[/C][C]0.7227[/C][C]0.9139[/C][C]0.7227[/C][/ROW]
[ROW][C]50[/C][C]4.23[/C][C]4.4487[/C][C]3.9863[/C][C]4.9111[/C][C]0.177[/C][C]0.0063[/C][C]0.54[/C][C]0.0018[/C][/ROW]
[ROW][C]51[/C][C]4.408[/C][C]4.5945[/C][C]4.1281[/C][C]5.061[/C][C]0.2166[/C][C]0.9372[/C][C]0.4891[/C][C]0.0114[/C][/ROW]
[ROW][C]52[/C][C]4.119[/C][C]4.4336[/C][C]3.9666[/C][C]4.9006[/C][C]0.0934[/C][C]0.5427[/C][C]0.3568[/C][C]0.0016[/C][/ROW]
[ROW][C]53[/C][C]4.083[/C][C]4.2181[/C][C]3.7511[/C][C]4.6852[/C][C]0.2853[/C][C]0.6613[/C][C]0.542[/C][C]1e-04[/C][/ROW]
[ROW][C]54[/C][C]4.01[/C][C]4.0619[/C][C]3.5948[/C][C]4.529[/C][C]0.4139[/C][C]0.4647[/C][C]0.5382[/C][C]0[/C][/ROW]
[ROW][C]55[/C][C]4.148[/C][C]4.1055[/C][C]3.6384[/C][C]4.5726[/C][C]0.4292[/C][C]0.6557[/C][C]0.5109[/C][C]0[/C][/ROW]
[ROW][C]56[/C][C]3.952[/C][C]4.1286[/C][C]3.6615[/C][C]4.5957[/C][C]0.2293[/C][C]0.4676[/C][C]0.5328[/C][C]0[/C][/ROW]
[ROW][C]57[/C][C]3.843[/C][C]4.0044[/C][C]3.5373[/C][C]4.4715[/C][C]0.2491[/C][C]0.5871[/C][C]0.4673[/C][C]0[/C][/ROW]
[ROW][C]58[/C][C]4.164[/C][C]4.2358[/C][C]3.7687[/C][C]4.7029[/C][C]0.3817[/C][C]0.9503[/C][C]0.4845[/C][C]1e-04[/C][/ROW]
[ROW][C]59[/C][C]4.075[/C][C]4.2083[/C][C]3.7412[/C][C]4.6754[/C][C]0.2879[/C][C]0.5738[/C][C]0.4273[/C][C]0[/C][/ROW]
[ROW][C]60[/C][C]4.708[/C][C]4.978[/C][C]4.5109[/C][C]5.445[/C][C]0.1287[/C][C]0.9999[/C][C]0.2536[/C][C]0.2536[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117171&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117171&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])
364.821-------
374.965-------
384.425-------
394.601-------
404.521-------
414.193-------
424.039-------
434.099-------
444.109-------
454.024-------
464.245-------
474.252-------
485.136-------
495.0375.26644.83365.69920.14940.72270.91390.7227
504.234.44873.98634.91110.1770.00630.540.0018
514.4084.59454.12815.0610.21660.93720.48910.0114
524.1194.43363.96664.90060.09340.54270.35680.0016
534.0834.21813.75114.68520.28530.66130.5421e-04
544.014.06193.59484.5290.41390.46470.53820
554.1484.10553.63844.57260.42920.65570.51090
563.9524.12863.66154.59570.22930.46760.53280
573.8434.00443.53734.47150.24910.58710.46730
584.1644.23583.76874.70290.38170.95030.48451e-04
594.0754.20833.74124.67540.28790.57380.42730
604.7084.9784.51095.4450.12870.99990.25360.2536







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0419-0.043600.052600
500.053-0.04920.04640.04780.05020.2241
510.0518-0.04060.04440.03480.04510.2123
520.0537-0.0710.05110.09890.05860.242
530.0565-0.0320.04730.01830.05050.2247
540.0587-0.01280.04150.00270.04250.2062
550.0580.01040.03710.00180.03670.1916
560.0577-0.04280.03780.03120.0360.1898
570.0595-0.04030.03810.02610.03490.1869
580.0563-0.01690.03590.00510.03190.1787
590.0566-0.03170.03560.01780.03060.1751
600.0479-0.05420.03710.07290.03420.1848

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0419 & -0.0436 & 0 & 0.0526 & 0 & 0 \tabularnewline
50 & 0.053 & -0.0492 & 0.0464 & 0.0478 & 0.0502 & 0.2241 \tabularnewline
51 & 0.0518 & -0.0406 & 0.0444 & 0.0348 & 0.0451 & 0.2123 \tabularnewline
52 & 0.0537 & -0.071 & 0.0511 & 0.0989 & 0.0586 & 0.242 \tabularnewline
53 & 0.0565 & -0.032 & 0.0473 & 0.0183 & 0.0505 & 0.2247 \tabularnewline
54 & 0.0587 & -0.0128 & 0.0415 & 0.0027 & 0.0425 & 0.2062 \tabularnewline
55 & 0.058 & 0.0104 & 0.0371 & 0.0018 & 0.0367 & 0.1916 \tabularnewline
56 & 0.0577 & -0.0428 & 0.0378 & 0.0312 & 0.036 & 0.1898 \tabularnewline
57 & 0.0595 & -0.0403 & 0.0381 & 0.0261 & 0.0349 & 0.1869 \tabularnewline
58 & 0.0563 & -0.0169 & 0.0359 & 0.0051 & 0.0319 & 0.1787 \tabularnewline
59 & 0.0566 & -0.0317 & 0.0356 & 0.0178 & 0.0306 & 0.1751 \tabularnewline
60 & 0.0479 & -0.0542 & 0.0371 & 0.0729 & 0.0342 & 0.1848 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117171&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.0419[/C][C]-0.0436[/C][C]0[/C][C]0.0526[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.053[/C][C]-0.0492[/C][C]0.0464[/C][C]0.0478[/C][C]0.0502[/C][C]0.2241[/C][/ROW]
[ROW][C]51[/C][C]0.0518[/C][C]-0.0406[/C][C]0.0444[/C][C]0.0348[/C][C]0.0451[/C][C]0.2123[/C][/ROW]
[ROW][C]52[/C][C]0.0537[/C][C]-0.071[/C][C]0.0511[/C][C]0.0989[/C][C]0.0586[/C][C]0.242[/C][/ROW]
[ROW][C]53[/C][C]0.0565[/C][C]-0.032[/C][C]0.0473[/C][C]0.0183[/C][C]0.0505[/C][C]0.2247[/C][/ROW]
[ROW][C]54[/C][C]0.0587[/C][C]-0.0128[/C][C]0.0415[/C][C]0.0027[/C][C]0.0425[/C][C]0.2062[/C][/ROW]
[ROW][C]55[/C][C]0.058[/C][C]0.0104[/C][C]0.0371[/C][C]0.0018[/C][C]0.0367[/C][C]0.1916[/C][/ROW]
[ROW][C]56[/C][C]0.0577[/C][C]-0.0428[/C][C]0.0378[/C][C]0.0312[/C][C]0.036[/C][C]0.1898[/C][/ROW]
[ROW][C]57[/C][C]0.0595[/C][C]-0.0403[/C][C]0.0381[/C][C]0.0261[/C][C]0.0349[/C][C]0.1869[/C][/ROW]
[ROW][C]58[/C][C]0.0563[/C][C]-0.0169[/C][C]0.0359[/C][C]0.0051[/C][C]0.0319[/C][C]0.1787[/C][/ROW]
[ROW][C]59[/C][C]0.0566[/C][C]-0.0317[/C][C]0.0356[/C][C]0.0178[/C][C]0.0306[/C][C]0.1751[/C][/ROW]
[ROW][C]60[/C][C]0.0479[/C][C]-0.0542[/C][C]0.0371[/C][C]0.0729[/C][C]0.0342[/C][C]0.1848[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117171&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117171&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.0419-0.043600.052600
500.053-0.04920.04640.04780.05020.2241
510.0518-0.04060.04440.03480.04510.2123
520.0537-0.0710.05110.09890.05860.242
530.0565-0.0320.04730.01830.05050.2247
540.0587-0.01280.04150.00270.04250.2062
550.0580.01040.03710.00180.03670.1916
560.0577-0.04280.03780.03120.0360.1898
570.0595-0.04030.03810.02610.03490.1869
580.0563-0.01690.03590.00510.03190.1787
590.0566-0.03170.03560.01780.03060.1751
600.0479-0.05420.03710.07290.03420.1848



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