Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 14 Dec 2007 13:47:44 -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/14/t1197664925eksjw79m3og5g0e.htm/, Retrieved Thu, 02 May 2024 16:50:00 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3981, Retrieved Thu, 02 May 2024 16:50:00 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact207
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [paper forecast] [2007-12-14 20:47:44] [fef19078983b9fa83d10cb717d6f9786] [Current]
-   PD    [ARIMA Forecasting] [Forecast mannen] [2008-12-16 20:51:44] [4ddbf81f78ea7c738951638c7e93f6ee]
-    D      [ARIMA Forecasting] [Forecast vrouwen] [2008-12-16 20:53:18] [4ddbf81f78ea7c738951638c7e93f6ee]
-    D        [ARIMA Forecasting] [Forecast totaal] [2008-12-16 20:54:52] [4ddbf81f78ea7c738951638c7e93f6ee]
- RMPD    [ARIMA Backward Selection] [Voorspelling Ener...] [2008-12-22 09:21:37] [74be16979710d4c4e7c6647856088456]
-   PD    [ARIMA Forecasting] [Paper - arima for...] [2008-12-22 14:49:49] [1848c1c05ef454c234bcbe26cf08badc]
Feedback Forum

Post a new message
Dataseries X:
112.6
113.8
107.8
103.2
103.3
101.2
107.7
110.4
101.9
115.9
89.9
88.6
117.2
123.9
100
103.6
94.1
98.7
119.5
112.7
104.4
124.7
89.1
97
121.6
118.8
114
111.5
97.2
102.5
113.4
109.8
104.9
126.1
80
96.8
117.2
112.3
117.3
111.1
102.2
104.3
122.9
107.6
121.3
131.5
89
104.4
128.9
135.9
133.3
121.3
120.5
120.4
137.9
126.1
133.2
146.6
103.4
117.2




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3981&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 time1 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])
3696.8-------
37117.2-------
38112.3-------
39117.3-------
40111.1-------
41102.2-------
42104.3-------
43122.9-------
44107.6-------
45121.3-------
46131.5-------
4789-------
48104.4-------
49128.9122.6335111.5973133.66970.13290.99940.83270.9994
50135.9120.2672109.2305131.30390.00270.06260.92140.9976
51133.3118.0326106.6697129.39560.00420.0010.55030.9907
52121.3112.3954100.0579124.73290.07864e-040.58150.898
53120.5102.93590.5726115.29750.00270.00180.54640.4082
54120.4105.676793.0915118.26180.01090.01050.58490.5788
55137.9120.4158107.6232133.20840.00370.5010.35170.9929
56126.1111.271398.4442124.09850.011700.71260.8531
57133.2114.2132101.2876127.13870.0020.03570.14130.9316
58146.6128.743115.7604141.72560.00350.25050.33860.9999
59103.487.933774.9263100.94110.009900.43620.0065
60117.2100.72287.6764113.76750.00660.34370.29030.2903

