@@ -40,6 +40,8 @@ This package implements:
4040* MQuantile regression (e.g. Expectile regression)
4141* Robust Ridge regression (using any of the previous estimator)
4242* Quantile regression using interior point method
43+ * Regularized Least Square regression
44+ * Θ-IPOD regression, possibly with a penalty term
4345
4446## Installation
4547
@@ -63,6 +65,15 @@ For quantile regression, use `quantreg`:
6365
6466` m = quantreg(X, y; quantile=0.5) `
6567
68+ For Regularized Least Squares and a penalty term, use ` rlm ` :
69+
70+ ` m = rlm(X, y, L1Penalty(); method=:cgd) `
71+
72+ For Θ-IPOD regression with outlier detection and a penalty term, use ` ipod ` :
73+
74+ ` m = ipod(X, y, L2Loss(), SquaredL2Penalty(); method=:auto) `
75+
76+
6677For robust version of ` mean ` , ` std ` , ` var ` and ` sem ` statistics, specify the estimator as first argument.
6778Use the ` dims ` keyword for computing the statistics along specific dimensions.
6879The following functions are also implemented: ` mean_and_std ` , ` mean_and_var ` and ` mean_and_sem ` .
@@ -119,6 +130,16 @@ m9 = rlm(form, data, MEstimator{TukeyLoss}(); initial_scale=:L1, ridgeλ=1.0)
119130# # Quantile regression solved by linear programming interior point method
120131m10 = quantreg (form, data; quantile= 0.2 )
121132refit! (m10; quantile= 0.8 )
133+
134+ # # Penalized regression
135+ m11 = rlm (form, data, SquaredL2Penalty (); method= :auto )
136+
137+ # # Θ-IPOD regression with outlier detection
138+ m12 = ipod (form, data, TukeyLoss (); method= :auto )
139+
140+ # # Θ-IPOD regression with outlier detection and a penalty term
141+ m13 = ipod (form, data, L2Loss (), L1Penalty (); method= :ama )
142+
122143;
123144
124145# output
@@ -136,7 +157,7 @@ With ordinary least square (OLS), the objective function is, from maximum likeli
136157where ` yᵢ ` are the values of the response variable, ` 𝒙ᵢ ` are the covectors of individual covariates
137158(rows of the model matrix ` X ` ), ` 𝜷 ` is the vector of fitted coefficients and ` rᵢ ` are the individual residuals.
138159
139- A ` RobustLinearModel ` solves instead for the following loss function: ` L' = Σᵢ ρ(rᵢ) `
160+ A ` RobustLinearModel ` solves instead for the following loss function [ 1 ] : ` L' = Σᵢ ρ(rᵢ) `
140161(more precisely ` L' = Σᵢ ρ(rᵢ/σ) ` where ` σ ` is an (robust) estimate of the standard deviation of the residual).
141162Several loss functions are implemented:
142163
@@ -182,6 +203,17 @@ Using an asymmetric variant of the `L1Estimator`, quantile regression is perform
182203Identically, with an M-estimator using an asymetric version of the loss function,
183204a generalization of quantiles is obtained. For instance, using an asymetric ` L2Loss ` results in _ Expectile Regression_ .
184205
206+ ### Quantile regression
207+
208+ _ Quantile regression_ results from minimizing the following objective function:
209+ ` L = Σᵢ wᵢ|yᵢ - 𝒙ᵢ 𝜷| = Σᵢ wᵢ(rᵢ) |rᵢ| ` ,
210+ where ` wᵢ = ifelse(rᵢ>0, τ, 1-τ) ` and ` τ ` is the quantile of interest. ` τ=0.5 ` corresponds to _ Least Absolute Deviations_ .
211+
212+ This problem is solved exactly using linear programming techniques,
213+ specifically, interior point methods using the internal API of [ Tulip] ( https://github.com/ds4dm/Tulip.jl ) .
214+ The internal API is considered unstable, but it results in a much lighter dependency than
215+ including the [ JuMP] ( https://github.com/JuliaOpt/JuMP.jl ) package with Tulip backend.
216+
185217### Robust Ridge regression
186218
187219This is the robust version of the ridge regression, adding a penalty on the coefficients.
@@ -192,16 +224,44 @@ By default, all the coefficients (except the intercept) have the same penalty, w
192224all the feature variables have the same scale. If it is not the case, use a robust estimate of scale
193225to normalize every column of the model matrix ` X ` before fitting the regression.
194226
195- ### Quantile regression
227+ ### Regularized Least Squares
196228
197- _ Quantile regression_ results from minimizing the following objective function:
198- ` L = Σᵢ wᵢ|yᵢ - 𝒙ᵢ 𝜷| = Σᵢ wᵢ(rᵢ) |rᵢ| ` ,
199- where ` wᵢ = ifelse(rᵢ>0, τ, 1-τ) ` and ` τ ` is the quantile of interest. ` τ=0.5 ` corresponds to _ Least Absolute Deviations_ .
229+ _ Regularized Least Squares_ regression is the solution of the minimization of following objective function:
230+ ` L = ½ Σᵢ |yᵢ - 𝒙ᵢ 𝜷|² + P(𝜷) ` ,
231+ where ` P(𝜷) ` is a (sparse) penalty on the coefficients.
232+
233+ The following penalty function are defined:
234+ - ` NoPenalty ` : ` cost(𝐱) = 0 ` , no penalty.
235+ - ` SquaredL2Penalty ` : ` cost(𝐱) = λ ½||𝐱||₂² ` , also called Ridge.
236+ - ` L1Penalty ` : ` cost(𝐱) = λ||𝐱||₁ ` , also called LASSO.
237+ - ` ElasticNetPenalty ` : ` cost(𝐱) = λ . l1_ratio .||𝐱||₁ + λ .(1 - l1_ratio) . ½||𝐱||₂² ` .
238+ - ` EuclideanPenalty ` : ` cost(𝐱) = λ||𝐱||₂ ` , non-separable penalty used in Group LASSO.
239+
240+ Different penalties can be applied to different indices of the coefficients, using
241+ ` RangedPenalties(ranges, penalties) ` . E.g., ` RangedPenalties([2:5], [L1Penalty(1.0)]) ` defines
242+ a L1 penalty on every coefficients except the first index, which can correspond to the intercept.
243+
244+ With a penalty, the following solvers are available (instead of the other ones):
245+ - ` :cgd ` , Coordinate Gradient Descent [ 2] .
246+ - ` :fista ` , Fast Iterative Shrinkage-Thresholding Algorithm [ 3] .
247+ - ` :ama ` , Alternating Minimization Algorithm [ 4] .
248+ - ` :admm ` , Alternating Direction Method of Multipliers [ 5] .
249+
250+ To use a robust loss function with a penalty, see Θ-IPOD regression.
251+
252+ ### Θ-IPOD regression
253+
254+ _ Θ-IPOD regression_ (Θ-thresholding based Iterative Procedure for Outlier Detection) results from
255+ minimizing the following objective function [ 6] :
256+ ` L = ½ Σᵢ |yᵢ - 𝒙ᵢ 𝜷 - γᵢ|² + P(𝜷) + Q(γ) ` ,
257+ where ` Q(γ) ` is a penalty function on the outliers ` γ ` that is sparse so the problem is not underdetermined.
258+ We don't need to know the expression of this penalty function, just that it leads to thresholding using
259+ one of the loss function used by M-Estimators. Then Θ-IPOD is equivalent to solving an M-Estimator.
260+ This problem is solved using an alternating minimization technique, for the outlier detection.
261+ Without penalty, the coefficients are updated at every step using a solver for _ Ordinary Least Square_ .
262+
263+ ` P(𝜷) ` is an optionnal (sparse) penalty on the coefficients.
200264
201- This problem is solved exactly using linear programming techniques,
202- specifically, interior point methods using the internal API of [ Tulip] ( https://github.com/ds4dm/Tulip.jl ) .
203- The internal API is considered unstable, but it results in a much lighter dependency than
204- including the [ JuMP] ( https://github.com/JuliaOpt/JuMP.jl ) package with Tulip backend.
205265
206266## Credits
207267
@@ -215,4 +275,9 @@ for implementing the Iteratively Reweighted Least Square algorithm.
215275
216276## References
217277
218- - "Robust Statistics: Theory and Methods (with R)", 2nd Edition, 2019, R. Maronna, R. Martin, V. Yohai, M. Salibián-Barrera
278+ [ 1] "Robust Statistics: Theory and Methods (with R)", 2nd Edition, 2019, R. Maronna, R. Martin, V. Yohai, M. Salibián-Barrera
279+ [ 2] "Regularization Paths for Generalized Linear Models via Coordinate Descent", 2009, J. Friedman, T. Hastie, R. Tibshirani
280+ [ 3] "A Fast Iterative Shrinkage-Thresholding Algorithm for Linear Inverse Problems", 2009, A. Beck, M. Teboulle
281+ [ 4] "Applications of a splitting algorithm to decomposition in convex programming and variational inequalities", 1991, P. Tseng
282+ [ 5] "Fast Alternating Direction Optimization Methods", 2014, T. Goldstein, B. O'Donoghue, S. Setzer, R. Baraniuk
283+ [ 6] "Outlier Detection Using Nonconvex Penalized Regression", 2011, Y. She, A.B. Owen
0 commit comments