# Multivariate Local Polynomial Regression with Application to Shenzhen Component Index

Authors: Liyun Su
Journal: Discrete Dynamics in Nature and Society
 (2011)

---

## Abstract

This study attempts to characterize and predict stock index series in Shenzhen stock market using the concepts of multivariate local polynomial regression. Based on nonlinearity and chaos of the stock index time series, multivariate local polynomial prediction methods and univariate local polynomial prediction method, all of which use the concept of phase space reconstruction according to Takens' Theorem, are considered. To fit the stock index series, the single series changes into bivariate series. To evaluate the results, the multivariate predictor for bivariate time series based on multivariate local polynomial model is compared with univariate predictor with the same Shenzhen stock index data. The numerical results obtained by Shenzhen component index show that the prediction mean squared error of the multivariate predictor is much smaller than the univariate one and is much better than the existed three methods. Even if the last half of the training data are used in the multivariate predictor, the prediction mean squared error is smaller than the univariate predictor. Multivariate local polynomial prediction model for nonsingle time series is a useful tool for stock market price prediction.


---

## Body

## 1. Introduction

In many theoretical and practical problems, complex nonlinear systems exist everywhere. It is suitable for stock price short-term prediction that stock market can be seen as a nonlinear dynamical system [1–3]. Researchers in economics and finance have been interested in predicting stock price behavior for many years. A variety of forecasting methods have been proposed and implemented. Among them, nonlinear prediction method is a new method developed in the last decades [4, 5]. Nonlinear system prediction posed a significant challenge for the complex system analyst, since the nonlinear structure tends to be very intricate and nonuniform.Although frequently referred to as unpredictable deterministic behavior, complex nonlinear systems can in fact be forecast over limited time scales. In many situations, it is hard to build up exact analytic model for complex systems (such as the stock market and the electric load) because their constructions are very intricate and the information available is incomplete and inaccurate. Complex systems are usually analyzed by time series observed or measured from the systems. Most prediction methods can be grouped into global and local methods. The class of local nonlinear prediction methods is based on next neighbor searches and is introduced by Lorenz [6]. Many introductions to next neighbor techniques have been published. A very effective local prediction method has been proposed for the multivariate time series case and achieved satisfactory results [7]. In this paper, multivariate local polynomial prediction method for multivariate time series [8–10] is applied to Shenzhen stock market in China. Multivariate local polynomial regression prediction methods based on kernel smoothing techniques including mean, linear, polynomial, and Backpropagation (BP) neural networks are analyzed and applied to predict stock price behavior. We also compare the accuracy of different prediction methods mentioned in this paper. The model combines the advantages of traditional local, weighted, multivariate prediction methods. The results show that the multivariate local polynomial prediction method has lower mean squared error compared with the univariate predictor based on univariate local polynomial regression (U-LPR) and most of the traditional ones (such as the local mean prediction, local linear prediction, and BP neural networks prediction).The remainder of this paper is organized as follows. Section2 describes the data examined in this study. In Section 3, the multivariate local polynomial estimator is applied to obtain multivariate complex nonlinear predictor. The selection of the time delay, the embedding dimension, the order of multivariate local polynomial function, the kernel function, and the bandwidth are also described. The applications and discussions for Shenzhen stock index time series are given in Section 4. Conclusions are drawn in Section 5.


## 2. Data

As is well known, data of the stock market, for example, stock prices, often shows greatly complicated behavior; therefore, it is very difficult to predict its movement accurately. In order to set up a good prediction model about such financial indices, to seek a suitable variable affecting price index is important. Daily Shenzhen component index data are sourced from Shenzhen stock market. Nonlinearity of stock market index time series has been tested in many literatures [1–3], so we can apply the prediction method given in this paper to fit and predict the index. To apply the proposed scheme, besides the component index, the change index is also considered to suit the multivariate situation, since it is one of the key factors influencing the dealer's mind. Shenzhen component index and the return index were selected, and we used the multivariate local polynomial prediction method to predict the Shenzhen component index. We selected 1091 data points from the Shenzhen component index and the increment index individually from January 4, 2006 to June 30, 2010, and we denote the Shenzhen component index (ShCpIn) by P and the change index by ΔP. From this, we have the two variants time series {Pn} and ΔPn(where ΔPn=Pn-Pn-1). The original data points are shown in Figure 1.Result of Shenzhen component index.
(a)(b)