\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 & 96.8 & - & - & - & - & - & - & - \tabularnewline
37 & 117.2 & - & - & - & - & - & - & - \tabularnewline
38 & 112.3 & - & - & - & - & - & - & - \tabularnewline
39 & 117.3 & - & - & - & - & - & - & - \tabularnewline
40 & 111.1 & - & - & - & - & - & - & - \tabularnewline
41 & 102.2 & - & - & - & - & - & - & - \tabularnewline
42 & 104.3 & - & - & - & - & - & - & - \tabularnewline
43 & 122.9 & - & - & - & - & - & - & - \tabularnewline
44 & 107.6 & - & - & - & - & - & - & - \tabularnewline
45 & 121.3 & - & - & - & - & - & - & - \tabularnewline
46 & 131.5 & - & - & - & - & - & - & - \tabularnewline
47 & 89 & - & - & - & - & - & - & - \tabularnewline
48 & 104.4 & - & - & - & - & - & - & - \tabularnewline
49 & 128.9 & 122.6335 & 111.5973 & 133.6697 & 0.1329 & 0.9994 & 0.8327 & 0.9994 \tabularnewline
50 & 135.9 & 120.2672 & 109.2305 & 131.3039 & 0.0027 & 0.0626 & 0.9214 & 0.9976 \tabularnewline
51 & 133.3 & 118.0326 & 106.6697 & 129.3956 & 0.0042 & 0.001 & 0.5503 & 0.9907 \tabularnewline
52 & 121.3 & 112.3954 & 100.0579 & 124.7329 & 0.0786 & 4e-04 & 0.5815 & 0.898 \tabularnewline
53 & 120.5 & 102.935 & 90.5726 & 115.2975 & 0.0027 & 0.0018 & 0.5464 & 0.4082 \tabularnewline
54 & 120.4 & 105.6767 & 93.0915 & 118.2618 & 0.0109 & 0.0105 & 0.5849 & 0.5788 \tabularnewline
55 & 137.9 & 120.4158 & 107.6232 & 133.2084 & 0.0037 & 0.501 & 0.3517 & 0.9929 \tabularnewline
56 & 126.1 & 111.2713 & 98.4442 & 124.0985 & 0.0117 & 0 & 0.7126 & 0.8531 \tabularnewline
57 & 133.2 & 114.2132 & 101.2876 & 127.1387 & 0.002 & 0.0357 & 0.1413 & 0.9316 \tabularnewline
58 & 146.6 & 128.743 & 115.7604 & 141.7256 & 0.0035 & 0.2505 & 0.3386 & 0.9999 \tabularnewline
59 & 103.4 & 87.9337 & 74.9263 & 100.9411 & 0.0099 & 0 & 0.4362 & 0.0065 \tabularnewline
60 & 117.2 & 100.722 & 87.6764 & 113.7675 & 0.0066 & 0.3437 & 0.2903 & 0.2903 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3981&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]96.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]117.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]112.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]117.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]111.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]102.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]104.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]122.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]107.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]121.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]131.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]89[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]104.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]128.9[/C][C]122.6335[/C][C]111.5973[/C][C]133.6697[/C][C]0.1329[/C][C]0.9994[/C][C]0.8327[/C][C]0.9994[/C][/ROW]
[ROW][C]50[/C][C]135.9[/C][C]120.2672[/C][C]109.2305[/C][C]131.3039[/C][C]0.0027[/C][C]0.0626[/C][C]0.9214[/C][C]0.9976[/C][/ROW]
[ROW][C]51[/C][C]133.3[/C][C]118.0326[/C][C]106.6697[/C][C]129.3956[/C][C]0.0042[/C][C]0.001[/C][C]0.5503[/C][C]0.9907[/C][/ROW]
[ROW][C]52[/C][C]121.3[/C][C]112.3954[/C][C]100.0579[/C][C]124.7329[/C][C]0.0786[/C][C]4e-04[/C][C]0.5815[/C][C]0.898[/C][/ROW]
[ROW][C]53[/C][C]120.5[/C][C]102.935[/C][C]90.5726[/C][C]115.2975[/C][C]0.0027[/C][C]0.0018[/C][C]0.5464[/C][C]0.4082[/C][/ROW]
[ROW][C]54[/C][C]120.4[/C][C]105.6767[/C][C]93.0915[/C][C]118.2618[/C][C]0.0109[/C][C]0.0105[/C][C]0.5849[/C][C]0.5788[/C][/ROW]
[ROW][C]55[/C][C]137.9[/C][C]120.4158[/C][C]107.6232[/C][C]133.2084[/C][C]0.0037[/C][C]0.501[/C][C]0.3517[/C][C]0.9929[/C][/ROW]
[ROW][C]56[/C][C]126.1[/C][C]111.2713[/C][C]98.4442[/C][C]124.0985[/C][C]0.0117[/C][C]0[/C][C]0.7126[/C][C]0.8531[/C][/ROW]
[ROW][C]57[/C][C]133.2[/C][C]114.2132[/C][C]101.2876[/C][C]127.1387[/C][C]0.002[/C][C]0.0357[/C][C]0.1413[/C][C]0.9316[/C][/ROW]
[ROW][C]58[/C][C]146.6[/C][C]128.743[/C][C]115.7604[/C][C]141.7256[/C][C]0.0035[/C][C]0.2505[/C][C]0.3386[/C][C]0.9999[/C][/ROW]
[ROW][C]59[/C][C]103.4[/C][C]87.9337[/C][C]74.9263[/C][C]100.9411[/C][C]0.0099[/C][C]0[/C][C]0.4362[/C][C]0.0065[/C][/ROW]
[ROW][C]60[/C][C]117.2[/C][C]100.722[/C][C]87.6764[/C][C]113.7675[/C][C]0.0066[/C][C]0.3437[/C][C]0.2903[/C][C]0.2903[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3981&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3981&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])
3696.8-------
37117.2-------
38112.3-------
39117.3-------
40111.1-------
41102.2-------
42104.3-------
43122.9-------
44107.6-------
45121.3-------
46131.5-------
4789-------
48104.4-------
49128.9122.6335111.5973133.66970.13290.99940.83270.9994
50135.9120.2672109.2305131.30390.00270.06260.92140.9976
51133.3118.0326106.6697129.39560.00420.0010.55030.9907
52121.3112.3954100.0579124.73290.07864e-040.58150.898
53120.5102.93590.5726115.29750.00270.00180.54640.4082
54120.4105.676793.0915118.26180.01090.01050.58490.5788
55137.9120.4158107.6232133.20840.00370.5010.35170.9929
56126.1111.271398.4442124.09850.011700.71260.8531
57133.2114.2132101.2876127.13870.0020.03570.14130.9316
58146.6128.743115.7604141.72560.00350.25050.33860.9999
59103.487.933774.9263100.94110.009900.43620.0065
60117.2100.72287.6764113.76750.00660.34370.29030.2903







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.04590.05110.004339.26873.27241.809
500.04680.130.0108244.384320.36544.5128
510.04910.12930.0108233.09219.42434.4073
520.0560.07920.006679.29216.60772.5705
530.06130.17060.0142308.52825.71075.0706
540.06080.13930.0116216.776818.06474.2503
550.05420.14520.0121305.696225.47475.0472
560.05880.13330.0111219.889118.32414.2807
570.05770.16620.0139360.500430.04175.481
580.05140.13870.0116318.871926.57275.1549
590.07550.17590.0147239.206319.93394.4647
600.06610.16360.0136271.526122.62724.7568

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0459 & 0.0511 & 0.0043 & 39.2687 & 3.2724 & 1.809 \tabularnewline
50 & 0.0468 & 0.13 & 0.0108 & 244.3843 & 20.3654 & 4.5128 \tabularnewline
51 & 0.0491 & 0.1293 & 0.0108 & 233.092 & 19.4243 & 4.4073 \tabularnewline
52 & 0.056 & 0.0792 & 0.0066 & 79.2921 & 6.6077 & 2.5705 \tabularnewline
53 & 0.0613 & 0.1706 & 0.0142 & 308.528 & 25.7107 & 5.0706 \tabularnewline
54 & 0.0608 & 0.1393 & 0.0116 & 216.7768 & 18.0647 & 4.2503 \tabularnewline
55 & 0.0542 & 0.1452 & 0.0121 & 305.6962 & 25.4747 & 5.0472 \tabularnewline
56 & 0.0588 & 0.1333 & 0.0111 & 219.8891 & 18.3241 & 4.2807 \tabularnewline
57 & 0.0577 & 0.1662 & 0.0139 & 360.5004 & 30.0417 & 5.481 \tabularnewline
58 & 0.0514 & 0.1387 & 0.0116 & 318.8719 & 26.5727 & 5.1549 \tabularnewline
59 & 0.0755 & 0.1759 & 0.0147 & 239.2063 & 19.9339 & 4.4647 \tabularnewline
60 & 0.0661 & 0.1636 & 0.0136 & 271.5261 & 22.6272 & 4.7568 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3981&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.0459[/C][C]0.0511[/C][C]0.0043[/C][C]39.2687[/C][C]3.2724[/C][C]1.809[/C][/ROW]
[ROW][C]50[/C][C]0.0468[/C][C]0.13[/C][C]0.0108[/C][C]244.3843[/C][C]20.3654[/C][C]4.5128[/C][/ROW]
[ROW][C]51[/C][C]0.0491[/C][C]0.1293[/C][C]0.0108[/C][C]233.092[/C][C]19.4243[/C][C]4.4073[/C][/ROW]
[ROW][C]52[/C][C]0.056[/C][C]0.0792[/C][C]0.0066[/C][C]79.2921[/C][C]6.6077[/C][C]2.5705[/C][/ROW]
[ROW][C]53[/C][C]0.0613[/C][C]0.1706[/C][C]0.0142[/C][C]308.528[/C][C]25.7107[/C][C]5.0706[/C][/ROW]
[ROW][C]54[/C][C]0.0608[/C][C]0.1393[/C][C]0.0116[/C][C]216.7768[/C][C]18.0647[/C][C]4.2503[/C][/ROW]
[ROW][C]55[/C][C]0.0542[/C][C]0.1452[/C][C]0.0121[/C][C]305.6962[/C][C]25.4747[/C][C]5.0472[/C][/ROW]
[ROW][C]56[/C][C]0.0588[/C][C]0.1333[/C][C]0.0111[/C][C]219.8891[/C][C]18.3241[/C][C]4.2807[/C][/ROW]
[ROW][C]57[/C][C]0.0577[/C][C]0.1662[/C][C]0.0139[/C][C]360.5004[/C][C]30.0417[/C][C]5.481[/C][/ROW]
[ROW][C]58[/C][C]0.0514[/C][C]0.1387[/C][C]0.0116[/C][C]318.8719[/C][C]26.5727[/C][C]5.1549[/C][/ROW]
[ROW][C]59[/C][C]0.0755[/C][C]0.1759[/C][C]0.0147[/C][C]239.2063[/C][C]19.9339[/C][C]4.4647[/C][/ROW]
[ROW][C]60[/C][C]0.0661[/C][C]0.1636[/C][C]0.0136[/C][C]271.5261[/C][C]22.6272[/C][C]4.7568[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3981&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3981&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.04590.05110.004339.26873.27241.809
500.04680.130.0108244.384320.36544.5128
510.04910.12930.0108233.09219.42434.4073
520.0560.07920.006679.29216.60772.5705
530.06130.17060.0142308.52825.71075.0706
540.06080.13930.0116216.776818.06474.2503
550.05420.14520.0121305.696225.47475.0472
560.05880.13330.0111219.889118.32414.2807
570.05770.16620.0139360.500430.04175.481
580.05140.13870.0116318.871926.57275.1549
590.07550.17590.0147239.206319.93394.4647
600.06610.16360.0136271.526122.62724.7568



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