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 computationMon, 23 Jan 2017 09:49:37 +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/2017/Jan/23/t1485161394wc5grw2dqqoae3m.htm/, Retrieved Wed, 15 May 2024 12:58:30 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=304108, Retrieved Wed, 15 May 2024 12:58:30 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact43
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [times series] [2017-01-23 08:49:37] [9b51b7a87561b0bb9c41e32c304c2265] [Current]
Feedback Forum

Post a new message
Dataseries X:
0
0.5
0
0
1
0.5
0.5
1
0.5
0.5
0
0.5
0.5
0
0
0
0.5
0.5
0
0
0
0
0
0
1
0
1
0
0
0
0
0.5
0.5
0
0
0.5
0
0.5
0.5
0.5
0.5
0.5
0.5
0
0
0.5
0
0.5
0
0.5
1
0
1
0
0.5
1
0
0
0
0.5
1
0.5
0.5
0
0.5
0
0.5
0
0.5
0.5
0.5
0
0.5
0.5
0
0.5
0.5
0
0
1
1
0
0.5
0
0
0
0.5
0
0.5
0
0.5
0.5
0
0.5
0
0
0.5
1
0.5
0.5
0.5
0
0
0
0
0.5
0.5
0
0
0
0
0
1
1
1
1
1
0
0.5
1
0
0
0
0
0
0
0
0
0.5
1
1
0
0
0.5
1
0
1
0
0
0.5
1
0.5
0
0.5
1
0
0
0.5
0.5
1
0
1
0
0
1
0.5
1
0.5
0.5
0.5
0.5
0
0
1
1
1
0.5
1
0
0.5
1
0
0.5
1
1
0
0.5
0
0.5
0
0.5
0
0.5
0
1
0
0
0
0
0
0.5
0.5
0.5
0
0
1
0.5
0
0
0.5
0
0
0.5
0
0
0
0
0
0
0.5
1
0.5
0.5
0
0
0
0.5
1
0.5
0
0.5
0.5
1
0.5
0.5
0
0
0.5
0.5
0
0
0.5
0.5
0
0
0
0
0.5
0
0.5
0.5
0
0
1
0.5
0.5
0
0.5
0.5
0
0.5
0
0.5
0
1
0
0.5
0.5
0
0
1
0
0.5
0
0.5
1
0
0
1
1
0
1
0
0.5
0
0
0
0.5




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=304108&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[266])
2650.5-------
2661-------
26700.572-0.20361.34760.07420.13970.13970.1397
26800.4271-0.36871.22290.14640.85360.85360.0791
26910.5005-0.31321.31410.11440.8860.8860.1144
27010.4961-0.33581.3280.11760.11760.11760.1176
27100.5639-0.29771.42550.09980.16060.16060.1606
27210.5976-0.29431.48950.18830.90550.90550.1883
27300.536-0.40481.47690.13210.16690.16690.1669
2740.50.5198-0.44621.48580.4840.85420.85420.165
27500.5342-0.45671.52510.14530.5270.5270.1784
27600.54-0.47611.55610.14880.85120.85120.1874
27700.547-0.49631.59030.15210.84790.84790.1974
2780.50.5469-0.52281.61660.46580.84180.84180.2032

