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, 21 Dec 2016 15:59:49 +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/2016/Dec/21/t1482332536bj55j4binclvmeu.htm/, Retrieved Mon, 06 May 2024 11:11:24 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302362, Retrieved Mon, 06 May 2024 11:11:24 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact62
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Exponential Smoothing] [Exponential Smoot...] [2016-12-07 12:37:40] [66fd4fb4ba69b9778420cad7e9eaebe3]
- RMPD    [ARIMA Forecasting] [Paper( Arima Fore...] [2016-12-21 14:59:49] [e302b41a790d997d9c99fd21b0cdfda2] [Current]
- R P       [ARIMA Forecasting] [Paper ( Arima bac...] [2016-12-21 22:48:59] [91e1ca4663e910c18c2cdaf49e7332ba]
Feedback Forum

Post a new message
Dataseries X:
6600
6800
7500
7500
7400
7600
7300
7900
7100
7700
6500
5000
6200
7000
7400
7200
6900
7400
6400
5500
6600
7000
6200
5100
5600
6400
7200
7100
7000
7300
7600
7600
6700
6800
5900
5000
5600
5600
7100
7000
6600
7200
7200
7200
6200
6500
5800
4900
5800
6800
7100
6900
6800
7200
7200
7400
6400
6700
6200
5000
5600
6700
7000
6800
6900
7100
7300
7300
6600
6800
5900
4900
5500
6300
7100
6700
6700
7100
7300
7300
6200
6500
5800
4700
5500
6500
6800
6600
6300
6700
7200
7200
5900
6100
5500
4700
5400
6400
7500
6900
6400
6700
7100
7100
4000
6300
5400
4600
5400
6000
7200
6800
6400
7100
7500
7400
6400
6600
5600
4800
5400
6600




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 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 time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302362&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]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=302362&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302362&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 time1 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[110])
1095400-------
1106000-------
11172006512.70785213.42837592.81830.10620.82390.82390.8239
11268006760.03385279.76687969.95460.47420.2380.2380.8909
11364006795.80795277.36858032.14740.26520.49730.49730.8965
11471006683.78895132.28867937.61180.25760.67130.67130.8574
11575006496.86664869.62337791.36190.06440.18060.18060.7741
11674006302.55034575.73717648.9810.05510.04070.04070.6702
11764006151.24424341.92917538.12060.36260.03880.03880.5846
11866006068.26634216.9747474.27860.22930.32190.32190.5379
11956006053.28694195.38537462.12480.26410.22340.22340.5295
12048006087.75744239.84657493.01560.03620.75180.75180.5487
12154006146.16244310.40477547.9160.14840.97010.97010.581
12266006205.60474378.66617605.67830.29040.87030.87030.6133

