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, 30 Dec 2009 12:00:36 -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/30/t1262200658u3mvq6fdjro1mj4.htm/, Retrieved Mon, 29 Apr 2024 00:35:34 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=71356, Retrieved Mon, 29 Apr 2024 00:35:34 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordscvm
Estimated Impact141
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-11 17:57:23] [023d83ebdf42a2acf423907b4076e8a1]
-   PD    [ARIMA Forecasting] [Paper: Arima-fore...] [2009-12-30 19:00:36] [a5ada8bd39e806b5b90f09589c89554a] [Current]
Feedback Forum

Post a new message
Dataseries X:
25.5
25.6
23.7
22
21.3
20.7
20.4
20.3
20.4
19.8
19.5
23.1
23.5
23.5
22.9
21.9
21.5
20.5
20.2
19.4
19.2
18.8
18.8
22.6
23.3
23
21.4
19.9
18.8
18.6
18.4
18.6
19.9
19.2
18.4
21.1
20.5
19.1
18.1
17
17.1
17.4
16.8
15.3
14.3
13.4
15.3
22.1
23.7
22.2
19.5
16.6
17.3
19.8
21.2
21.5
20.6
19.1
19.6
23.5
24




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71356&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])
3720.5-------
3819.1-------
3918.1-------
4017-------
4117.1-------
4217.4-------
4316.8-------
4415.3-------
4514.3-------
4613.4-------
4715.3-------
4822.1-------
4923.7-------
5022.222.931521.311324.44450.17170.159710.1597
5119.522.105518.764225.00430.03910.47450.99660.1405
5216.621.214216.453425.08730.00980.80720.98350.1042
5317.321.294415.483925.82940.04210.97880.96510.1492
5419.821.536114.850426.59080.25040.94980.94560.2007
5521.221.054313.178526.70010.47980.66840.93020.1792
5621.519.87810.076526.24370.30870.3420.92070.1196
5720.619.11897.054426.10180.33880.2520.91190.0992
5819.118.45542.030126.02090.43370.28920.90490.0871
5919.619.8786.256327.40670.47120.58020.88330.1599
6023.525.484416.582131.99910.27520.96170.84570.7043
612426.883718.18333.38930.19250.8460.83130.8313