## 3. Multivariate Nonlinear Time Series Predictor with Local Polynomial Regression

### 3.1. Phase Space Reconstruction Model

Takens' theorem is the 1981 delay embedding theorem of Takens [11]. In mathematics, a delay embedding theorem gives the conditions under which a chaotic dynamical system can be reconstructed from a sequence of observations of the state of a dynamical system. The reconstruction preserves the properties of the dynamical system that do not change under smooth coordinate changes. Phase space reconstruction model [12–14] has been studied and applied to many fields. Suppose that we have an M-dimensional time series {xn̲}n=1N={x1,n,x2,n,…,xM,n}n=1N. As in the case of univariate time series (when M=1), the phase space reconstruction can be described by(3.1)Vn̲={x1,n,x1,n-τ1,…,x1,n-(m1-1)τ1;x2,n,x2,n-τ2,…,x2,n-(m2-1)τ2;…;xM,n,xM,n-τM,…,xM,n-(mM-1)τM},n=J0,J0+1,…,N;J0=max1≤i≤M{(mi-1)τi+1},
where τi, mi(i=1,2,…,M) are the time delays and the embedding dimensions, respectively. Following Takens' delay embedding theorem, if m=∑i=1Mmi or each mi is large enough, there exists an M-dimensional continued vector mapping f: Rm→Rm, such that(3.2)Vn+1̲=f(Vn̲),
or there exists an M-dimensional continued function fi: Rm→R, such that(3.3)xi,n+1=fi(Vn̲)i=1,2,…,M.Thus, the evolution fromVn̲ to xi,n+1 reflects the motion of the original unknown dynamics. This means that the geometrical characteristics of the strange attractor in the reconstructed space are equivalent to the original state space. So any differential or topological invariant quantities computed for the reconstructed strange attractor are identical to those in the original state space.


### 3.2. Prediction Model Based on Multivariate Local Polynomial Regression

Multivariate local polynomial fitting is an attractive method both from theoretical and practical point of view. Multivariate local polynomial method has a small mean squared error compared with theNadaraya-Watson estimator which leads to an undesirable form of the bias and the Gasser-Muller estimator which has to pay a price in variance when dealing with a random design model. Multivariate local polynomial fitting also has other advantages. The method adapts to various types of designs such as random and fixed designs and highly clustered and nearly uniform designs. Furthermore, there is an absence of boundary effects: the bias at the boundary stays automatically of the same order as the interior, without the use of specific boundary kernels. The local polynomial approximation approach is appealing on general scientific grounds; the least squares principle to be applied opens the way to a wealth of statistical knowledge and thus easy generalizations. All the above-mentioned assertions or advantages can be found in literatures [8, 15–18]. In this section, we briefly outline the idea of the extension of multivariate local polynomial fitting to multivariate nonlinear time series forecasting.Suppose that the state vector at timeT is VT̲. Time p later than T on attractor is fitted by the function(3.4)xi,T+p=fi(VT̲).Our purpose is to obtain the estimationx̂i,T+p=f̂i(VT̲) of function fi. In this paper, we use the dth order multivariate local polynomial fi(V̲) to predict the value of the fixed-point VT̲. The polynomial function can be described as(3.5)fi(V̲)≈∑0≤|j̲|≤d1j̲!D(j̲)fi(VT̲)(V̲-VT̲)j̲=∑0≤|j̲|≤db̲j̲(VT̲)(V̲-VT̲)j̲,
where(3.6)j̲=(j1,j2,…,jm),j̲!=j1!j2!⋯jm!,|j̲|=∑l=1mjl,∑0≤|j̲|≤d=∑|j̲|=0d(∑j1=0|j̲|∑j2=0|j̲|⋯∑jm=0|j̲|)|j̲|=j1+j2+⋯+jm,V̲j̲=v1j1v2j2⋯vmjm,D(j̲)fi(VT̲)=∂|j̲|fi(V̲)∂v1j1∂v2j2⋯∂vmjm∣V̲=VT̲,b̲j̲(VT̲)=1j̲!D(j̲)fi(VT̲).In the multivariate prediction method, the change ofVT̲ with time on the attractor is assumed to be the same as those of nearby points, VTa̲(a=1,2,…,A), according to the distance order. Using A pairs of (VTa̲,xi,Ta+p), for which the values are already known, the coefficients of fi are determined by minimizing(3.7)∑a=1A[xi,Ta+p-∑0≤|j̲|≤db̲j̲(VT̲)(VTa̲-VT̲)j̲]2⋅KH̲(VTa̲-VT̲).For the weighted least squared problem, whenX̲TW̲X̲ is inverse, the solution can be described by(3.8)B̲̂=(X̲TW̲X̲)-1X̲TW̲Y̲,
where(3.9)Y̲=(yi,T1+p,yi,T2+p,…,yi,TA+p)T,yi,Ta+p=xi,Ta+p,B̲=(b̲0(VT̲),b̲1(VT̲),…,b̲d(VT̲))T,W̲=diag⁡{KH̲(VT1̲-VT̲),KH̲(VT2̲-VT̲),…,KH̲(VTA̲-VT̲)},
and X̲ is the A×S(S=∑0≤|j̲|≤d|j̲|/j̲!),(3.10)X̲=(1(VT1̲-VT̲)1⋯(VT1̲-VT̲)d1(VT2̲-VT̲)1⋯(VT2̲-VT̲)d⋮⋮⋱⋮1(VTA̲-VT̲)1⋯(VTA̲-VT̲)d),
then we can get the estimation x̂i,T+p=f̂i(VT̲),(3.11)x̂i,T+p=f̂i(VT̲)=Ei̲(X̲TW̲X̲)-1X̲TW̲Y̲,
where Ei̲=(1,0,0,…,0)1×S.There are several important issues about the bandwidth, the order of multivariate local polynomial function, and the kernel function which have to be discussed.


