Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 13 Dec 2007 05:20:30 -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/2007/Dec/13/t1197547514hmx2wo5z77ze1sj.htm/, Retrieved Sun, 05 May 2024 13:54:39 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3470, Retrieved Sun, 05 May 2024 13:54:39 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsfredje
Estimated Impact205
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [forecast] [2007-12-13 12:20:30] [c40c597932a04e0e43159741c7e63e4c] [Current]
Feedback Forum

Post a new message
Dataseries X:
12398.4
13882.3
15861.5
13286.1
15634.9
14211
13646.8
12224.6
15916.4
16535.9
15796
14418.6
15044.5
14944.2
16754.8
14254
15454.9
15644.8
14568.3
12520.2
14803
15873.2
14755.3
12875.1
14291.1
14205.3
15859.4
15258.9
15498.6
14106.5
15023.6
15761.3
16943
15070.3
13659.6
14768.9
14725.1
15998.1
15370.6
14956.9
15469.7
15101.8
16283.6
16726.5
14968.9
14861
14583.3
15305.8
17903.9
16379.4
15420.3
17870.5
15912.8
13866.5
17823.2
17872
17420.4
16704.4
15991.2
16583.6
17838.7
17209.4




Summary of compuational 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 compuational 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=3470&T=0

[TABLE]
[ROW][C]Summary of compuational 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=3470&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3470&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 compuational 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[50])
3815998.1-------
3915370.6-------
4014956.9-------
4115469.7-------
4215101.8-------
4316283.6-------
4416726.5-------
4514968.9-------
4614861-------
4714583.3-------
4815305.8-------
4917903.9-------
5016379.4-------
5115420.315283.155413170.617817395.6930.44940.15460.46770.1546
5217870.515705.717813430.878617980.55690.03110.59710.74060.2808
5315912.815445.869613171.030517720.70870.34370.01840.49180.2106
5413866.514617.410812342.571716892.24990.25880.13220.33820.0645
5517823.216417.380214142.541118692.21930.11290.9860.54590.5131
561787217908.560615633.721520183.39970.48740.52930.84580.9062
5717420.416023.604213748.765118298.44330.11440.05560.81830.3796
5816704.414401.227612126.388516676.06670.02360.00460.3460.0442
5915991.213627.653811352.814615902.49290.02090.0040.20510.0089
6016583.615662.365913394.577217930.15460.2130.38810.6210.2677
6117838.717414.878815191.786619637.97090.35430.76820.33320.8194
6217209.416834.412614611.320419057.50470.37050.1880.65590.6559