\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[266]) \tabularnewline
265 & 0.5 & - & - & - & - & - & - & - \tabularnewline
266 & 1 & - & - & - & - & - & - & - \tabularnewline
267 & 0 & 0.572 & -0.2036 & 1.3476 & 0.0742 & 0.1397 & 0.1397 & 0.1397 \tabularnewline
268 & 0 & 0.4271 & -0.3687 & 1.2229 & 0.1464 & 0.8536 & 0.8536 & 0.0791 \tabularnewline
269 & 1 & 0.5005 & -0.3132 & 1.3141 & 0.1144 & 0.886 & 0.886 & 0.1144 \tabularnewline
270 & 1 & 0.4961 & -0.3358 & 1.328 & 0.1176 & 0.1176 & 0.1176 & 0.1176 \tabularnewline
271 & 0 & 0.5639 & -0.2977 & 1.4255 & 0.0998 & 0.1606 & 0.1606 & 0.1606 \tabularnewline
272 & 1 & 0.5976 & -0.2943 & 1.4895 & 0.1883 & 0.9055 & 0.9055 & 0.1883 \tabularnewline
273 & 0 & 0.536 & -0.4048 & 1.4769 & 0.1321 & 0.1669 & 0.1669 & 0.1669 \tabularnewline
274 & 0.5 & 0.5198 & -0.4462 & 1.4858 & 0.484 & 0.8542 & 0.8542 & 0.165 \tabularnewline
275 & 0 & 0.5342 & -0.4567 & 1.5251 & 0.1453 & 0.527 & 0.527 & 0.1784 \tabularnewline
276 & 0 & 0.54 & -0.4761 & 1.5561 & 0.1488 & 0.8512 & 0.8512 & 0.1874 \tabularnewline
277 & 0 & 0.547 & -0.4963 & 1.5903 & 0.1521 & 0.8479 & 0.8479 & 0.1974 \tabularnewline
278 & 0.5 & 0.5469 & -0.5228 & 1.6166 & 0.4658 & 0.8418 & 0.8418 & 0.2032 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=304108&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[266])[/C][/ROW]
[ROW][C]265[/C][C]0.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]266[/C][C]1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]267[/C][C]0[/C][C]0.572[/C][C]-0.2036[/C][C]1.3476[/C][C]0.0742[/C][C]0.1397[/C][C]0.1397[/C][C]0.1397[/C][/ROW]
[ROW][C]268[/C][C]0[/C][C]0.4271[/C][C]-0.3687[/C][C]1.2229[/C][C]0.1464[/C][C]0.8536[/C][C]0.8536[/C][C]0.0791[/C][/ROW]
[ROW][C]269[/C][C]1[/C][C]0.5005[/C][C]-0.3132[/C][C]1.3141[/C][C]0.1144[/C][C]0.886[/C][C]0.886[/C][C]0.1144[/C][/ROW]
[ROW][C]270[/C][C]1[/C][C]0.4961[/C][C]-0.3358[/C][C]1.328[/C][C]0.1176[/C][C]0.1176[/C][C]0.1176[/C][C]0.1176[/C][/ROW]
[ROW][C]271[/C][C]0[/C][C]0.5639[/C][C]-0.2977[/C][C]1.4255[/C][C]0.0998[/C][C]0.1606[/C][C]0.1606[/C][C]0.1606[/C][/ROW]
[ROW][C]272[/C][C]1[/C][C]0.5976[/C][C]-0.2943[/C][C]1.4895[/C][C]0.1883[/C][C]0.9055[/C][C]0.9055[/C][C]0.1883[/C][/ROW]
[ROW][C]273[/C][C]0[/C][C]0.536[/C][C]-0.4048[/C][C]1.4769[/C][C]0.1321[/C][C]0.1669[/C][C]0.1669[/C][C]0.1669[/C][/ROW]
[ROW][C]274[/C][C]0.5[/C][C]0.5198[/C][C]-0.4462[/C][C]1.4858[/C][C]0.484[/C][C]0.8542[/C][C]0.8542[/C][C]0.165[/C][/ROW]
[ROW][C]275[/C][C]0[/C][C]0.5342[/C][C]-0.4567[/C][C]1.5251[/C][C]0.1453[/C][C]0.527[/C][C]0.527[/C][C]0.1784[/C][/ROW]
[ROW][C]276[/C][C]0[/C][C]0.54[/C][C]-0.4761[/C][C]1.5561[/C][C]0.1488[/C][C]0.8512[/C][C]0.8512[/C][C]0.1874[/C][/ROW]
[ROW][C]277[/C][C]0[/C][C]0.547[/C][C]-0.4963[/C][C]1.5903[/C][C]0.1521[/C][C]0.8479[/C][C]0.8479[/C][C]0.1974[/C][/ROW]
[ROW][C]278[/C][C]0.5[/C][C]0.5469[/C][C]-0.5228[/C][C]1.6166[/C][C]0.4658[/C][C]0.8418[/C][C]0.8418[/C][C]0.2032[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=304108&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=304108&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[266])
2650.5-------
2661-------
26700.572-0.20361.34760.07420.13970.13970.1397
26800.4271-0.36871.22290.14640.85360.85360.0791
26910.5005-0.31321.31410.11440.8860.8860.1144
27010.4961-0.33581.3280.11760.11760.11760.1176
27100.5639-0.29771.42550.09980.16060.16060.1606
27210.5976-0.29431.48950.18830.90550.90550.1883
27300.536-0.40481.47690.13210.16690.16690.1669
2740.50.5198-0.44621.48580.4840.85420.85420.165
27500.5342-0.45671.52510.14530.5270.5270.1784
27600.54-0.47611.55610.14880.85120.85120.1874
27700.547-0.49631.59030.15210.84790.84790.1974
2780.50.5469-0.52281.61660.46580.84180.84180.2032







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
2670.6918-InfInf20.327200-1.1441.144
2680.9507-InfInf20.18240.25480.5048-0.85410.9991
2690.82940.4995Inf1.55530.24950.2530.5030.9990.999
2700.85560.5039Inf1.33490.25390.25320.50321.00781.0012
2710.7796-InfInf1.46790.3180.26620.5159-1.12781.0265
2720.76140.4024Inf1.30720.16190.24880.49880.80480.9896
2730.8956-InfInf1.40620.28730.25430.5043-1.0721.0014
2740.9482-0.0396Inf1.23524e-040.22260.4718-0.03960.8811
2750.9463-InfInf1.32020.28540.22960.4791-1.06850.902
2760.9601-InfInf1.38820.29160.23580.4855-1.07990.9198
2770.9732-InfInf1.44380.29920.24150.4914-1.09390.9356
2780.998-0.0938Inf1.3310.00220.22160.4707-0.09380.8654

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
267 & 0.6918 & -Inf & Inf & 2 & 0.3272 & 0 & 0 & -1.144 & 1.144 \tabularnewline
268 & 0.9507 & -Inf & Inf & 2 & 0.1824 & 0.2548 & 0.5048 & -0.8541 & 0.9991 \tabularnewline
269 & 0.8294 & 0.4995 & Inf & 1.5553 & 0.2495 & 0.253 & 0.503 & 0.999 & 0.999 \tabularnewline
270 & 0.8556 & 0.5039 & Inf & 1.3349 & 0.2539 & 0.2532 & 0.5032 & 1.0078 & 1.0012 \tabularnewline
271 & 0.7796 & -Inf & Inf & 1.4679 & 0.318 & 0.2662 & 0.5159 & -1.1278 & 1.0265 \tabularnewline
272 & 0.7614 & 0.4024 & Inf & 1.3072 & 0.1619 & 0.2488 & 0.4988 & 0.8048 & 0.9896 \tabularnewline
273 & 0.8956 & -Inf & Inf & 1.4062 & 0.2873 & 0.2543 & 0.5043 & -1.072 & 1.0014 \tabularnewline
274 & 0.9482 & -0.0396 & Inf & 1.2352 & 4e-04 & 0.2226 & 0.4718 & -0.0396 & 0.8811 \tabularnewline
275 & 0.9463 & -Inf & Inf & 1.3202 & 0.2854 & 0.2296 & 0.4791 & -1.0685 & 0.902 \tabularnewline
276 & 0.9601 & -Inf & Inf & 1.3882 & 0.2916 & 0.2358 & 0.4855 & -1.0799 & 0.9198 \tabularnewline
277 & 0.9732 & -Inf & Inf & 1.4438 & 0.2992 & 0.2415 & 0.4914 & -1.0939 & 0.9356 \tabularnewline
278 & 0.998 & -0.0938 & Inf & 1.331 & 0.0022 & 0.2216 & 0.4707 & -0.0938 & 0.8654 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=304108&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]267[/C][C]0.6918[/C][C]-Inf[/C][C]Inf[/C][C]2[/C][C]0.3272[/C][C]0[/C][C]0[/C][C]-1.144[/C][C]1.144[/C][/ROW]
[ROW][C]268[/C][C]0.9507[/C][C]-Inf[/C][C]Inf[/C][C]2[/C][C]0.1824[/C][C]0.2548[/C][C]0.5048[/C][C]-0.8541[/C][C]0.9991[/C][/ROW]
[ROW][C]269[/C][C]0.8294[/C][C]0.4995[/C][C]Inf[/C][C]1.5553[/C][C]0.2495[/C][C]0.253[/C][C]0.503[/C][C]0.999[/C][C]0.999[/C][/ROW]
[ROW][C]270[/C][C]0.8556[/C][C]0.5039[/C][C]Inf[/C][C]1.3349[/C][C]0.2539[/C][C]0.2532[/C][C]0.5032[/C][C]1.0078[/C][C]1.0012[/C][/ROW]
[ROW][C]271[/C][C]0.7796[/C][C]-Inf[/C][C]Inf[/C][C]1.4679[/C][C]0.318[/C][C]0.2662[/C][C]0.5159[/C][C]-1.1278[/C][C]1.0265[/C][/ROW]
[ROW][C]272[/C][C]0.7614[/C][C]0.4024[/C][C]Inf[/C][C]1.3072[/C][C]0.1619[/C][C]0.2488[/C][C]0.4988[/C][C]0.8048[/C][C]0.9896[/C][/ROW]
[ROW][C]273[/C][C]0.8956[/C][C]-Inf[/C][C]Inf[/C][C]1.4062[/C][C]0.2873[/C][C]0.2543[/C][C]0.5043[/C][C]-1.072[/C][C]1.0014[/C][/ROW]
[ROW][C]274[/C][C]0.9482[/C][C]-0.0396[/C][C]Inf[/C][C]1.2352[/C][C]4e-04[/C][C]0.2226[/C][C]0.4718[/C][C]-0.0396[/C][C]0.8811[/C][/ROW]
[ROW][C]275[/C][C]0.9463[/C][C]-Inf[/C][C]Inf[/C][C]1.3202[/C][C]0.2854[/C][C]0.2296[/C][C]0.4791[/C][C]-1.0685[/C][C]0.902[/C][/ROW]
[ROW][C]276[/C][C]0.9601[/C][C]-Inf[/C][C]Inf[/C][C]1.3882[/C][C]0.2916[/C][C]0.2358[/C][C]0.4855[/C][C]-1.0799[/C][C]0.9198[/C][/ROW]
[ROW][C]277[/C][C]0.9732[/C][C]-Inf[/C][C]Inf[/C][C]1.4438[/C][C]0.2992[/C][C]0.2415[/C][C]0.4914[/C][C]-1.0939[/C][C]0.9356[/C][/ROW]
[ROW][C]278[/C][C]0.998[/C][C]-0.0938[/C][C]Inf[/C][C]1.331[/C][C]0.0022[/C][C]0.2216[/C][C]0.4707[/C][C]-0.0938[/C][C]0.8654[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=304108&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=304108&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
2670.6918-InfInf20.327200-1.1441.144
2680.9507-InfInf20.18240.25480.5048-0.85410.9991
2690.82940.4995Inf1.55530.24950.2530.5030.9990.999
2700.85560.5039Inf1.33490.25390.25320.50321.00781.0012
2710.7796-InfInf1.46790.3180.26620.5159-1.12781.0265
2720.76140.4024Inf1.30720.16190.24880.49880.80480.9896
2730.8956-InfInf1.40620.28730.25430.5043-1.0721.0014
2740.9482-0.0396Inf1.23524e-040.22260.4718-0.03960.8811
2750.9463-InfInf1.32020.28540.22960.4791-1.06850.902
2760.9601-InfInf1.38820.29160.23580.4855-1.07990.9198
2770.9732-InfInf1.44380.29920.24150.4914-1.09390.9356
2780.998-0.0938Inf1.3310.00220.22160.4707-0.09380.8654



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