### 3.3. Parameters Estimations and Selections

We calculate the time delaysτi with the mutual information method [19] separately for each univariate time series {xi,n}n=1N, i=1,2,…,M. The mutual information method is based on linear statistics, not taking into account nonlinear dynamical correlations. Therefore, it is advocated that one look for the fist minimum of the time delayed mutual information.There are many of the embedding dimensions algorithms [12, 20]. In univariate time series {xi,n}n=1N, i=1,2,…,M, a popular method that is used for finding the embedding dimensions mi is the so-called false nearest-neighbor method [21, 22]. Here, we apply this method to the multivariate case.For the multivariate local polynomial predictor, there are three important problems which have significant influence on the prediction accuracy and computational complexity. First of all, there is the choice of the bandwidth matrix, which plays a rather crucial role. The bandwidth matrixH̲ is taken to be a diagonal matrix. For simplification, the bandwidth matrix is designed into H̲=hIm̲. In theory, there exists an optimal bandwidth hopt in the meaning of mean squared error, such that(3.12)hopt=argmin⁡h∫(fi(x̲)-f̂i(x̲))2dx̲.Another issue in multivariate local polynomial fitting is the choice of the order of the polynomial. Since the modeling bias is primarily controlled by the bandwidth, this issue is less crucial, however. For a given bandwidthh, a large value of d would expectedly reduce the modeling bias, but would cause a large variance and a considerable computational cost. Since the bandwidth is used to control the modeling complexity, and due to the sparsity of local data in multidimensional space, a higher-order polynomial is rarely used. So, we apply the local quadratic regression to fit the model (i.e., d=2).The third issue is the selection of the kernel function. In this paper, we choose the optimal sphericalEpanechnikov kernel function [8, 15], which minimizes the asymptotic mean square error (MSE) of the resulting multivariate local polynomial estimators, as our kernel function.


## 3.1. Phase Space Reconstruction Model

