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, 01 Feb 2018 10:45:05 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2018/Feb/01/t15174783211zracax22frxbty.htm/, Retrieved Sun, 28 Apr 2024 22:00:55 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=314328, Retrieved Sun, 28 Apr 2024 22:00:55 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact42
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2018-02-01 09:45:05] [5370b2258acb413c12b88dfd0545a67d] [Current]
Feedback Forum

Post a new message
Dataseries X:
62.4
67.4
76.1
67.4
74.5
72.6
60.5
66.1
76.5
76.8
77
71
74.8
73.7
80.5
71.8
76.9
79.9
65.9
69.5
75.1
79.6
75.2
68
72.8
71.5
78.5
76.8
75.3
76.7
69.7
67.8
77.5
82.5
75.3
70.9
76
73.7
79.7
77.8
73.3
78.3
71.9
67
82
83.7
74.8
80
74.3
76.8
89
81.9
76.8
88.9
75.8
75.5
89.1
88
85.9
89.3
82.9
81.2
90.5
86.4
81.8
91.3
73.4
76.6
91
87
89.7
90.7
86.5
86.6
98.8
84.4
91.4
95.7
78.5
81.7
94.3
98.5
95.4
91.7
92.8
90.5
102.2
91.8
95
102
88.9
89.6
97.9
108.6
100.8
95.1
101
100.9
102.5
105.4
98.4
105.3
96.5
88.1
107.9
107
92.5
95.7
85.2
85.5
94.7
86.2
88.8
93.4
83.4
82.9
96.7
96.2
92.8
92.8
90
95.4
108.3
96.3
95
109
92
92.3
107
105.5
105.4
103.9
99.2
102.2
121.5
102.3
110
105.9
91.9
100
111.7
104.9
103.3
101.8
100.8
104.2
116.5
97.9
100.7
107
96.3
96
104.5
107.4
102.4
94.9
98.8
96.8
108.2
103.8
102.3
107.2
102
92.6
105.2
113
105.6
101.6
101.7
102.7
109
105.5
103.3
108.6
98.2
90
112.4
111.9
102.1
102.4
101.7
98.7
114
105.1
98.3
110
96.5
92.2
112
111.4
107.5
103.4
103.5
107.4
117.6
110.2
104.3
115.9
98.9
101.9
113.5
109.5
110
114.2
106.9
109.2
124.2
104.7
111.9
119
102.9
106.3




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time4 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=314328&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]4 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=314328&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=314328&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R ServerBig Analytics Cloud Computing Center







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[200])
19998.9-------
200101.9-------
201113.5116.1679106.9094125.42640.28610.99870.99870.9987
202109.5109.26899.8683118.66760.48070.18880.18880.9378
203110106.624797.2135116.03580.2410.27460.27460.8374
204114.2108.976497.7572120.19570.18070.4290.4290.8918
205106.9102.719691.0176114.42150.24190.02720.02720.5546
206109.2104.129292.2015116.05680.20230.32440.32440.6429
207124.2111.746398.6277124.86490.03140.64820.64820.9294
208104.7110.994597.5778124.41110.17890.02690.02690.908
209111.9108.104894.6203121.58930.29060.68970.68970.8164
210119106.599592.5647120.63420.04170.22960.22960.7442
211102.9103.734289.1908118.27760.45520.01980.01980.5976
212106.3105.215590.2749120.15610.44340.61930.61930.6682

