Some results on ℓ1 polynomial trend filtering
Abstract
EconStor is a publication server for scholarly economic literature, provided as a non-commercial public service by the ZBW.
Full text
Yamada, Hiroshi; Du, Ruixue Article Some results on ℓ1 polynomial trend filtering Econometrics Provided in Cooperation with: MDPI – Multidisciplinary Digital Publishing Institute, Basel Suggested Citation: Yamada, Hiroshi; Du, Ruixue (2018) : Some results on ℓ1 polynomial trend filtering, Econometrics, ISSN 2225-1146, MDPI, Basel, Vol. 6, Iss. 3, pp. 1-10, https://doi.org/10.3390/econometrics6030033 This Version is available at: https://hdl.handle.net/10419/195464 Standard-Nutzungsbedingungen: Die Dokumente auf EconStor dürfen zu eigenen wissenschaftlichen Zwecken und zum Privatgebrauch gespeichert und kopiert werden. Sie dürfen die Dokumente nicht für öffentliche oder kommerzielle Zwecke vervielfältigen, öffentlich ausstellen, öffentlich zugänglich machen, vertreiben oder anderweitig nutzen. Sofern die Verfasser die Dokumente unter Open-Content-Lizenzen (insbesondere CC-Lizenzen) zur Verfügung gestellt haben sollten, gelten abweichend von diesen Nutzungsbedingungen die in der dort genannten Lizenz gewährten Nutzungsrechte. Terms of use: Documents in EconStor may be saved and copied for your personal and scholarly purposes. You are not to copy documents for public or commercial purposes, to exhibit the documents publicly, to make them publicly available on the internet, or to distribute or otherwise use the documents in public. If the documents have been made available under an Open Content Licence (especially Creative Commons Licences), you may exercise further usage rights as specified in the indicated licence. https://creativecommons.org/licenses/by/4.0/
econometrics Article Some Results on `1Polynomial Trend Filtering Hiroshi Yamada * and Ruixue Du Graduate School of Social Sciences, Hiroshima University, 1-2-1 Kagamiyama, Higashi-Hiroshima 739-8525, Japan; [email protected] *Correspondence: [email protected]; Tel.: +81-82-424-7214; Fax: +81-82-424-7212 Received: 22 May 2018; Accepted: 4 July 2018; Published: 10 July 2018 Abstract: `1 polynomial trend filtering, which is a filtering method described as an `1 -norm penalized least-squares problem, is promising because it enables the estimation of a piecewise polynomial trend in a univariate economic time series without prespecifying the number and location of knots. This paper shows some theoretical results on the filtering, one of which is that a small modification of the filtering provides not only identical trend estimates as the filtering but also extrapolations of the trend beyond both sample limits. Keywords: `1 trend filtering; Hodrick–Prescott filtering; Whittaker–Henderson method of graduation; Lasso regression; basis pursuit denoising; total variation denoising MSC: 62G05 JEL Classification: C22 1. Introduction The `1-norm penalized least-squares problem, defined as: min x1,...,xT T ∑ t=1 (yt−xt)2+λ T ∑ t=3 |∆2xt|, (1) where y1 , . . . , yT are observed time-series data, was developed by Kim et al. (2009), who called it `1 trend filtering. 1 Here, λ> 0 is a tuning parameter and ∆ denotes the backward difference operator such that ∆xt=xt−xt−1 . Accordingly, ∆2xt=∆(∆xt) = xt− 2 xt−1+xt−2 . Recall that ∑T t=3|∆2xt| in (1) is `1 -norm of [∆2x3 , . . . , ∆2xT]> . Unlike Hodrick and Prescott (1997) filtering, which is defined as the following squared `2-norm penalized least-squares problem: min x1,...,xT T ∑ t=1 (yt−xt)2+ψ T ∑ t=3 (∆2xt)2, (2) where ψ> 0 is a smoothing/tuning parameter, the solution of `1 trend filtering becomes a continuous piecewise linear trend. The relationship between HP filtering and `1 trend filtering corresponds to that between ridge regression of Hoerl and Kennard (1970) and Lasso (least absolute shrinkage and selection operator) regression of Tibshirani (1996)/BPDN (basis pursuit denoising) of Chen et al. (1998). Econometric applications of `1 trend filtering include Yamada and Jin (2013), Yamada and Yoon (2014), Winkelried (2016), and Yamada (2017a). 1`1trend filtering is supported in several standard software packages such as MATLAB, R, Python, and EViews. Econometrics 2018,6, 33; doi:10.3390/econometrics6030033 www.mdpi.com/journal/econometrics
Econometrics 2018,6, 33 2 of 10 It has been well-known that HP filtering is a form of the Whittaker–Henderson (WH) method of graduation, which is defined as: min x1,...,xT T ∑ t=1 (yt−xt)2+ψ T ∑ t=p+1 (∆pxt)2. (3) For historical surveys of WH filtering, see Weinert (2007), Phillips (2010), and Nocon and Scott (2012). Likewise, as shown in Kim et al. (2009), Tibshirani and Taylor (2011), and Tibshirani (2014), `1 trend filtering may be generalized as: min x1,...,xT T ∑ t=1 (yt−xt)2+λ T ∑ t=p+1 |∆pxt|. (4) We refer to it as `1 polynomial trend filtering. 2 This filtering method is promising because it enables us to estimate a piecewise (p− 1 ) -th order polynomial trend of a univariate economic time series without prespecifying the number and location of knots. For more details, see Yamada (2017b). Let b x1 , . . . , b xT denote the solution of (3) and define b xT+1 , . . . , b xT+h , where h denotes the length of extrapolation by: ∆pb xT+j=0, (j=1, . . . , h). (5) Recently, Yamada and Du (2018) introduced the following three modifications of the WH method of graduation:3 (a) min x1,...,xT+h T ∑ t=1 (yt−xt)2+ψ T+h ∑ t=p+1 (∆pxt)2, (6) (b) min x1,...,xT+h T+h ∑ t=1 (yt−xt)2+ψ T+h ∑ t=p+1 (∆pxt)2, (7) (c) min x1,...,xT+h T+h ∑ t=1 (yt−xt)2+ψ T ∑ t=p+1 (∆pxt)2, (8) 2(4) where p= 1 has been known as total variation denoising in signal processing, which may be regarded as a form of the fused Lasso by Tibshirani et al. (2005). Harchaoui and Lévy-Leduc (2010) proposed using the filtering to detect multiple change points. (4) may be regarded as a form of the generalized Lasso by Tibshirani and Taylor (2011). In addition, we note that there exist some pioneering works on the filtering that uses the `1 -norm penalty. (Miller 1946, sct. 1.7) mentioned that ∑T t=p+1|∆pxt| could be an alternative measure of smoothness to ∑T t=p+1(∆pxt)2 ,Schuette (1978) introduced a filtering, defined as: min x1,...,xT T ∑ t=1 |yt−xt|+λ T ∑ t=p+1 |∆pxt|, and Koenker et al. (1994) presented `1 -norm penalized quantile smoothing spline. Incidentally, Schuette (1978) and Koenker et al. (1994) motivate us to consider a penalized quantile regression that is obtainable by replacing the quadratic loss function in (4) by the check loss function: min x1,...,xT T ∑ t=1 ρτ(yt−xt) + λ T ∑ t=p+1 |∆pxt|, where, letting τ∈(0, 1), ρτ(u) = (τ|u|(u≥0), (1−τ)|u|(u<0), which is suggested by (Kim et al. 2009, sct. 7.3). 3See also Yamada (2017c).
Econometrics 2018,6, 33 3 of 10 where yT+j=b xT+j for j= 1, . . . , h . Denote the solution of (a), (b), and (c) by b x(i) t for i=a , b , c and t= 1, . . . , T+h .Yamada and Du (2018) showed that, for i=a , b , c and t= 1, . . . , T+h , it follows that: b x(i) t=b xt. (9) Among the above results, b x(a) t=b xt is of practical use because it provides not only a smoothed series identical to that of the WH graduation, but also an extrapolation beyond the sample limit of current data. Also, b x(b) t=b xt is of interest because it shows that b xT+1 , . . . , b xT+h based on (5) are useless to reduce the end-point problem of the WH graduation. 4 In addition, Yamada and Du (2018) proved that, for i=a, b, c and t=1, . . . , T+h: lim ψ→∞b x(i) t=b β0t0+· · · +b βp−1tp−1, (10) where (b β0, . . . , b βp−1) = arg minβ0,...,βp−1∑T t=1(yt−β0t0− · · · − βp−1tp−1)2. In this paper, we present three modifications of `1 polynomial trend filtering and show that they provide not only identical trend estimates as `1 polynomial trend filtering, but also extrapolations of the trend beyond both sample limits. In addition, we show some other results on the modified filtering. We also provide a MATLAB function for calculating the solution of one of the modified filtering methods. The paper is organized as follows. In Section 2, we present three modifications of `1polynomial trend filtering. In Section 3, we state the main results of the paper. In Section 4, we make some remarks on the results provided in Section 3. Section 5provides some concluding remarks. Notation. Let y= [y1 , . . . , yT]> and IT be the T×T identity matrix. For an n -dimensional column vector, η= [η1 , . . . , ηn]> , kηk1=∑n i=1|ηi| , kηk2 2=∑n i=1η2 i , and kηk∞=max(|η1| , . . . , |ηn|) . Dn is the (n−p)×n p -th order difference matrix such that Dnη= [∆pηp+1 , . . . , ∆pηn]> . We denote DT by D . Πg+T+his a (g+T+h)×pVandermonde matrix, defined by Πg+T+h= (1−g)0(1−g)1· · · (1−g)p−1 . . .. . .. . . 1011· · · 1p−1 . . .. . .. . . T0T1· · · Tp−1 . . .. . .. . . (T+h)0(T+h)1· · · (T+h)p−1 , and we denote Π0+T+0, which is a T×pmatrix, by Π. 2. Three Modifications of `1Polynomial Trend Filtering Let e x1 , . . . , e xT denote the solution of (4) and define e x1−g , . . . , e x1−1 and e xT+1 , . . . , e xT+h , where g and hdenote the length of extrapolations: ∆pe xp+1−i=0, (i=1, . . . , g), (11) ∆pe xT+j=0, (j=1, . . . , h). (12) 4An argument similar to this is given by (Mohr 2005, p. 20).
Econometrics 2018,6, 33 4 of 10 For example, e xT+1, . . . , e xT+h, defined by (12) for p=1, 2, 3, are explicitly expressed as follows: (p=1)e xT+j=e xT,(j=1, . . . , h), (13) (p=2)e xT+j=e xT+j(∆e xT),(j=1, . . . , h), (14) (p=3)e xT+j=e xT+j(∆e xT) + j(j+1) 2(∆2e xT),(j=1, . . . , h). (15) For a proof of (15), see the Appendix A. Consider the following three modifications of `1polynomial trend filtering: (d)min x1−g,...,xT+h T ∑ t=1 (yt−xt)2+λ T+h ∑ t=p+1−g |∆pxt|, (16) (e)min x1−g,...,xT+h T+h ∑ t=1−g (yt−xt)2+λ T+h ∑ t=p+1−g |∆pxt|, (17) (f)min x1−g,...,xT+h T+h ∑ t=1−g (yt−xt)2+λ T ∑ t=p+1 |∆pxt|, (18) where y1−i=e x1−i for i= 1, . . . , g and yT+j=e xT+j for j= 1, . . . , h . Note that (16) is equivalent to `1 polynomial trend filtering if g=h= 0. We denote the solution of (d), (e), and (f) by e x(i) t for i= d, e, f and t=1−g, . . . , T+h. Among (16)–(18), the objective function of (16) may be represented in matrix notation as: ky−Sxg+T+hk2 2+λkDg+T+hxg+T+hk1, (19) where S= [0 , IT , 0] is a T×(g+T+h) matrix and xg+T+h is a (g+T+h) -dimensional column vector. Let ex(d) g+T+h= [ex(d)> g , ex(d)> , ex(d)> h]> , where ex(d) g= [e x(d) 1−g , . . . , e x(d) 1−1]> , ex(d)= [e x(d) 1 , . . . , e x(d) T]> , and ex(d) h= [e x(d) T+1 , . . . , e x(d) T+h]> . The MATLAB function for calculating ex(d) g , ex(d) , and ex(d) h , which depends on CVX developed by Grant and Boyd (2013), is as follows: function [x_g,x,x_h]=m_l1_pt_filtering(y,lambda,p,g,h) % y: T-dimensional column vector % lambda: positive real number % p, g, h: positive integer % x_g: g-dimensional column vector % x: T-dimensional column vector % x_h: h-dimensional column vector T=length(y); S=[sparse(T,g),speye(T),sparse(T,h)]; D=diff(speye(g+T+h),p); cvx_begin variables z(g+T+h) minimize(sum((y-S*z).^2)+lambda*norm(D*z,1)) cvx_end x_g=z(1:g); x=z(g+1:g+T); x_h=z(g+T+1:g+T+h); end
Econometrics 2018,6, 33 5 of 10 3. Main Results Theorem 1. Denote the solution of (d), (e), and (f) by e x(i) t for i= d, e, f. For i=d , e , f , and t= 1 −g , . . . , T+h, it follows that: e x(i) t=e xt, (20) where e x1, . . . , e xTare the solution of (4)and e x1−g, . . . , e x1−1and e xT+1, . . . , e xT+hare defined by (11)and (12). Proof. Because the objective function of (4) is coercive and strictly convex with respect to x1 , . . . , xT , e x1, . . . , e xTare the unique global minimizer of the function. It follows that: T ∑ t=1 (yt−xt)2+λ T ∑ t=p+1 |∆pxt| ≥ T ∑ t=1 (yt−e xt)2+λ T ∑ t=p+1 |∆pe xt|, (21) where the equality holds only if xt=e xt for t= 1, . . . , T . 5 In addition, from (11) and (12) , y1−i=e x1−i for i=1, . . . , g, and yT+j=e xT+jfor j=1, . . . , h, we have the following inequalities: λ p+1−1 ∑ t=p+1−g |∆pxt| ≥ 0=λ p+1−1 ∑ t=p+1−g |∆pe xt|, (22) λ T+h ∑ t=T+1 |∆pxt| ≥ 0=λ T+h ∑ t=T+1 |∆pe xt|, (23) 1−1 ∑ t=1−g (yt−xt)2≥0= 1−1 ∑ t=1−g (yt−e xt)2, (24) T+h ∑ t=T+1 (yt−xt)2≥0= T+h ∑ t=T+1 (yt−e xt)2. (25) Combining (21)–(23) yields T ∑ t=1 (yt−xt)2+λ T+h ∑ t=p+1−g |∆pxt| ≥ T ∑ t=1 (yt−e xt)2+λ T+h ∑ t=p+1−g |∆pe xt|, (26) where the equality in (26) holds only if xt=e xt for t= 1 −g , . . . , T+h , which proves that e x(d) t=e xt for t= 1 −g , . . . , T+h . Likewise, combining (21) – (25) proves that e x(e) t=e xt for t= 1 −g , . . . , T+h and combining (21), (24) and (25) proves that e x(f) t=e xtfor t=1−g, . . . , T+h. As an illustration of the above theorem, we give a numerical example. Consider the case where T=5, g=1, and h=2. Suppose that we obtained e x1=3, ∆e x2=2, [∆2e x3,∆2e x4,∆2e x5]>= [0, −1, 0]> by applying `1 polynomial trend filtering of order 2 (i.e., `1 trend filtering) to a T -dimensional time-series data. 6 Because 2 =∆e x2=∆e x36=∆e x4=∆e x5= 1, the line plot of (t , e xt) for t= 1, . . . , 5 becomes a continuous piecewise linear line such that ( 3, e x3) is a knot. e xt for t= 1, . . . , 5 are explicitly 5 In the objective function of (4) , ∑T t=1(yt−xt)2 is coercive because it is a quadratic function whose Hessian matrix is positive definite. See, e.g., (Beck 2014, Lemma 2.42). 6 In the case, [∆2e x3 , ∆2e x4 , ∆2e x5]> is expected to become sparse, as in the numerical example, because ∑5 t=3|∆2xt| is included as a penalty.
Econometrics 2018,6, 33 6 of 10 [e x1 , e x2 , e x3 , e x4 , e x5]>= [ 3, 5, 7, 8, 9 ]> . Then, from the above theorem, in the case, e x(i) t for i= d, e, f and t=1−1, . . . , 5 +2 are as follows: [e x(i) 1−1,e x(i) 1,e x(i) 2,e x(i) 3,e x(i) 4,e x(i) 5,e x(i) 5+1,e x(i) 5+2]>= [1, 3, 5, 7, 8, 9, 10, 11]>. Theorem 2. If λ≥2k(DD>)−1Dyk∞, for i =d, e, f and t =1−g, . . . , T+h, it follows that e x(i) t=b β0t0+· · · +b βp−1tp−1, (27) where (b β0, . . . , b βp−1) = arg minβ0,...,βp−1∑T t=1(yt−β0t0− · · · − βp−1tp−1)2. Proof. Because Dg+T+h is a (g+T+h−p)×(g+T+h) (p+ 1 ) -diagonal Toeplitz matrix, such that: Dg+T+h= a0· · · ap0· · · 0 0.......... . . . . ..........0 0· · · 0a0· · · ap , where ak= (−1)p−k(p k)for k=0, . . . , p, it may be expressed as Dg+T+h= G1G20 0D0 0H1H2 , where G1 is a g×g upper triangular matrix, G2 is a g×T matrix, H1 is an h×T matrix, and H2 is an h×hunit lower-triangular matrix. For example, when p=3, g=h=2, and T=5: D2+5+2= −1 3 −3 1 0 0 0 0 0 0−1 3 −3 1 0 0 0 0 0 0 −1 3 −3 1 0 0 0 000−1 3 −3 1 0 0 0000−1 3 −3 1 0 00000−1 3 −3 1 . (28) Let exg= [e x1−g , . . . , e x1−1]> , ex= [e x1 , . . . , e xT]> , exh= [e xT+1 , . . . , e xT+h]> , and exg+T+h= [ex> g , ex> , ex> h]> , which is a (g+T+h)-dimensional column vector. Then, by definition of exgand exh, it follows that: G1exg+G2ex=0, (29) H1ex+H2exh=0, (30) which leads to: Dg+T+hexg+T+h= 0 Dex 0 . (31) From Kim et al. (2009), if λ≥ 2 k(DD>)−1Dyk∞ , it follows that ex=Πb β , where b β= (Π>Π)−1Π>y . Recalling that DΠ=0 , we obtain Dg+T+hexg+T+h=0 if λ≥ 2 k(DD>)−1Dyk∞ , which implies that exg+T+h may be represented as Πg+T+hγ . Because ex=Πb β , γ must equal b β . Therefore, if λ≥2k(DD>)−1Dyk∞, then exg+T+h=Πg+T+hb β.
Econometrics 2018,6, 33 7 of 10 Theorem 3. Suppose that y=Πα , where α6=0 is a p -dimensional column vector. Then, for i=d , e , f , it follows that: ex(i) g+T+h=Πg+T+hα, (32) where ex(i) g+T+h= [e x(i) 1−g, . . . , e x(i) T+h]>. Proof. If y=Πα , it follows that: ex=Πα . Accordingly, Dg+T+hexg+T+h=0 , which indicates that exg+T+h may be represented as Πg+T+hγ . Because ex=Πα if y=Πα , γ must equal α . Therefore, we obtain exg+T+h=Πg+T+hαif y=Πα. Corollary 1. Let ex(i) g+T+h= [e x(i) 1−g, . . . , e x(i) T+h]>for i =d, e, f. (i) Denote the (j+ 1 ) -th column of Π and that of Πg+T+h , respectively, by τj and by τg+T+h,j for j= 0, . . . , p−1. If y=τj, then ex(i) g+T+h=τg+T+h,jfor any λ>0. (ii) Let z be a T -dimensional column vector. If y=Π(Π>Π)−1Π>z , then ex(i) g+T+h= Πg+T+h(Π>Π)−1Π>zfor any λ>0. 4. Some Remarks on the Main Results First, we make a remark on Theorem 1. Because |G1|= (− 1 )g·p , from (29) , exg may be expressed with ex as exg=−G−1 1G2ex . Likewise, because |H2|= 1, from (30) , exh may be expressed with ex as exh=−H−1 2H1ex . Thus, the modified `1 polynomial trend filtering, (16) , may be characterized as a filtering that calculates −G−1 1G2 IT −H−1 2H1 ex(33) from y.7In addition, from Kim et al. (2009), it follows that ex→yas λ→0. Therefore, we obtain: ex(d) g+T+h→ −G−1 1G2 IT −H−1 2H1 y,(λ→0). (34) Second, we provide a remark on Theorems 2and 3.Yamada (2017b) recently showed that: ex=Πb β+Xe φ, (35) 7Let us calculate −H−1 2H1exfor the case where p=3, g=h=2, and T=5. From (28), it follows that −H1ex=e xT−2−3e xT−1+3e xT e xT−1−3e xT=e xT+ (∆e xT) + (∆2e xT) −2e xT−(∆e xT). Accordingly, we obtain: −H−1 2H1ex=1 0 3 1e xT+ (∆e xT) + (∆2e xT) −2e xT−(∆e xT)=e xT+ (∆e xT) + (∆2e xT) e xT+2(∆e xT) + 3(∆2e xT), which is consistent with (15).
Econometrics 2018,6, 33 8 of 10 where X=D>(DD>)−1 and e φ , which is a (T−p) -dimensional column vector, is the solution of the following Lasso regression/BPDN: min φky−Xφk2 2+λkφk1. (36) Because X>Π=0 , Πb β+Xe φ in (35) represents an orthogonal decomposition of ex . Here, we show that we may prove Theorems 2and 3by using (35) and (36) . Premultiplying (35) by D yields Dex=e φ . We accordingly obtain: Dg+T+hexg+T+h= 0 e φ 0 . (37) (i) From (Osborne et al. 2000, p. 324), if λ≥ 2 kX>yk∞ , then e φ=0 . Therefore, we obtain ex=Πb β and Dg+T+hexg+T+h=0, which proves Theorem 2. (ii) If y=Πα , where α6=0 , then X>y=0 , which implies that λ> 2 kX>yk∞= 0. Again, from Osborne et al. (2000), we obtain e φ=0 if y=Πα . Therefore, if y=Πα , it follows that ex=Πb β=Παand Dg+T+hexg+T+h=0, which proves Theorem 3. Third, we give an example of Corollary 1(i). For the case where y= [ 1, . . . , 5 ]> and p=g=h= 2, it follows that ex(d) 2+5+2= [−1, 0, 1, . . . , 5, 6, 7]>for any λ>0. 5. Concluding Remarks The `1 polynomial trend filtering method is a promising piecewise polynomial curve-fitting method because it does not require prespecifying the number and location of knots. We have shown some theoretical results on this method. One of them is that a small modification of the filtering provides identical trend estimates and also extrapolations of the trend beyond both sample limits. Another is that e xT+1 , . . . , e xT+h based on (12) are useless to improve the trend estimates of `1 polynomial trend filtering. We also provided a MATLAB function for calculating the solution of one of the modified filtering methods. The main results of the paper are summarized in Theorems 1–3and Corollary 1. Finally, we remark that applying the modified `1 polynomial trend filtering (16) – (18) requires specification of the value of λ . For this purpose, the methods proposed in Yamada and Yoon (2016) and Yamada (2018) are applicable. Author Contributions: H.Y. contributed mainly to the paper. R.D. joined the project and contributed to complete it. Funding: This work was supported in part by the Japan Society for the Promotion of Science KAKENHI Grant Number 16H03606. Acknowledgments: We appreciate two anonymous referees for their valuable suggestions and comments. An earlier draft entitled “A Small But Practically Useful Modification to the `1 Trend Filtering” was presented at the 12th International Symposium on Econometric Theory and Applications & 26th New Zealand Econometric Study Group 2016 in Hamilton, New Zealand, 17–19 February 2016. Our thanks to the participants for their useful comments. The usual caveat applies. Conflicts of Interest: The authors declare no conflict of interest. Appendix A. Proof of (15) Because ∆3e xT+j=∆2e xT+j−∆2e xT+j−1 , from ∆3e xT+j= 0 for j= 1, . . . , h , we obtain ∆2e xT+k= ∆2e xT for k= 1, . . . , h . Then, because ∑l k=1(∆2e xT+k) = l(∆2e xT) for l= 1, . . . , h and ∑l k=1(∆2e xT+k) = ∆e xT+l−∆e xT, it follows that ∆e xT+l=∆e xT+l(∆2e xT),(l=1, . . . , h).