Takens' theorem is the 1981 delay embedding theorem of Takens [11]. In mathematics, a delay embedding theorem gives the conditions under which a chaotic dynamical system can be reconstructed from a sequence of observations of the state of a dynamical system. The reconstruction preserves the properties of the dynamical system that do not change under smooth coordinate changes. Phase space reconstruction model [12–14] has been studied and applied to many fields. Suppose that we have an M-dimensional time series {xn̲}n=1N={x1,n,x2,n,…,xM,n}n=1N. As in the case of univariate time series (when M=1), the phase space reconstruction can be described by(3.1)Vn̲={x1,n,x1,n-τ1,…,x1,n-(m1-1)τ1;x2,n,x2,n-τ2,…,x2,n-(m2-1)τ2;…;xM,n,xM,n-τM,…,xM,n-(mM-1)τM},n=J0,J0+1,…,N;J0=max1≤i≤M{(mi-1)τi+1},
where τi, mi(i=1,2,…,M) are the time delays and the embedding dimensions, respectively. Following Takens' delay embedding theorem, if m=∑i=1Mmi or each mi is large enough, there exists an M-dimensional continued vector mapping f: Rm→Rm, such that(3.2)Vn+1̲=f(Vn̲),
or there exists an M-dimensional continued function fi: Rm→R, such that(3.3)xi,n+1=fi(Vn̲)i=1,2,…,M.Thus, the evolution fromVn̲ to xi,n+1 reflects the motion of the original unknown dynamics. This means that the geometrical characteristics of the strange attractor in the reconstructed space are equivalent to the original state space. So any differential or topological invariant quantities computed for the reconstructed strange attractor are identical to those in the original state space.


## 3.2. Prediction Model Based on Multivariate Local Polynomial Regression

Multivariate local polynomial fitting is an attractive method both from theoretical and practical point of view. Multivariate local polynomial method has a small mean squared error compared with theNadaraya-Watson estimator which leads to an undesirable form of the bias and the Gasser-Muller estimator which has to pay a price in variance when dealing with a random design model. Multivariate local polynomial fitting also has other advantages. The method adapts to various types of designs such as random and fixed designs and highly clustered and nearly uniform designs. Furthermore, there is an absence of boundary effects: the bias at the boundary stays automatically of the same order as the interior, without the use of specific boundary kernels. The local polynomial approximation approach is appealing on general scientific grounds; the least squares principle to be applied opens the way to a wealth of statistical knowledge and thus easy generalizations. All the above-mentioned assertions or advantages can be found in literatures [8, 15–18]. In this section, we briefly outline the idea of the extension of multivariate local polynomial fitting to multivariate nonlinear time series forecasting.Suppose that the state vector at timeT is VT̲. Time p later than T on attractor is fitted by the function(3.4)xi,T+p=fi(VT̲).Our purpose is to obtain the estimationx̂i,T+p=f̂i(VT̲) of function fi. In this paper, we use the dth order multivariate local polynomial fi(V̲) to predict the value of the fixed-point VT̲. The polynomial function can be described as(3.5)fi(V̲)≈∑0≤|j̲|≤d1j̲!D(j̲)fi(VT̲)(V̲-VT̲)j̲=∑0≤|j̲|≤db̲j̲(VT̲)(V̲-VT̲)j̲,
where(3.6)j̲=(j1,j2,…,jm),j̲!=j1!j2!⋯jm!,|j̲|=∑l=1mjl,∑0≤|j̲|≤d=∑|j̲|=0d(∑j1=0|j̲|∑j2=0|j̲|⋯∑jm=0|j̲|)|j̲|=j1+j2+⋯+jm,V̲j̲=v1j1v2j2⋯vmjm,D(j̲)fi(VT̲)=∂|j̲|fi(V̲)∂v1j1∂v2j2⋯∂vmjm∣V̲=VT̲,b̲j̲(VT̲)=1j̲!D(j̲)fi(VT̲).In the multivariate prediction method, the change ofVT̲ with time on the attractor is assumed to be the same as those of nearby points, VTa̲(a=1,2,…,A), according to the distance order. Using A pairs of (VTa̲,xi,Ta+p), for which the values are already known, the coefficients of fi are determined by minimizing(3.7)∑a=1A[xi,Ta+p-∑0≤|j̲|≤db̲j̲(VT̲)(VTa̲-VT̲)j̲]2⋅KH̲(VTa̲-VT̲).For the weighted least squared problem, whenX̲TW̲X̲ is inverse, the solution can be described by(3.8)B̲̂=(X̲TW̲X̲)-1X̲TW̲Y̲,
where(3.9)Y̲=(yi,T1+p,yi,T2+p,…,yi,TA+p)T,yi,Ta+p=xi,Ta+p,B̲=(b̲0(VT̲),b̲1(VT̲),…,b̲d(VT̲))T,W̲=diag⁡{KH̲(VT1̲-VT̲),KH̲(VT2̲-VT̲),…,KH̲(VTA̲-VT̲)},
and X̲ is the A×S(S=∑0≤|j̲|≤d|j̲|/j̲!),(3.10)X̲=(1(VT1̲-VT̲)1⋯(VT1̲-VT̲)d1(VT2̲-VT̲)1⋯(VT2̲-VT̲)d⋮⋮⋱⋮1(VTA̲-VT̲)1⋯(VTA̲-VT̲)d),
then we can get the estimation x̂i,T+p=f̂i(VT̲),(3.11)x̂i,T+p=f̂i(VT̲)=Ei̲(X̲TW̲X̲)-1X̲TW̲Y̲,
where Ei̲=(1,0,0,…,0)1×S.There are several important issues about the bandwidth, the order of multivariate local polynomial function, and the kernel function which have to be discussed.


