1,273
Views
7
CrossRef citations to date
0
Altmetric
Articles

Solution for a time-series AR model based on robust TLS estimation

, &
Pages 768-779 | Received 23 May 2018, Accepted 21 Oct 2018, Published online: 23 Jan 2019

Abstract

We discuss an algorithm for the autoregression (AR) model as a typical time-series model. By analyzing the structure of the AR model, we highlight the shortcomings of traditional algorithms for model parameter estimation and propose an approach to overcome the shortcomings of traditional solutions for the AR model. The errors-in-variables (EIV) model is used to solve an existing problem. There is an obvious difference between the AR model and a traditional model. For the AR model, one observation datum appears repeatedly; hence, the residual of one observation datum is not unique. Furthermore, in theory, the optimal estimation of model parameters cannot be obtained by current solutions. Based on an analysis of the AR model, we focus on how to obtain the optimal estimation when the observation data of the AR model are contaminated by outliers. The median function is used to establish a modified solution for the AR model based on the institute of geodesy & geophysics, Chinese academy of sciences (IGG) weight function by comparison with current algorithms for the robust estimation of the EIV model. We propose an iterative algorithm based on median function. Finally, we apply two numerical instances to compare the proposed algorithm with traditional algorithms and draw conclusions from results of the instances.

1. Introduction