\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[110]) \tabularnewline
109 & 5400 & - & - & - & - & - & - & - \tabularnewline
110 & 6000 & - & - & - & - & - & - & - \tabularnewline
111 & 7200 & 6512.7078 & 5213.4283 & 7592.8183 & 0.1062 & 0.8239 & 0.8239 & 0.8239 \tabularnewline
112 & 6800 & 6760.0338 & 5279.7668 & 7969.9546 & 0.4742 & 0.238 & 0.238 & 0.8909 \tabularnewline
113 & 6400 & 6795.8079 & 5277.3685 & 8032.1474 & 0.2652 & 0.4973 & 0.4973 & 0.8965 \tabularnewline
114 & 7100 & 6683.7889 & 5132.2886 & 7937.6118 & 0.2576 & 0.6713 & 0.6713 & 0.8574 \tabularnewline
115 & 7500 & 6496.8666 & 4869.6233 & 7791.3619 & 0.0644 & 0.1806 & 0.1806 & 0.7741 \tabularnewline
116 & 7400 & 6302.5503 & 4575.7371 & 7648.981 & 0.0551 & 0.0407 & 0.0407 & 0.6702 \tabularnewline
117 & 6400 & 6151.2442 & 4341.9291 & 7538.1206 & 0.3626 & 0.0388 & 0.0388 & 0.5846 \tabularnewline
118 & 6600 & 6068.2663 & 4216.974 & 7474.2786 & 0.2293 & 0.3219 & 0.3219 & 0.5379 \tabularnewline
119 & 5600 & 6053.2869 & 4195.3853 & 7462.1248 & 0.2641 & 0.2234 & 0.2234 & 0.5295 \tabularnewline
120 & 4800 & 6087.7574 & 4239.8465 & 7493.0156 & 0.0362 & 0.7518 & 0.7518 & 0.5487 \tabularnewline
121 & 5400 & 6146.1624 & 4310.4047 & 7547.916 & 0.1484 & 0.9701 & 0.9701 & 0.581 \tabularnewline
122 & 6600 & 6205.6047 & 4378.6661 & 7605.6783 & 0.2904 & 0.8703 & 0.8703 & 0.6133 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302362&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[110])[/C][/ROW]
[ROW][C]109[/C][C]5400[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]6000[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]7200[/C][C]6512.7078[/C][C]5213.4283[/C][C]7592.8183[/C][C]0.1062[/C][C]0.8239[/C][C]0.8239[/C][C]0.8239[/C][/ROW]
[ROW][C]112[/C][C]6800[/C][C]6760.0338[/C][C]5279.7668[/C][C]7969.9546[/C][C]0.4742[/C][C]0.238[/C][C]0.238[/C][C]0.8909[/C][/ROW]
[ROW][C]113[/C][C]6400[/C][C]6795.8079[/C][C]5277.3685[/C][C]8032.1474[/C][C]0.2652[/C][C]0.4973[/C][C]0.4973[/C][C]0.8965[/C][/ROW]
[ROW][C]114[/C][C]7100[/C][C]6683.7889[/C][C]5132.2886[/C][C]7937.6118[/C][C]0.2576[/C][C]0.6713[/C][C]0.6713[/C][C]0.8574[/C][/ROW]
[ROW][C]115[/C][C]7500[/C][C]6496.8666[/C][C]4869.6233[/C][C]7791.3619[/C][C]0.0644[/C][C]0.1806[/C][C]0.1806[/C][C]0.7741[/C][/ROW]
[ROW][C]116[/C][C]7400[/C][C]6302.5503[/C][C]4575.7371[/C][C]7648.981[/C][C]0.0551[/C][C]0.0407[/C][C]0.0407[/C][C]0.6702[/C][/ROW]
[ROW][C]117[/C][C]6400[/C][C]6151.2442[/C][C]4341.9291[/C][C]7538.1206[/C][C]0.3626[/C][C]0.0388[/C][C]0.0388[/C][C]0.5846[/C][/ROW]
[ROW][C]118[/C][C]6600[/C][C]6068.2663[/C][C]4216.974[/C][C]7474.2786[/C][C]0.2293[/C][C]0.3219[/C][C]0.3219[/C][C]0.5379[/C][/ROW]
[ROW][C]119[/C][C]5600[/C][C]6053.2869[/C][C]4195.3853[/C][C]7462.1248[/C][C]0.2641[/C][C]0.2234[/C][C]0.2234[/C][C]0.5295[/C][/ROW]
[ROW][C]120[/C][C]4800[/C][C]6087.7574[/C][C]4239.8465[/C][C]7493.0156[/C][C]0.0362[/C][C]0.7518[/C][C]0.7518[/C][C]0.5487[/C][/ROW]
[ROW][C]121[/C][C]5400[/C][C]6146.1624[/C][C]4310.4047[/C][C]7547.916[/C][C]0.1484[/C][C]0.9701[/C][C]0.9701[/C][C]0.581[/C][/ROW]
[ROW][C]122[/C][C]6600[/C][C]6205.6047[/C][C]4378.6661[/C][C]7605.6783[/C][C]0.2904[/C][C]0.8703[/C][C]0.8703[/C][C]0.6133[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302362&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302362&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[110])
1095400-------
1106000-------
11172006512.70785213.42837592.81830.10620.82390.82390.8239
11268006760.03385279.76687969.95460.47420.2380.2380.8909
11364006795.80795277.36858032.14740.26520.49730.49730.8965
11471006683.78895132.28867937.61180.25760.67130.67130.8574
11575006496.86664869.62337791.36190.06440.18060.18060.7741
11674006302.55034575.73717648.9810.05510.04070.04070.6702
11764006151.24424341.92917538.12060.36260.03880.03880.5846
11866006068.26634216.9747474.27860.22930.32190.32190.5379
11956006053.28694195.38537462.12480.26410.22340.22340.5295
12048006087.75744239.84657493.01560.03620.75180.75180.5487
12154006146.16244310.40477547.9160.14840.97010.97010.581
12266006205.60474378.66617605.67830.29040.87030.87030.6133







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1110.08460.09550.09550.1002472370.6344001.11181.1118
1120.09130.00590.05070.05311597.297236983.9657486.810.06470.5882
1130.0928-0.06180.05440.0554156663.8818210210.6044458.4873-0.64030.6056
1140.09570.05860.05550.0566173231.7012200965.8786448.29220.67330.6225
1150.10170.13380.07110.0741006276.617362028.0263601.68761.62270.8225
1160.1090.14830.0840.08831204395.9017502422.6722708.81781.77530.9813
1170.1150.03890.07750.081461879.4592439487.9275662.93890.40240.8986
1180.11820.08060.07790.0817282740.7711419894.5329647.99270.86020.8938
1190.1187-0.08090.07820.0813205469.0233396069.4763629.3405-0.73330.876
1200.1178-0.26830.09730.09681658319.235522294.4522722.6994-2.08310.9967
1210.1164-0.13820.1010.0997556758.3304525427.532724.8638-1.2071.0158
1220.11510.05980.09750.0966155547.6295494604.2068703.2810.6380.9843

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
111 & 0.0846 & 0.0955 & 0.0955 & 0.1002 & 472370.6344 & 0 & 0 & 1.1118 & 1.1118 \tabularnewline
112 & 0.0913 & 0.0059 & 0.0507 & 0.0531 & 1597.297 & 236983.9657 & 486.81 & 0.0647 & 0.5882 \tabularnewline
113 & 0.0928 & -0.0618 & 0.0544 & 0.0554 & 156663.8818 & 210210.6044 & 458.4873 & -0.6403 & 0.6056 \tabularnewline
114 & 0.0957 & 0.0586 & 0.0555 & 0.0566 & 173231.7012 & 200965.8786 & 448.2922 & 0.6733 & 0.6225 \tabularnewline
115 & 0.1017 & 0.1338 & 0.0711 & 0.074 & 1006276.617 & 362028.0263 & 601.6876 & 1.6227 & 0.8225 \tabularnewline
116 & 0.109 & 0.1483 & 0.084 & 0.0883 & 1204395.9017 & 502422.6722 & 708.8178 & 1.7753 & 0.9813 \tabularnewline
117 & 0.115 & 0.0389 & 0.0775 & 0.0814 & 61879.4592 & 439487.9275 & 662.9389 & 0.4024 & 0.8986 \tabularnewline
118 & 0.1182 & 0.0806 & 0.0779 & 0.0817 & 282740.7711 & 419894.5329 & 647.9927 & 0.8602 & 0.8938 \tabularnewline
119 & 0.1187 & -0.0809 & 0.0782 & 0.0813 & 205469.0233 & 396069.4763 & 629.3405 & -0.7333 & 0.876 \tabularnewline
120 & 0.1178 & -0.2683 & 0.0973 & 0.0968 & 1658319.235 & 522294.4522 & 722.6994 & -2.0831 & 0.9967 \tabularnewline
121 & 0.1164 & -0.1382 & 0.101 & 0.0997 & 556758.3304 & 525427.532 & 724.8638 & -1.207 & 1.0158 \tabularnewline
122 & 0.1151 & 0.0598 & 0.0975 & 0.0966 & 155547.6295 & 494604.2068 & 703.281 & 0.638 & 0.9843 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302362&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]111[/C][C]0.0846[/C][C]0.0955[/C][C]0.0955[/C][C]0.1002[/C][C]472370.6344[/C][C]0[/C][C]0[/C][C]1.1118[/C][C]1.1118[/C][/ROW]
[ROW][C]112[/C][C]0.0913[/C][C]0.0059[/C][C]0.0507[/C][C]0.0531[/C][C]1597.297[/C][C]236983.9657[/C][C]486.81[/C][C]0.0647[/C][C]0.5882[/C][/ROW]
[ROW][C]113[/C][C]0.0928[/C][C]-0.0618[/C][C]0.0544[/C][C]0.0554[/C][C]156663.8818[/C][C]210210.6044[/C][C]458.4873[/C][C]-0.6403[/C][C]0.6056[/C][/ROW]
[ROW][C]114[/C][C]0.0957[/C][C]0.0586[/C][C]0.0555[/C][C]0.0566[/C][C]173231.7012[/C][C]200965.8786[/C][C]448.2922[/C][C]0.6733[/C][C]0.6225[/C][/ROW]
[ROW][C]115[/C][C]0.1017[/C][C]0.1338[/C][C]0.0711[/C][C]0.074[/C][C]1006276.617[/C][C]362028.0263[/C][C]601.6876[/C][C]1.6227[/C][C]0.8225[/C][/ROW]
[ROW][C]116[/C][C]0.109[/C][C]0.1483[/C][C]0.084[/C][C]0.0883[/C][C]1204395.9017[/C][C]502422.6722[/C][C]708.8178[/C][C]1.7753[/C][C]0.9813[/C][/ROW]
[ROW][C]117[/C][C]0.115[/C][C]0.0389[/C][C]0.0775[/C][C]0.0814[/C][C]61879.4592[/C][C]439487.9275[/C][C]662.9389[/C][C]0.4024[/C][C]0.8986[/C][/ROW]
[ROW][C]118[/C][C]0.1182[/C][C]0.0806[/C][C]0.0779[/C][C]0.0817[/C][C]282740.7711[/C][C]419894.5329[/C][C]647.9927[/C][C]0.8602[/C][C]0.8938[/C][/ROW]
[ROW][C]119[/C][C]0.1187[/C][C]-0.0809[/C][C]0.0782[/C][C]0.0813[/C][C]205469.0233[/C][C]396069.4763[/C][C]629.3405[/C][C]-0.7333[/C][C]0.876[/C][/ROW]
[ROW][C]120[/C][C]0.1178[/C][C]-0.2683[/C][C]0.0973[/C][C]0.0968[/C][C]1658319.235[/C][C]522294.4522[/C][C]722.6994[/C][C]-2.0831[/C][C]0.9967[/C][/ROW]
[ROW][C]121[/C][C]0.1164[/C][C]-0.1382[/C][C]0.101[/C][C]0.0997[/C][C]556758.3304[/C][C]525427.532[/C][C]724.8638[/C][C]-1.207[/C][C]1.0158[/C][/ROW]
[ROW][C]122[/C][C]0.1151[/C][C]0.0598[/C][C]0.0975[/C][C]0.0966[/C][C]155547.6295[/C][C]494604.2068[/C][C]703.281[/C][C]0.638[/C][C]0.9843[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302362&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302362&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
1110.08460.09550.09550.1002472370.6344001.11181.1118
1120.09130.00590.05070.05311597.297236983.9657486.810.06470.5882
1130.0928-0.06180.05440.0554156663.8818210210.6044458.4873-0.64030.6056
1140.09570.05860.05550.0566173231.7012200965.8786448.29220.67330.6225
1150.10170.13380.07110.0741006276.617362028.0263601.68761.62270.8225
1160.1090.14830.0840.08831204395.9017502422.6722708.81781.77530.9813
1170.1150.03890.07750.081461879.4592439487.9275662.93890.40240.8986
1180.11820.08060.07790.0817282740.7711419894.5329647.99270.86020.8938
1190.1187-0.08090.07820.0813205469.0233396069.4763629.3405-0.73330.876
1200.1178-0.26830.09730.09681658319.235522294.4522722.6994-2.08310.9967
1210.1164-0.13820.1010.0997556758.3304525427.532724.8638-1.2071.0158
1220.11510.05980.09750.0966155547.6295494604.2068703.2810.6380.9843



Parameters (Session):
par1 = 12 ; par2 = 2.0 ; par3 = 0 ; par4 = 1 ; par5 = 1 ; par6 = 2 ; par7 = 1 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 2.0 ; par3 = 0 ; par4 = 1 ; par5 = 1 ; par6 = 2 ; par7 = 1 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '1'
par8 <- '1'
par7 <- '1'
par6 <- '2'
par5 <- '1'
par4 <- '1'
par3 <- '0'
par2 <- '2.0'
par1 <- '0'
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')