\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[200]) \tabularnewline
199 & 98.9 & - & - & - & - & - & - & - \tabularnewline
200 & 101.9 & - & - & - & - & - & - & - \tabularnewline
201 & 113.5 & 116.1679 & 106.9094 & 125.4264 & 0.2861 & 0.9987 & 0.9987 & 0.9987 \tabularnewline
202 & 109.5 & 109.268 & 99.8683 & 118.6676 & 0.4807 & 0.1888 & 0.1888 & 0.9378 \tabularnewline
203 & 110 & 106.6247 & 97.2135 & 116.0358 & 0.241 & 0.2746 & 0.2746 & 0.8374 \tabularnewline
204 & 114.2 & 108.9764 & 97.7572 & 120.1957 & 0.1807 & 0.429 & 0.429 & 0.8918 \tabularnewline
205 & 106.9 & 102.7196 & 91.0176 & 114.4215 & 0.2419 & 0.0272 & 0.0272 & 0.5546 \tabularnewline
206 & 109.2 & 104.1292 & 92.2015 & 116.0568 & 0.2023 & 0.3244 & 0.3244 & 0.6429 \tabularnewline
207 & 124.2 & 111.7463 & 98.6277 & 124.8649 & 0.0314 & 0.6482 & 0.6482 & 0.9294 \tabularnewline
208 & 104.7 & 110.9945 & 97.5778 & 124.4111 & 0.1789 & 0.0269 & 0.0269 & 0.908 \tabularnewline
209 & 111.9 & 108.1048 & 94.6203 & 121.5893 & 0.2906 & 0.6897 & 0.6897 & 0.8164 \tabularnewline
210 & 119 & 106.5995 & 92.5647 & 120.6342 & 0.0417 & 0.2296 & 0.2296 & 0.7442 \tabularnewline
211 & 102.9 & 103.7342 & 89.1908 & 118.2776 & 0.4552 & 0.0198 & 0.0198 & 0.5976 \tabularnewline
212 & 106.3 & 105.2155 & 90.2749 & 120.1561 & 0.4434 & 0.6193 & 0.6193 & 0.6682 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=314328&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[200])[/C][/ROW]
[ROW][C]199[/C][C]98.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]200[/C][C]101.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]201[/C][C]113.5[/C][C]116.1679[/C][C]106.9094[/C][C]125.4264[/C][C]0.2861[/C][C]0.9987[/C][C]0.9987[/C][C]0.9987[/C][/ROW]
[ROW][C]202[/C][C]109.5[/C][C]109.268[/C][C]99.8683[/C][C]118.6676[/C][C]0.4807[/C][C]0.1888[/C][C]0.1888[/C][C]0.9378[/C][/ROW]
[ROW][C]203[/C][C]110[/C][C]106.6247[/C][C]97.2135[/C][C]116.0358[/C][C]0.241[/C][C]0.2746[/C][C]0.2746[/C][C]0.8374[/C][/ROW]
[ROW][C]204[/C][C]114.2[/C][C]108.9764[/C][C]97.7572[/C][C]120.1957[/C][C]0.1807[/C][C]0.429[/C][C]0.429[/C][C]0.8918[/C][/ROW]
[ROW][C]205[/C][C]106.9[/C][C]102.7196[/C][C]91.0176[/C][C]114.4215[/C][C]0.2419[/C][C]0.0272[/C][C]0.0272[/C][C]0.5546[/C][/ROW]
[ROW][C]206[/C][C]109.2[/C][C]104.1292[/C][C]92.2015[/C][C]116.0568[/C][C]0.2023[/C][C]0.3244[/C][C]0.3244[/C][C]0.6429[/C][/ROW]
[ROW][C]207[/C][C]124.2[/C][C]111.7463[/C][C]98.6277[/C][C]124.8649[/C][C]0.0314[/C][C]0.6482[/C][C]0.6482[/C][C]0.9294[/C][/ROW]
[ROW][C]208[/C][C]104.7[/C][C]110.9945[/C][C]97.5778[/C][C]124.4111[/C][C]0.1789[/C][C]0.0269[/C][C]0.0269[/C][C]0.908[/C][/ROW]
[ROW][C]209[/C][C]111.9[/C][C]108.1048[/C][C]94.6203[/C][C]121.5893[/C][C]0.2906[/C][C]0.6897[/C][C]0.6897[/C][C]0.8164[/C][/ROW]
[ROW][C]210[/C][C]119[/C][C]106.5995[/C][C]92.5647[/C][C]120.6342[/C][C]0.0417[/C][C]0.2296[/C][C]0.2296[/C][C]0.7442[/C][/ROW]
[ROW][C]211[/C][C]102.9[/C][C]103.7342[/C][C]89.1908[/C][C]118.2776[/C][C]0.4552[/C][C]0.0198[/C][C]0.0198[/C][C]0.5976[/C][/ROW]
[ROW][C]212[/C][C]106.3[/C][C]105.2155[/C][C]90.2749[/C][C]120.1561[/C][C]0.4434[/C][C]0.6193[/C][C]0.6193[/C][C]0.6682[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=314328&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=314328&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[200])
19998.9-------
200101.9-------
201113.5116.1679106.9094125.42640.28610.99870.99870.9987
202109.5109.26899.8683118.66760.48070.18880.18880.9378
203110106.624797.2135116.03580.2410.27460.27460.8374
204114.2108.976497.7572120.19570.18070.4290.4290.8918
205106.9102.719691.0176114.42150.24190.02720.02720.5546
206109.2104.129292.2015116.05680.20230.32440.32440.6429
207124.2111.746398.6277124.86490.03140.64820.64820.9294
208104.7110.994597.5778124.41110.17890.02690.02690.908
209111.9108.104894.6203121.58930.29060.68970.68970.8164
210119106.599592.5647120.63420.04170.22960.22960.7442
211102.9103.734289.1908118.27760.45520.01980.01980.5976
212106.3105.215590.2749120.15610.44340.61930.61930.6682







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0407-0.02350.02350.02327.117800-0.33890.3389
2020.04390.00210.01280.01270.05383.58581.89360.02950.1842
2030.0450.03070.01880.018811.3936.18822.48760.42870.2657
2040.05250.04570.02550.025827.285811.46263.38560.66350.3651
2050.05810.03910.02820.028617.475912.66533.55880.5310.3983
2060.05840.04640.03130.031825.713214.83993.85230.64410.4393
2070.05990.10030.04110.0423155.094334.87635.90561.58190.6025
2080.0617-0.06010.04350.044339.620335.46935.9556-0.79950.6271
2090.06360.03390.04240.043214.403433.12865.75570.48210.611
2100.06720.10420.04860.0499153.772945.1936.72261.57510.7074
2110.0715-0.00810.04490.04610.695941.14796.4147-0.1060.6528
2120.07240.01020.0420.04311.176237.81696.14950.13780.6098

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
201 & 0.0407 & -0.0235 & 0.0235 & 0.0232 & 7.1178 & 0 & 0 & -0.3389 & 0.3389 \tabularnewline
202 & 0.0439 & 0.0021 & 0.0128 & 0.0127 & 0.0538 & 3.5858 & 1.8936 & 0.0295 & 0.1842 \tabularnewline
203 & 0.045 & 0.0307 & 0.0188 & 0.0188 & 11.393 & 6.1882 & 2.4876 & 0.4287 & 0.2657 \tabularnewline
204 & 0.0525 & 0.0457 & 0.0255 & 0.0258 & 27.2858 & 11.4626 & 3.3856 & 0.6635 & 0.3651 \tabularnewline
205 & 0.0581 & 0.0391 & 0.0282 & 0.0286 & 17.4759 & 12.6653 & 3.5588 & 0.531 & 0.3983 \tabularnewline
206 & 0.0584 & 0.0464 & 0.0313 & 0.0318 & 25.7132 & 14.8399 & 3.8523 & 0.6441 & 0.4393 \tabularnewline
207 & 0.0599 & 0.1003 & 0.0411 & 0.0423 & 155.0943 & 34.8763 & 5.9056 & 1.5819 & 0.6025 \tabularnewline
208 & 0.0617 & -0.0601 & 0.0435 & 0.0443 & 39.6203 & 35.4693 & 5.9556 & -0.7995 & 0.6271 \tabularnewline
209 & 0.0636 & 0.0339 & 0.0424 & 0.0432 & 14.4034 & 33.1286 & 5.7557 & 0.4821 & 0.611 \tabularnewline
210 & 0.0672 & 0.1042 & 0.0486 & 0.0499 & 153.7729 & 45.193 & 6.7226 & 1.5751 & 0.7074 \tabularnewline
211 & 0.0715 & -0.0081 & 0.0449 & 0.0461 & 0.6959 & 41.1479 & 6.4147 & -0.106 & 0.6528 \tabularnewline
212 & 0.0724 & 0.0102 & 0.042 & 0.0431 & 1.1762 & 37.8169 & 6.1495 & 0.1378 & 0.6098 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=314328&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]201[/C][C]0.0407[/C][C]-0.0235[/C][C]0.0235[/C][C]0.0232[/C][C]7.1178[/C][C]0[/C][C]0[/C][C]-0.3389[/C][C]0.3389[/C][/ROW]
[ROW][C]202[/C][C]0.0439[/C][C]0.0021[/C][C]0.0128[/C][C]0.0127[/C][C]0.0538[/C][C]3.5858[/C][C]1.8936[/C][C]0.0295[/C][C]0.1842[/C][/ROW]
[ROW][C]203[/C][C]0.045[/C][C]0.0307[/C][C]0.0188[/C][C]0.0188[/C][C]11.393[/C][C]6.1882[/C][C]2.4876[/C][C]0.4287[/C][C]0.2657[/C][/ROW]
[ROW][C]204[/C][C]0.0525[/C][C]0.0457[/C][C]0.0255[/C][C]0.0258[/C][C]27.2858[/C][C]11.4626[/C][C]3.3856[/C][C]0.6635[/C][C]0.3651[/C][/ROW]
[ROW][C]205[/C][C]0.0581[/C][C]0.0391[/C][C]0.0282[/C][C]0.0286[/C][C]17.4759[/C][C]12.6653[/C][C]3.5588[/C][C]0.531[/C][C]0.3983[/C][/ROW]
[ROW][C]206[/C][C]0.0584[/C][C]0.0464[/C][C]0.0313[/C][C]0.0318[/C][C]25.7132[/C][C]14.8399[/C][C]3.8523[/C][C]0.6441[/C][C]0.4393[/C][/ROW]
[ROW][C]207[/C][C]0.0599[/C][C]0.1003[/C][C]0.0411[/C][C]0.0423[/C][C]155.0943[/C][C]34.8763[/C][C]5.9056[/C][C]1.5819[/C][C]0.6025[/C][/ROW]
[ROW][C]208[/C][C]0.0617[/C][C]-0.0601[/C][C]0.0435[/C][C]0.0443[/C][C]39.6203[/C][C]35.4693[/C][C]5.9556[/C][C]-0.7995[/C][C]0.6271[/C][/ROW]
[ROW][C]209[/C][C]0.0636[/C][C]0.0339[/C][C]0.0424[/C][C]0.0432[/C][C]14.4034[/C][C]33.1286[/C][C]5.7557[/C][C]0.4821[/C][C]0.611[/C][/ROW]
[ROW][C]210[/C][C]0.0672[/C][C]0.1042[/C][C]0.0486[/C][C]0.0499[/C][C]153.7729[/C][C]45.193[/C][C]6.7226[/C][C]1.5751[/C][C]0.7074[/C][/ROW]
[ROW][C]211[/C][C]0.0715[/C][C]-0.0081[/C][C]0.0449[/C][C]0.0461[/C][C]0.6959[/C][C]41.1479[/C][C]6.4147[/C][C]-0.106[/C][C]0.6528[/C][/ROW]
[ROW][C]212[/C][C]0.0724[/C][C]0.0102[/C][C]0.042[/C][C]0.0431[/C][C]1.1762[/C][C]37.8169[/C][C]6.1495[/C][C]0.1378[/C][C]0.6098[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=314328&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=314328&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2010.0407-0.02350.02350.02327.117800-0.33890.3389
2020.04390.00210.01280.01270.05383.58581.89360.02950.1842
2030.0450.03070.01880.018811.3936.18822.48760.42870.2657
2040.05250.04570.02550.025827.285811.46263.38560.66350.3651
2050.05810.03910.02820.028617.475912.66533.55880.5310.3983
2060.05840.04640.03130.031825.713214.83993.85230.64410.4393
2070.05990.10030.04110.0423155.094334.87635.90561.58190.6025
2080.0617-0.06010.04350.044339.620335.46935.9556-0.79950.6271
2090.06360.03390.04240.043214.403433.12865.75570.48210.611
2100.06720.10420.04860.0499153.772945.1936.72261.57510.7074
2110.0715-0.00810.04490.04610.695941.14796.4147-0.1060.6528
2120.07240.01020.0420.04311.176237.81696.14950.13780.6098



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 = 1 ; par6 = 3 ; par7 = 2 ; 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*2
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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')