\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[50]) \tabularnewline
38 & 15998.1 & - & - & - & - & - & - & - \tabularnewline
39 & 15370.6 & - & - & - & - & - & - & - \tabularnewline
40 & 14956.9 & - & - & - & - & - & - & - \tabularnewline
41 & 15469.7 & - & - & - & - & - & - & - \tabularnewline
42 & 15101.8 & - & - & - & - & - & - & - \tabularnewline
43 & 16283.6 & - & - & - & - & - & - & - \tabularnewline
44 & 16726.5 & - & - & - & - & - & - & - \tabularnewline
45 & 14968.9 & - & - & - & - & - & - & - \tabularnewline
46 & 14861 & - & - & - & - & - & - & - \tabularnewline
47 & 14583.3 & - & - & - & - & - & - & - \tabularnewline
48 & 15305.8 & - & - & - & - & - & - & - \tabularnewline
49 & 17903.9 & - & - & - & - & - & - & - \tabularnewline
50 & 16379.4 & - & - & - & - & - & - & - \tabularnewline
51 & 15420.3 & 15283.1554 & 13170.6178 & 17395.693 & 0.4494 & 0.1546 & 0.4677 & 0.1546 \tabularnewline
52 & 17870.5 & 15705.7178 & 13430.8786 & 17980.5569 & 0.0311 & 0.5971 & 0.7406 & 0.2808 \tabularnewline
53 & 15912.8 & 15445.8696 & 13171.0305 & 17720.7087 & 0.3437 & 0.0184 & 0.4918 & 0.2106 \tabularnewline
54 & 13866.5 & 14617.4108 & 12342.5717 & 16892.2499 & 0.2588 & 0.1322 & 0.3382 & 0.0645 \tabularnewline
55 & 17823.2 & 16417.3802 & 14142.5411 & 18692.2193 & 0.1129 & 0.986 & 0.5459 & 0.5131 \tabularnewline
56 & 17872 & 17908.5606 & 15633.7215 & 20183.3997 & 0.4874 & 0.5293 & 0.8458 & 0.9062 \tabularnewline
57 & 17420.4 & 16023.6042 & 13748.7651 & 18298.4433 & 0.1144 & 0.0556 & 0.8183 & 0.3796 \tabularnewline
58 & 16704.4 & 14401.2276 & 12126.3885 & 16676.0667 & 0.0236 & 0.0046 & 0.346 & 0.0442 \tabularnewline
59 & 15991.2 & 13627.6538 & 11352.8146 & 15902.4929 & 0.0209 & 0.004 & 0.2051 & 0.0089 \tabularnewline
60 & 16583.6 & 15662.3659 & 13394.5772 & 17930.1546 & 0.213 & 0.3881 & 0.621 & 0.2677 \tabularnewline
61 & 17838.7 & 17414.8788 & 15191.7866 & 19637.9709 & 0.3543 & 0.7682 & 0.3332 & 0.8194 \tabularnewline
62 & 17209.4 & 16834.4126 & 14611.3204 & 19057.5047 & 0.3705 & 0.188 & 0.6559 & 0.6559 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3470&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[50])[/C][/ROW]
[ROW][C]38[/C][C]15998.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]15370.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]14956.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]15469.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]15101.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]16283.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]16726.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]14968.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]14861[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]14583.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]15305.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]17903.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]16379.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]15420.3[/C][C]15283.1554[/C][C]13170.6178[/C][C]17395.693[/C][C]0.4494[/C][C]0.1546[/C][C]0.4677[/C][C]0.1546[/C][/ROW]
[ROW][C]52[/C][C]17870.5[/C][C]15705.7178[/C][C]13430.8786[/C][C]17980.5569[/C][C]0.0311[/C][C]0.5971[/C][C]0.7406[/C][C]0.2808[/C][/ROW]
[ROW][C]53[/C][C]15912.8[/C][C]15445.8696[/C][C]13171.0305[/C][C]17720.7087[/C][C]0.3437[/C][C]0.0184[/C][C]0.4918[/C][C]0.2106[/C][/ROW]
[ROW][C]54[/C][C]13866.5[/C][C]14617.4108[/C][C]12342.5717[/C][C]16892.2499[/C][C]0.2588[/C][C]0.1322[/C][C]0.3382[/C][C]0.0645[/C][/ROW]
[ROW][C]55[/C][C]17823.2[/C][C]16417.3802[/C][C]14142.5411[/C][C]18692.2193[/C][C]0.1129[/C][C]0.986[/C][C]0.5459[/C][C]0.5131[/C][/ROW]
[ROW][C]56[/C][C]17872[/C][C]17908.5606[/C][C]15633.7215[/C][C]20183.3997[/C][C]0.4874[/C][C]0.5293[/C][C]0.8458[/C][C]0.9062[/C][/ROW]
[ROW][C]57[/C][C]17420.4[/C][C]16023.6042[/C][C]13748.7651[/C][C]18298.4433[/C][C]0.1144[/C][C]0.0556[/C][C]0.8183[/C][C]0.3796[/C][/ROW]
[ROW][C]58[/C][C]16704.4[/C][C]14401.2276[/C][C]12126.3885[/C][C]16676.0667[/C][C]0.0236[/C][C]0.0046[/C][C]0.346[/C][C]0.0442[/C][/ROW]
[ROW][C]59[/C][C]15991.2[/C][C]13627.6538[/C][C]11352.8146[/C][C]15902.4929[/C][C]0.0209[/C][C]0.004[/C][C]0.2051[/C][C]0.0089[/C][/ROW]
[ROW][C]60[/C][C]16583.6[/C][C]15662.3659[/C][C]13394.5772[/C][C]17930.1546[/C][C]0.213[/C][C]0.3881[/C][C]0.621[/C][C]0.2677[/C][/ROW]
[ROW][C]61[/C][C]17838.7[/C][C]17414.8788[/C][C]15191.7866[/C][C]19637.9709[/C][C]0.3543[/C][C]0.7682[/C][C]0.3332[/C][C]0.8194[/C][/ROW]
[ROW][C]62[/C][C]17209.4[/C][C]16834.4126[/C][C]14611.3204[/C][C]19057.5047[/C][C]0.3705[/C][C]0.188[/C][C]0.6559[/C][C]0.6559[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3470&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3470&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[50])
3815998.1-------
3915370.6-------
4014956.9-------
4115469.7-------
4215101.8-------
4316283.6-------
4416726.5-------
4514968.9-------
4614861-------
4714583.3-------
4815305.8-------
4917903.9-------
5016379.4-------
5115420.315283.155413170.617817395.6930.44940.15460.46770.1546
5217870.515705.717813430.878617980.55690.03110.59710.74060.2808
5315912.815445.869613171.030517720.70870.34370.01840.49180.2106
5413866.514617.410812342.571716892.24990.25880.13220.33820.0645
5517823.216417.380214142.541118692.21930.11290.9860.54590.5131
561787217908.560615633.721520183.39970.48740.52930.84580.9062
5717420.416023.604213748.765118298.44330.11440.05560.81830.3796
5816704.414401.227612126.388516676.06670.02360.00460.3460.0442
5915991.213627.653811352.814615902.49290.02090.0040.20510.0089
6016583.615662.365913394.577217930.15460.2130.38810.6210.2677
6117838.717414.878815191.786619637.97090.35430.76820.33320.8194
6217209.416834.412614611.320419057.50470.37050.1880.65590.6559







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
510.07050.0097e-0418808.65151567.387639.5902
520.07390.13780.01154686282.1893390523.5158624.9188
530.07510.03020.0025218024.007818168.6673134.7912
540.0794-0.05140.0043563867.032846988.9194216.7693
550.07070.08560.00711976329.3792164694.1149405.8252
560.0648-0.0022e-041336.676111.389710.5541
570.07240.08720.00731951038.4276162586.5356403.2202
580.08060.15990.01335304603.1072442050.2589664.8686
590.08520.17340.01455586350.8002465529.2333682.297
600.07390.05880.0049848672.212870722.6844265.9374
610.06510.02430.002179624.442814968.7036122.3467
620.06740.02230.0019140615.578211717.9649108.2495

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
51 & 0.0705 & 0.009 & 7e-04 & 18808.6515 & 1567.3876 & 39.5902 \tabularnewline
52 & 0.0739 & 0.1378 & 0.0115 & 4686282.1893 & 390523.5158 & 624.9188 \tabularnewline
53 & 0.0751 & 0.0302 & 0.0025 & 218024.0078 & 18168.6673 & 134.7912 \tabularnewline
54 & 0.0794 & -0.0514 & 0.0043 & 563867.0328 & 46988.9194 & 216.7693 \tabularnewline
55 & 0.0707 & 0.0856 & 0.0071 & 1976329.3792 & 164694.1149 & 405.8252 \tabularnewline
56 & 0.0648 & -0.002 & 2e-04 & 1336.676 & 111.3897 & 10.5541 \tabularnewline
57 & 0.0724 & 0.0872 & 0.0073 & 1951038.4276 & 162586.5356 & 403.2202 \tabularnewline
58 & 0.0806 & 0.1599 & 0.0133 & 5304603.1072 & 442050.2589 & 664.8686 \tabularnewline
59 & 0.0852 & 0.1734 & 0.0145 & 5586350.8002 & 465529.2333 & 682.297 \tabularnewline
60 & 0.0739 & 0.0588 & 0.0049 & 848672.2128 & 70722.6844 & 265.9374 \tabularnewline
61 & 0.0651 & 0.0243 & 0.002 & 179624.4428 & 14968.7036 & 122.3467 \tabularnewline
62 & 0.0674 & 0.0223 & 0.0019 & 140615.5782 & 11717.9649 & 108.2495 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3470&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]51[/C][C]0.0705[/C][C]0.009[/C][C]7e-04[/C][C]18808.6515[/C][C]1567.3876[/C][C]39.5902[/C][/ROW]
[ROW][C]52[/C][C]0.0739[/C][C]0.1378[/C][C]0.0115[/C][C]4686282.1893[/C][C]390523.5158[/C][C]624.9188[/C][/ROW]
[ROW][C]53[/C][C]0.0751[/C][C]0.0302[/C][C]0.0025[/C][C]218024.0078[/C][C]18168.6673[/C][C]134.7912[/C][/ROW]
[ROW][C]54[/C][C]0.0794[/C][C]-0.0514[/C][C]0.0043[/C][C]563867.0328[/C][C]46988.9194[/C][C]216.7693[/C][/ROW]
[ROW][C]55[/C][C]0.0707[/C][C]0.0856[/C][C]0.0071[/C][C]1976329.3792[/C][C]164694.1149[/C][C]405.8252[/C][/ROW]
[ROW][C]56[/C][C]0.0648[/C][C]-0.002[/C][C]2e-04[/C][C]1336.676[/C][C]111.3897[/C][C]10.5541[/C][/ROW]
[ROW][C]57[/C][C]0.0724[/C][C]0.0872[/C][C]0.0073[/C][C]1951038.4276[/C][C]162586.5356[/C][C]403.2202[/C][/ROW]
[ROW][C]58[/C][C]0.0806[/C][C]0.1599[/C][C]0.0133[/C][C]5304603.1072[/C][C]442050.2589[/C][C]664.8686[/C][/ROW]
[ROW][C]59[/C][C]0.0852[/C][C]0.1734[/C][C]0.0145[/C][C]5586350.8002[/C][C]465529.2333[/C][C]682.297[/C][/ROW]
[ROW][C]60[/C][C]0.0739[/C][C]0.0588[/C][C]0.0049[/C][C]848672.2128[/C][C]70722.6844[/C][C]265.9374[/C][/ROW]
[ROW][C]61[/C][C]0.0651[/C][C]0.0243[/C][C]0.002[/C][C]179624.4428[/C][C]14968.7036[/C][C]122.3467[/C][/ROW]
[ROW][C]62[/C][C]0.0674[/C][C]0.0223[/C][C]0.0019[/C][C]140615.5782[/C][C]11717.9649[/C][C]108.2495[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3470&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3470&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
510.07050.0097e-0418808.65151567.387639.5902
520.07390.13780.01154686282.1893390523.5158624.9188
530.07510.03020.0025218024.007818168.6673134.7912
540.0794-0.05140.0043563867.032846988.9194216.7693
550.07070.08560.00711976329.3792164694.1149405.8252
560.0648-0.0022e-041336.676111.389710.5541
570.07240.08720.00731951038.4276162586.5356403.2202
580.08060.15990.01335304603.1072442050.2589664.8686
590.08520.17340.01455586350.8002465529.2333682.297
600.07390.05880.0049848672.212870722.6844265.9374
610.06510.02430.002179624.442814968.7036122.3467
620.06740.02230.0019140615.578211717.9649108.2495



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 2 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 2 ; 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,fx))
(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)
}
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')