## 3.3. Parameters Estimations and Selections

We calculate the time delaysτi with the mutual information method [19] separately for each univariate time series {xi,n}n=1N, i=1,2,…,M. The mutual information method is based on linear statistics, not taking into account nonlinear dynamical correlations. Therefore, it is advocated that one look for the fist minimum of the time delayed mutual information.There are many of the embedding dimensions algorithms [12, 20]. In univariate time series {xi,n}n=1N, i=1,2,…,M, a popular method that is used for finding the embedding dimensions mi is the so-called false nearest-neighbor method [21, 22]. Here, we apply this method to the multivariate case.For the multivariate local polynomial predictor, there are three important problems which have significant influence on the prediction accuracy and computational complexity. First of all, there is the choice of the bandwidth matrix, which plays a rather crucial role. The bandwidth matrixH̲ is taken to be a diagonal matrix. For simplification, the bandwidth matrix is designed into H̲=hIm̲. In theory, there exists an optimal bandwidth hopt in the meaning of mean squared error, such that(3.12)hopt=argmin⁡h∫(fi(x̲)-f̂i(x̲))2dx̲.Another issue in multivariate local polynomial fitting is the choice of the order of the polynomial. Since the modeling bias is primarily controlled by the bandwidth, this issue is less crucial, however. For a given bandwidthh, a large value of d would expectedly reduce the modeling bias, but would cause a large variance and a considerable computational cost. Since the bandwidth is used to control the modeling complexity, and due to the sparsity of local data in multidimensional space, a higher-order polynomial is rarely used. So, we apply the local quadratic regression to fit the model (i.e., d=2).The third issue is the selection of the kernel function. In this paper, we choose the optimal sphericalEpanechnikov kernel function [8, 15], which minimizes the asymptotic mean square error (MSE) of the resulting multivariate local polynomial estimators, as our kernel function.


## 4. Practical Applications and Discussions