\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 & 20.5 & - & - & - & - & - & - & - \tabularnewline
38 & 19.1 & - & - & - & - & - & - & - \tabularnewline
39 & 18.1 & - & - & - & - & - & - & - \tabularnewline
40 & 17 & - & - & - & - & - & - & - \tabularnewline
41 & 17.1 & - & - & - & - & - & - & - \tabularnewline
42 & 17.4 & - & - & - & - & - & - & - \tabularnewline
43 & 16.8 & - & - & - & - & - & - & - \tabularnewline
44 & 15.3 & - & - & - & - & - & - & - \tabularnewline
45 & 14.3 & - & - & - & - & - & - & - \tabularnewline
46 & 13.4 & - & - & - & - & - & - & - \tabularnewline
47 & 15.3 & - & - & - & - & - & - & - \tabularnewline
48 & 22.1 & - & - & - & - & - & - & - \tabularnewline
49 & 23.7 & - & - & - & - & - & - & - \tabularnewline
50 & 22.2 & 22.9315 & 21.3113 & 24.4445 & 0.1717 & 0.1597 & 1 & 0.1597 \tabularnewline
51 & 19.5 & 22.1055 & 18.7642 & 25.0043 & 0.0391 & 0.4745 & 0.9966 & 0.1405 \tabularnewline
52 & 16.6 & 21.2142 & 16.4534 & 25.0873 & 0.0098 & 0.8072 & 0.9835 & 0.1042 \tabularnewline
53 & 17.3 & 21.2944 & 15.4839 & 25.8294 & 0.0421 & 0.9788 & 0.9651 & 0.1492 \tabularnewline
54 & 19.8 & 21.5361 & 14.8504 & 26.5908 & 0.2504 & 0.9498 & 0.9456 & 0.2007 \tabularnewline
55 & 21.2 & 21.0543 & 13.1785 & 26.7001 & 0.4798 & 0.6684 & 0.9302 & 0.1792 \tabularnewline
56 & 21.5 & 19.878 & 10.0765 & 26.2437 & 0.3087 & 0.342 & 0.9207 & 0.1196 \tabularnewline
57 & 20.6 & 19.1189 & 7.0544 & 26.1018 & 0.3388 & 0.252 & 0.9119 & 0.0992 \tabularnewline
58 & 19.1 & 18.4554 & 2.0301 & 26.0209 & 0.4337 & 0.2892 & 0.9049 & 0.0871 \tabularnewline
59 & 19.6 & 19.878 & 6.2563 & 27.4067 & 0.4712 & 0.5802 & 0.8833 & 0.1599 \tabularnewline
60 & 23.5 & 25.4844 & 16.5821 & 31.9991 & 0.2752 & 0.9617 & 0.8457 & 0.7043 \tabularnewline
61 & 24 & 26.8837 & 18.183 & 33.3893 & 0.1925 & 0.846 & 0.8313 & 0.8313 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71356&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]20.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]19.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]18.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]17[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]17.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]17.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]16.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]15.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]14.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]13.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]15.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]22.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]23.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]22.2[/C][C]22.9315[/C][C]21.3113[/C][C]24.4445[/C][C]0.1717[/C][C]0.1597[/C][C]1[/C][C]0.1597[/C][/ROW]
[ROW][C]51[/C][C]19.5[/C][C]22.1055[/C][C]18.7642[/C][C]25.0043[/C][C]0.0391[/C][C]0.4745[/C][C]0.9966[/C][C]0.1405[/C][/ROW]
[ROW][C]52[/C][C]16.6[/C][C]21.2142[/C][C]16.4534[/C][C]25.0873[/C][C]0.0098[/C][C]0.8072[/C][C]0.9835[/C][C]0.1042[/C][/ROW]
[ROW][C]53[/C][C]17.3[/C][C]21.2944[/C][C]15.4839[/C][C]25.8294[/C][C]0.0421[/C][C]0.9788[/C][C]0.9651[/C][C]0.1492[/C][/ROW]
[ROW][C]54[/C][C]19.8[/C][C]21.5361[/C][C]14.8504[/C][C]26.5908[/C][C]0.2504[/C][C]0.9498[/C][C]0.9456[/C][C]0.2007[/C][/ROW]
[ROW][C]55[/C][C]21.2[/C][C]21.0543[/C][C]13.1785[/C][C]26.7001[/C][C]0.4798[/C][C]0.6684[/C][C]0.9302[/C][C]0.1792[/C][/ROW]
[ROW][C]56[/C][C]21.5[/C][C]19.878[/C][C]10.0765[/C][C]26.2437[/C][C]0.3087[/C][C]0.342[/C][C]0.9207[/C][C]0.1196[/C][/ROW]
[ROW][C]57[/C][C]20.6[/C][C]19.1189[/C][C]7.0544[/C][C]26.1018[/C][C]0.3388[/C][C]0.252[/C][C]0.9119[/C][C]0.0992[/C][/ROW]
[ROW][C]58[/C][C]19.1[/C][C]18.4554[/C][C]2.0301[/C][C]26.0209[/C][C]0.4337[/C][C]0.2892[/C][C]0.9049[/C][C]0.0871[/C][/ROW]
[ROW][C]59[/C][C]19.6[/C][C]19.878[/C][C]6.2563[/C][C]27.4067[/C][C]0.4712[/C][C]0.5802[/C][C]0.8833[/C][C]0.1599[/C][/ROW]
[ROW][C]60[/C][C]23.5[/C][C]25.4844[/C][C]16.5821[/C][C]31.9991[/C][C]0.2752[/C][C]0.9617[/C][C]0.8457[/C][C]0.7043[/C][/ROW]
[ROW][C]61[/C][C]24[/C][C]26.8837[/C][C]18.183[/C][C]33.3893[/C][C]0.1925[/C][C]0.846[/C][C]0.8313[/C][C]0.8313[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71356&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71356&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])
3720.5-------
3819.1-------
3918.1-------
4017-------
4117.1-------
4217.4-------
4316.8-------
4415.3-------
4514.3-------
4613.4-------
4715.3-------
4822.1-------
4923.7-------
5022.222.931521.311324.44450.17170.159710.1597
5119.522.105518.764225.00430.03910.47450.99660.1405
5216.621.214216.453425.08730.00980.80720.98350.1042
5317.321.294415.483925.82940.04210.97880.96510.1492
5419.821.536114.850426.59080.25040.94980.94560.2007
5521.221.054313.178526.70010.47980.66840.93020.1792
5621.519.87810.076526.24370.30870.3420.92070.1196
5720.619.11897.054426.10180.33880.2520.91190.0992
5819.118.45542.030126.02090.43370.28920.90490.0871
5919.619.8786.256327.40670.47120.58020.88330.1599
6023.525.484416.582131.99910.27520.96170.84570.7043
612426.883718.18333.38930.19250.8460.83130.8313







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.0337-0.031900.535100
510.0669-0.11790.07496.78863.66191.9136
520.0931-0.21750.122421.29119.53833.0884
530.1087-0.18760.138715.955611.14263.3381
540.1197-0.08060.12713.0149.51693.0849
550.13680.00690.10710.02127.93432.8168
560.16340.08160.10342.6317.17672.6789
570.18630.07750.10022.19366.55382.56
580.20910.03490.09290.41555.87172.4232
590.1932-0.0140.0850.07735.29232.3005
600.1304-0.07790.08443.93775.16922.2736
610.1235-0.10730.08638.31575.43142.3305

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0337 & -0.0319 & 0 & 0.5351 & 0 & 0 \tabularnewline
51 & 0.0669 & -0.1179 & 0.0749 & 6.7886 & 3.6619 & 1.9136 \tabularnewline
52 & 0.0931 & -0.2175 & 0.1224 & 21.2911 & 9.5383 & 3.0884 \tabularnewline
53 & 0.1087 & -0.1876 & 0.1387 & 15.9556 & 11.1426 & 3.3381 \tabularnewline
54 & 0.1197 & -0.0806 & 0.1271 & 3.014 & 9.5169 & 3.0849 \tabularnewline
55 & 0.1368 & 0.0069 & 0.1071 & 0.0212 & 7.9343 & 2.8168 \tabularnewline
56 & 0.1634 & 0.0816 & 0.1034 & 2.631 & 7.1767 & 2.6789 \tabularnewline
57 & 0.1863 & 0.0775 & 0.1002 & 2.1936 & 6.5538 & 2.56 \tabularnewline
58 & 0.2091 & 0.0349 & 0.0929 & 0.4155 & 5.8717 & 2.4232 \tabularnewline
59 & 0.1932 & -0.014 & 0.085 & 0.0773 & 5.2923 & 2.3005 \tabularnewline
60 & 0.1304 & -0.0779 & 0.0844 & 3.9377 & 5.1692 & 2.2736 \tabularnewline
61 & 0.1235 & -0.1073 & 0.0863 & 8.3157 & 5.4314 & 2.3305 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71356&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.0337[/C][C]-0.0319[/C][C]0[/C][C]0.5351[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]0.0669[/C][C]-0.1179[/C][C]0.0749[/C][C]6.7886[/C][C]3.6619[/C][C]1.9136[/C][/ROW]
[ROW][C]52[/C][C]0.0931[/C][C]-0.2175[/C][C]0.1224[/C][C]21.2911[/C][C]9.5383[/C][C]3.0884[/C][/ROW]
[ROW][C]53[/C][C]0.1087[/C][C]-0.1876[/C][C]0.1387[/C][C]15.9556[/C][C]11.1426[/C][C]3.3381[/C][/ROW]
[ROW][C]54[/C][C]0.1197[/C][C]-0.0806[/C][C]0.1271[/C][C]3.014[/C][C]9.5169[/C][C]3.0849[/C][/ROW]
[ROW][C]55[/C][C]0.1368[/C][C]0.0069[/C][C]0.1071[/C][C]0.0212[/C][C]7.9343[/C][C]2.8168[/C][/ROW]
[ROW][C]56[/C][C]0.1634[/C][C]0.0816[/C][C]0.1034[/C][C]2.631[/C][C]7.1767[/C][C]2.6789[/C][/ROW]
[ROW][C]57[/C][C]0.1863[/C][C]0.0775[/C][C]0.1002[/C][C]2.1936[/C][C]6.5538[/C][C]2.56[/C][/ROW]
[ROW][C]58[/C][C]0.2091[/C][C]0.0349[/C][C]0.0929[/C][C]0.4155[/C][C]5.8717[/C][C]2.4232[/C][/ROW]
[ROW][C]59[/C][C]0.1932[/C][C]-0.014[/C][C]0.085[/C][C]0.0773[/C][C]5.2923[/C][C]2.3005[/C][/ROW]
[ROW][C]60[/C][C]0.1304[/C][C]-0.0779[/C][C]0.0844[/C][C]3.9377[/C][C]5.1692[/C][C]2.2736[/C][/ROW]
[ROW][C]61[/C][C]0.1235[/C][C]-0.1073[/C][C]0.0863[/C][C]8.3157[/C][C]5.4314[/C][C]2.3305[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71356&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71356&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.0337-0.031900.535100
510.0669-0.11790.07496.78863.66191.9136
520.0931-0.21750.122421.29119.53833.0884
530.1087-0.18760.138715.955611.14263.3381
540.1197-0.08060.12713.0149.51693.0849
550.13680.00690.10710.02127.93432.8168
560.16340.08160.10342.6317.17672.6789
570.18630.07750.10022.19366.55382.56
580.20910.03490.09290.41555.87172.4232
590.1932-0.0140.0850.07735.29232.3005
600.1304-0.07790.08443.93775.16922.2736
610.1235-0.10730.08638.31575.43142.3305



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