The time-series model is widely used in the relative fields of prediction, such as solar irradiance prediction, ground subsidence prediction and weather prediction (Zhangzhen and Tianhe Citation2012; Hirata and Aihara Citation2017; do Nascimento Camelo et al. Citation2018; Tuncel and Baydogan Citation2018). The autoregression (AR) model is a typical time-series model, and the theory based on AR model is developed. Time dimensions are taken into account when the variables described by AR model are related to time (Pfeifer and Deutsch Citation1980; Pfeifer and Ve Bodily Citation1990); when stochastic character of AR model has an influence on estimation model parameters, this factor is also investigated (Di Giacinto Citation2006); besides, AR model with Kalman filter is proposed for non-linear estimators (Kurt and Batu Tunay Citation2015). As a mathematical fitting model, the precision of the AR model’s parameter estimation determines the efficiency of a prediction (Wan and Xiao Citation2016; Datteo et al. Citation2018). Currently, traditional algorithms for parameter estimation for the AR model involve transforming the AR model into the Gauss–Markov model (G–M model) and computing the model parameters based on least-squares (LS) estimation. The computation process is expressed as follows: {v=BxlvN(0,σ02P1)vTPv=min{x̂=(BTPB)1BTPlσ̂02=vTPvrD(x̂)σ̂02(BTPB)1

where v is the error vector that exists in the observation vector (l), which is composed of observation data; v follows a normal distribution. B is the coefficient matrix that expresses the relationship between the observation vector (l) and model parameters vector (x). In a stochastic model, σ02 is the variance component of the unit weight, and its estimation is written as σ̂02. P is the weight matrix. Based on LS(vTPv = min), the model parameters (x) can be estimated, and the estimation is written as x̂. D(x̂) denotes the covariance matrix, whereas r denotes redundancy.

A traditional solution for model parameter estimation only takes into account the observation error in the observation vector by implementing least constraints on it; however, as highlighted by Adcock (Citation1877), the shortcomings of a traditional solution are that it ignores the error that exists in the coefficient matrix, and the elements of the coefficient matrix are also composed of observation data. To take into account errors that exist in the observation vector and coefficient matrix simultaneously, the G–M model was developed, and a more scientific model called the errors-in-variables model (EIV model; Adcock 1877) was proposed and written as follows: (1) {v=(B+EB)xl[vb]N([00],σ02[P100PB1])(1)

where EB is the error matrix that exists in the coefficient matrix (B), b = vec(EB)(vec(·) represents the vector that stacks one column of EB underneath the previous one, and PB denotes the weight matrix of the coefficient matrix. To take into account both observation errors in the observation vector and coefficient matrix, total least squares (TLS) is proposed to extend the traditional criterion of LS: (2) vTPv+bTPBb=min(2)

Researchers have discussed optimal solutions for the EIV model (Golub and Van Loan Citation1980; Schaffrin and Wieser Citation2008; Mahboub Citation2014; Ai-Sharadqah and Ho Citation2018), and it is extensively used in relative fields of geoscience (Schaffrin and Uzun Citation2011; Mahboub Citation2012; Wang et al. Citation2016; Leyang et al. Citation2017).

In this article, we introduce the EIV model into time-series prediction, in addition to discussing a solution for AR model parameter estimation based on TLS. Particularly, the optimal algorithm for robust estimation is discussed when the observation data in the AR model are contaminated by outliers. This remainder of this article is organized as follows: in Section 2, the AR model is shown in the form of the EIV model, and the difference between the AR model and traditional EIV model is analyzed. In Section 3, traditional solutions for AR model parameter estimation are presented first. Then, a modified solution for AR model parameter estimation while outliers exist in the observation data is proposed, where the proposed solution is based on robust estimation and the median function. In Section 4, the feasibility and efficiency of the proposed solution are proved using two numerical instances.

2. AR model and traditional solutions for robust estimation

2.1. EIV model and its solution

Suppose that the quantity of model parameters is m, such that (a1,a2,,am), and the quantity of observation data is m + n, such that (h1,h2,,hm+n). Then, the AR model can be expressed as follows: (3) {hm+1=a1h1+a2h2++amhmhm+2=a1h2+a2h3++amhm+1hm+n=a1hn+a2hn+1++amhm+n1(3)

The AR model can be rewritten using the G–M model as follows: (4) [vm+1vm+2vm+n]v+[hm+1hm+2hm+n]l=[h1h2hmh2h3hm+1hnhn+1hm+n1]B[a1a2am]x(4)

where (vm+1,vm+2,,vm+n) is an error vector that exists in the observation vector (l), which is denoted as v in the equation. If we transpose the observation vector from the left-hand side to the right-hand side of EquationEquation (4), then the standard expression of the G–M model can be obtained as v = Bx - l, and the model parameters can be obtained using the method presented in the previous section. Note that elements of the coefficient matrix also consist of observation data; hence, there are observation errors in the coefficient matrix. If we define EB as the error matrix that exists in the coefficient matrix, then EquationEquation (4) can be rewritten using the EIV model as v = (B + EB)x - l. To obtain the optimal estimation of the EIV model parameters, the criterion of TLS is defined as EquationEquation (2). Many solutions have been established for the EIV model, as cited previously. Typical solutions that can take into account the stochastic character of the model were proposed (Schaffrin and Wieser Citation2008; Mahboub Citation2014; Fang et al. Citation2017). In this article, we choose the iterative solution proposed by Schaffrin and Wieser (Citation2008) as an example: (5) {x̂=(BT(Q+((x̂TQ0x̂)Qb)1Bδ̂Q0)1BT(Q+(x̂TQ0x̂)Qb)1lv̂=Qλ̂ÊB=Qbλ̂x̂TQ0(5)

where x̂, v̂ and ÊB are estimations of the relative parameters; Q, Q0 and Qb are cofactor matrices; and P=Q1 and PB=Q01Qb1, where represents the symbol of the Kronecker–Zehfuss product. λ̂ is the estimation of Lagrange multipliers λ, δ̂=λ̂TQbλ̂. The detailed iteration can be found in the seminal report of Schaffrin and Wieser (Citation2008).

Additionally, by EquationEquation (4), an obvious characteristic of the AR model can be determined such that the same element appears in the model repeatedly: the quantity of one element in vector (h1,h2,,hm) that appears in the AR model is (1, 2, …, m), respectively, whereas (hm+1,hm+2,,hm+n) is (n, …,1), respectively. Thus, although the AR model belongs to the catalogue of EIV models, solutions for the traditional EIV model may not be suitable for the AR model because, in a mathematical model, one observation datum should obtain a unique residual or the same residual; however, current solutions cannot ensure that the observation datum meets this requirement, which results from the condition that one observation datum appears in the model repeatedly. Furthermore, this fact has an influence on the optimal algorithm, particularly for robust estimation, which is the main problem addressed in the following discussion.

2.2. Analysis of traditional robust estimation for the AR model

According to the previous analysis, to take into account the observation error in the observation vector and coefficient matrix, the EIV model is considered to be a rational solution for the parameter estimation of the AR model. However, the factor that one observation datum obtains different residuals because of its repeated appearance cannot be overcome by current solutions. Such a phenomenon has an influence on, for example, parameter estimation and precision statistics, particularly for robust estimation. In fact, the observation data are contaminated by an observation error unavoidably. When the error belongs to the stochastic error, criteria such as LS and maximum likelihood estimation are used to obtain the optimal estimation of model parameters. In the intervening time, when the observation data are contaminated by outliers, robust estimation is used to overcome the influence that outliers have on parameter estimation. As is well known, to overcome the influence of outliers that exist in the observation data, the method of robust estimation uses a weight function, such as the Huber weight function (Huber Citation1964) and IGG weight function (Yang Citation1999), to modify the weight of the observation data. Considering the IGG weight function, for example, (6) P¯i={Pi,  |v̂i|aPia/|v̂i|,  a<|v̂i|b0,b<|v̂i|(6)

where Pi is the initial weight value of the observation data; |v̂i| is the absolute value of the residual for the observation data; a and b denote the threshold value; and their values are often a=1.5σ and b=2.5σ, whereσ is a variance component.

Robust estimation uses the weight function to modify the weight value of the observation data. Generally, poorly accurate observation data that are assessed by the residual obtain a smaller weight value, and its influence on parameter estimation can be modified properly. In this process, observation data precision is assessed by the residual. The IGG weight function has three segments:

  1. If the residual is smaller than or equal to threshold value a, then the weight of observation data remains invariant.

  2. If the residual is greater than threshold value a but smaller than or equal to threshold value b, then the weight of the observation data should be modified and becomes smaller according to the formula.

  3. If the residual is greater than threshold value b, then zero is assigned to the weight of the observation data.

For the EIV model, the residuals of the observation vector and coefficient matrix are obtained by current solutions; however, as shown in the previous analysis, solutions for the AR model based on TLS make one observation datum obtain different residuals, which could lead to failure in the utilization weight function for robust estimation.

3. Iterative algorithm for the AR model

According to the analysis in the previous section, the AR model is different from the traditional EIV model. The obvious characteristic is that one observation datum appears in the model repeatedly. This phenomenon causes the observation datum to obtain different residuals. As cited in EquationEquation (4), one element in vector (h1,h2,,hm) appears in Equationthe equation (1, 2, …, m) times, respectively, whereas (hm+1, hm+2, …, hm+n) is (n, …,1), respectively. Therefore, if we define Δi(i = 1, 2, …, m + n), which represents the observation error in the observation data, then the observation error that exists in the observation vector (h1, …, hm, hm+1,…, hm+n) can be expressed as (Δ1,,Δm,Δm+1,,Δm+n), and the elements of error vector Δi are as follows: (7) {Δ1=[Δ1]Δm=[Δm1Δmm]Δm+1=[Δm+11Δm+1n]Δm+n=[Δm+n](7)

To obtain a unique residual for the observation data, we use the median function (med[•]): (8) {v1=med[(Δ1)2]vm=med[(Δm1)2(Δmm)2]vm+1=med[(Δm+11)2(Δm+1n)2]vm+n=med[(Δm+n)2](8)

The unique observation error of the observation data can be obtained using the median function. Additionally, the median function is robustly efficient; in seminal reports (Rousseeuw and Wagner Citation1994), conclusions have indicated that when the contamination rate of outliers that exist in the observation data is not more than 50%, solutions based on the median function can obtain a stable estimation for model parameters. Furthermore, we use the median function to obtain the variance component, which is a vital parameter for the weight function and robust estimation: (9) σ=1.483med[v1,v2,,vm+n](9)

whereas the variance component is typically computed as follows: (10) σ=[v1v2vm+n]Pm+n[v1v2vm+n]T/r(10)

where Pm+n is the weight matrix of the observation data. Note that the estimation of the variance component is biased by the current solutions (Shen et al. Citation2011). The efficiency of above two methods for computing the variance component will be compared by instance in the next section.

An iterative algorithm for robust TLS estimation is established for the AR model using the median function:

Step 1. Calculate the initial values of the AR model parameters using algorithms based on the TLS criteria: x̂0=(BT(Q+((x̂TQ0x̂)Qb)1Bδ̂Q0)1BT(Q+(x̂TQ0x̂)Qb)1l

Step 2. Calculate the residuals of the observation data in the coefficient matrix and observation vector, respectively: {v̂=Qλ̂ÊB=Qbλ̂x̂TQ0

Step 3. Calculate the unique residual of each observation datum based on EquationEquations (7) and Equation(8), which was proposed previously. The unique residuals of all observation data are listed as (v1, v2, …, vm+n).

Step 4. Calculate the variance component (σ̂) using EquationEquation (9) and redefine the weight based on the weight function. The IGG weight function is used in this article: P¯i={Pi,|v̂i|aPia/|v̂i|,a<|v̂i|b0,b<|v̂i|

Note that the threshold value and residual estimation (v̂i) of the weight function should be calculated based on σ̂ and (v1, v2, …, vm+n), which were proposed previously.

Step 5. Calculate the model parameters and iteration from Step 2 to Step 4 until the estimation converges.

This algorithm is called robust M-TLS in this article.

4. Numerical examples and discussion

In this section, two numerical examples are used to verify the proposed robust TLS estimation for the AR model. The aims of these examples are as follows:

(I) The first instance uses real observation data, and we compare the differences of solutions for the AR model between LS and TLS. The model for which both the coefficient matrix and observation vector have observation errors is computed using LS and TLS, respectively. The results based on the two solutions are compared with each other.

(II) The second example uses simulated data, and we insert simulated outliers into the EIV model. The traditional algorithm for robust LS is used to calculate the model parameters. Meanwhile, both the robust TLS algorithm and robust M-TLS algorithm are also used to calculate the model parameters. The results are compared with each other to verify the efficiency of the different algorithms.

In the instances, three parameters are used for the AR model, which can be written as follows: {h4=a1h1+a2h2+a3h3h5=a1h2+a2h3+a3h4hm+n=a1hm+n3+a2hm+n2+a3hm+n1

Observation data of first instance are listed in . Before proceeding to the experiment, stationary of observation data has been analyzed, autocorrelation function of the observation data is calculated and it is presented in .

Figure 1. Autocorrelation analysis of observation data.

Figure 1. Autocorrelation analysis of observation data.

Table 1. Observation data of first instance/mm.

Using real observation data that are supposed to only have a random error, model parameters are calculated using TLS and LS, respectively. The results are listed in , including the accuracy indices of the unit weight of variance component (σ0) and mean absolute per cent error (MAPE), which is calculated using the observation data of No. 1–No. 20 and check data of No. 21–No. 30, respectively. The results demonstrate that for the EIV model, the TLS algorithm has an advantage over the LS algorithm.

Table 2. Results of model parameters calculated using two algorithms.

In the second example, values of (a1, a2, a3) are simulated as (0.6, −0.4, −0.2), and the observation data calculated using the simulated parameters are listed in . The previous 25 periods’ observation data are used to calculate the model parameters, and other observation data are used to check the precision of the parameters. To achieve the aforementioned aims, a random error that follows N(0, 1) is inserted into the previous 25 periods’ observation data, which is shown in .

Figure 2. Distribution of a random error inserted into the observation data.

Figure 2. Distribution of a random error inserted into the observation data.

Table 3. Observation data of the AR model/m.

The observation data of No. 1–No. 25 which are used to calculate model parameters are inserted into the random error, and their values are listed in . Additionally, outliers are inserted into the observation data of No. 4, No. 10, No. 18, and No. 25, which are denoted in red in .

Table 4. Observation data that are inserted into the random error/m.

Four observation data are inserted into outliers. Note that, for the AR model, if LS is used to calculate the model parameters, then the contamination rate of outliers is 4/22 (approximately 18.2%). Additionally, if TLS is used to calculate the model parameters, then the contamination rate of the outliers is 13/88 (approximately 14.8%). It appears that, for the AR model, when the same observation data are contaminated by outliers, the contamination rate based on TLS is smaller than that for LS.

When the observation data are contaminated by outliers, then we use three types of robust algorithms, that is robust LS, robust TLS and robust M-TLS proposed in this article to compute the model parameters. In the calculation, the observation data are supposed to be independent, and their initial weight is defined as unit one. The results of the three algorithms are listed in .

Table 5. Model parameter results using robust algorithms.

We use the estimation of model parameters to compute the residual of the observation vector. For comparison, only the residual of the observation vector that has observation elements composed of No. 4–No. 25 is calculated. The residual is listed in .

Figure 3. Residual of the observation vector using the three algorithms.

Figure 3. Residual of the observation vector using the three algorithms.

From the results of the three algorithms, robust LS achieved poor accuracy. In fact, it was difficult for the parameter estimation to converge. In the iteration process, because an irrational threshold value of the weight function was obtained and its value was larger than the residual, the algorithm failed in terms of robustness. The traditional robust TLS was more accurate than LS; however, in the process of modifying the stochastic model, each observation datum in the model had a different residual; in this instance, all the observation data No. 4–No. 22 had four residuals. This factor led one observation datum to have different weights. Therefore, although the traditional robust TLS algorithm for the AR model was more precise, its solution was unscientific. Meanwhile, the robust M-TLS proposed in this article overcame the shortcomings of the traditional algorithm, and it was more efficient and precise.

6. Conclusions

A modified solution for parameter estimation for the AR model was proposed in this article. To overcome the shortcomings of traditional solutions based on LS that cannot take into account the observation error in the coefficient matrix, EIV estimation for the AR model was introduced, and by analyzing the current algorithm of robust TLS, the current algorithm based on robust TLS also had unavoidable shortcomings for the AR model. It could not obtain a unique residual for one observation datum; hence, the estimation of the threshold value of the weight function was not scientific. The median function was used to determine a unique residual, and a more rational method for calculating the threshold value was proposed. An iterative algorithm was established using the median function and IGG weight function for the AR model based on EIV estimation. By comparing the proposed algorithm with current algorithms using two examples, the feasibility and efficiency of the proposed algorithm were proved. However, the proposed algorithm also had the shortcoming of increasing the amount of calculation, which needs to be further investigated.

Disclosure statement

No potential conflict of interest was reported by the authors.

Additional information

Funding

This work was supported by the National Natural Science Foundation of China (41601501, 41804029), Natural Science Fund for Colleges and Universities of Jiangsu Province (16KJD420001) and Huaian Key Laboratory of Geographic Information Technology and Applications (HAP201405).

References

  • Adcock RJ. 1877. Note on the method of least squares. Analyst. 4(6):183–184.
  • Ai-Sharadqah A, Ho KC. 2018. Constrained Cramér-Rao lower bound in errors-in-variables (EIV) models: revisited. Stat Prob Lett. 135(4):118–126.
  • Datteo A, Busca G, Quattromani G. 2018. On the use of AR models for SHM: a global sensitivity and uncertainty analysis framework. Reliab Eng Syst Safety. 170:99–115.
  • Di Giacinto V. 2006. A generalized space-time ARMA model with an application to regional unemployment analysis in Italy. Int Reg Sci Rev. 29(2):159–198.
  • do Nascimento Camelo H, Sergio Lucio P, Vercosa Leal Junior JB, de Carvalho PCM, dos Santos DVG. 2018. Innovative hybrid models for forecasting time series applied in wind generation based on the combination of time series models with artificial neural networks. Energy. 151:347–357.
  • Fang X, Li B, Alkhatib H, Zeng W, Yao Y. 2017. Bayesian inference for the errors-in-variables model. Stud Geophys Geod. 61(1):35–52.
  • Golub GH, Van Loan CF. 1980. An analysis of the total least squares problem. SIAM J Num Anal. 17(6):883–893.
  • Hirata Y, Aihara K. 2017. Improving time series prediction of solar irradiance after sunrise: comparison among three methods for time series prediction. Sol Energy. 149:294–301.
  • Huber PJ. 1964. Robust estimation of a location parameter. Ann Math Stat. 35(1):73–101.
  • Kurt S, Batu Tunay K. 2015. STARMA models estimation with Kalman filter: the case of regional bank deposits. Procedia-Soc Behav Sci. 195:2537–2547.
  • Leyang W, Haiyan L, Yangmao W. 2017. Total least squares method inversion for coseismic slip distribution. Acta Geodaetica et Cartographica Sinica. 46(3):307–315.
  • Mahboub V. 2012. On weighted total least-squares for geodetic transformation. J Geod. 86(5):359–367.
  • Mahboub V. 2014. Variance component estimation in errors-in-variables models and a rigorous total least-squares approach. Stud Geophys Geod. 58(1):17–40.
  • Pfeifer PE, Deutsch SJ. 1980. A three-stage iterative procedure for space-time modeling. Technometrics. 22(1):35–47.
  • Pfeifer PE, Ve Bodily SE. 1990. A test of space-time ARMA modeling and forecasting with an application to real estate prices. J Forecast. 16:255–272.
  • Rousseeuw P, Wagner J. 1994. Robust regression with a distribution intercept using least median of squares. Comput Stat Data An. 17:65–76.
  • Schaffrin B, Wieser A. 2008. On weighted total least-squares adjustment for linear regression. J Geod. 82(7):415–421.
  • Schaffrin B, Uzun S. 2011. Error-in-variables for mobile mapping algorithms in the presence of outliers. ISPRS Archives. 22:377–387.
  • Shen Y, Li B, Chen Y. 2011. An iterative solution of weighted total least-squares adjustment. J Geod. 85(4):229–238.
  • Tuncel KS, Baydogan MG. 2018. Autoregressive forests for multivariate time series modeling. Pattern Recogn. 73:202–215.
  • Wan H, Xiao L. 2016. Variational Bayesian learning for robust AR modeling with the presence of sparse impulse noise. DSP. 59:108.
  • Wang B, Li J, Liu C. 2016. A robust weighted total least squares algorithm and its geodetic applications. Stud Geophys Geod. 60(2):177–194.
  • Yang Y. 1999. Robust estimation of geodetic datum transformation. J Geod. 73(5):268–274.
  • Zhangzhen S, Tianhe X. 2012. Prediction of earth rotation parameters based on improved weighted least squares and autoregressive model. Geod Geodyn. 3(3):57–64.