In the following, we apply our prediction algorithms to Shenzhen stock index series. The forecast variables here are close price and its change index data.For the nonlinear stock index time series{xn̲}n=1N={Pn,ΔPn}n=1N, divide N into two parts: T and L. The former T data are used to construct a model and estimate the coefficients, which are called the trained sets; the latter L data are used to make forecasting, which are called prediction sets. Make the prediction of xi,T+p to be x̂i,T+p. This prediction is defined as p-step prediction. For the purpose of simplification, we only predict the first variable.Furthermore, in order to evaluate the prediction accuracy and effectiveness, we apply the following indices, namely, the mean squared prediction error (MSE)(4.1)eMSE=1L∑l=1L(xi,T+l-x̂i,T+l)2,
and the absolute error(4.2)ei(n)=xi,n-x̂i,n.The former 1000 data are used as the training sets and the latter 91 data are used as the prediction sets. We apply the normalized method to the original time series, then the formula is as follows:(4.3)Pi,j⟵Pi,j-Pi,min⁡Pi,max⁡-Pi,min⁡.For Shenzhen component index{Pn}n=11000, we obtain the optimal time delay τ=14 and the minimum embedding dimension m=4, and we reconstruct a phase space with (Pn,Pn-14,Pn-28,Pn-42).In nonlinear time series prediction, most existing methods used phase space reconstruction of univariate time series for prediction. Theoretically, if embedding dimension and delay time are selected reasonably, univariate time series can achieve satisfactory prediction results. But for most actual problems, because the length of acquired time series is limited, and often time series involves noise, the reconstructed phase space of univariate time series cannot very accurately describe the evolutionary track of state variables of dynamic systems. In addition, often we do not know whether univariate time series contains complete information of dynamic systems for phase space reconstruction, and multivariate time series usually contains more complete system information than univariate time series. So, phase space reconstruction of multivariate time series can reconstruct a more accurate phase space. Literatures [5, 19, 20] have verified that multivariate time series forecasting methods based on phase space reconstruction can get more accurate prediction. This paper applies phase space reconstruction methods of multivariate time series and multivariate polynomial regression to fit and predict Shenzhen stock index series.We combine Shenzhen component index and change index into one multivariate time series to predict the evolvement of component index according to Section2. Firstly, two component series are obtained by combination of initial Shenzhen index time series and the time series of consecutive differences. Then based on the embedding dimensions and time delays are multivariate phase space is reconstructed, and the proposed methods are used to fit and predict the multivariate time series. For the multivariate nonlinear time series {Pn,ΔPn}n=11000, we obtain the optimal time delay τ1=14, τ2=6 and the minimum embedding dimension m1=4, m2=1 according to the methods of Section 3.3, and we reconstruct a multivariate phase space with (Pn,Pn-14,Pn-28,Pn-42;ΔPn).Mean squared prediction errors with univariate data are shown in Table1. BPNN predictor is defined as BP neural networks predictor with the hidden layer consists of 12 neurons and the training times are 900 times. The LM predictor denotes the local mean predictor. The LL predictor is the abbreviation of the local linear predictor. The three local approaches are compared with the U-LPR predictor using the same the number of nearest neighbors 200 (i.e., A=200). From Table 1, we can conclude that the prediction results of U-LPR predictor are significantly better than the three traditional methods in the same univariate data.Table 1
MSE of four kinds of predictors.
MethodLM predictorLL predictorBPNN predictorU-LPR predictoreMSE2.389.62×10-28.33×10-22.81×10-2In order to further discuss the influence of different reconstructed vector data on prediction with the same data from complex nonlinear Shenzhen stock market, the prediction errors are shown in Table2. From Table 2, we can see that the predicted results with M-LPR method are better than the U-LPR one.Table 2
MSE using both methods.
PTraining data pointsTwo different methodseMSE11000U-LPR2.81×10-21500U-LPR3.13×10-211000M-LPR2.01×10-31500M-LPR3.07×10-3101000U-LPR7.62×10-210500U-LPR9.65×10-2101000M-LPR8.04×10-310500M-LPR9.19×10-3The results from Figures2–5 show that the proposed multivariate nonlinear stock index time series predictor based on multivariate local polynomial fitting is effective, even in only the last half of the fitting data, the method performs well for the prediction of complex multivariate nonlinear stock index time series. Figure 2 is the one-step prediction results with 1000 fitting data, and Figure 3 is its absolute error. Figure 4 is the one-step prediction results with just the last 500 fitting data, and Figure 5 is its absolute error. From Figures 2–5, we know that a big fitting data obtain a small mean squared error. This is one of the advantages of nonparametric approaches, that is to say, the more fitting data can make the prediction results more accurate.Figure 2
Predicted result of Shenzhen component index (1000 fitting data).Figure 3
Absolute error of one-step prediction (1000 fitting data).Figure 4
Predicted result of Shenzhen component index (500 fitting data).Figure 5
Absolute error of one-step prediction (500 fitting data).


## 5. Conclusion

In this brief, we have presented a new method for the prediction of multivariate nonlinear complex systems for stock market index time series based on multivariate local polynomial regression with kernel smoothing technique. The multivariate local polynomial and weighted least squared method are applied to the nonlinear complex system prediction. The univariate predictor has been compared with the multivariate forecasting based on the multivariate local polynomial fitting in the same stock index data. Comparisons with the conventional three predictors have also been made. The results obtained by Shenzhen component index system have indicated that the prediction mean squared error of the M-LPR predictor is much smaller than the U-LPR one, even if the last half of the fitting data is used in the former one, and the proposed method is also much better than most of the existed methods including the local mean prediction, local linear prediction, and BP neural networks prediction.



---

*Source: 930958-2011-05-05.xml*