This post explains how to implement the sign constrained lasso with ridge, and linear regression model. The restrictions of expected sign is of great importance in the case when building an econometric model with meaningful interpretation. We can easily incorporate sign restrictions to the above regression models using glmnet R package.
It is a stylized fact that the default risk decreases in GDP growth rate, but increase in GDP growth volatility. This relationship is empirical and theoretical guideline for the model selection. Therefore, all explanatory variables should be consistent to its own expected signs.
The lasso, ridge, and linear regression model is the unrestricted model as default setting. But The sign restrictions need to be included as additional constraints in optimization problem. Implementing this optimization problem is not easy but we can sidestep this difficulty by using glmnet R package.
Since the following R code have a self-contained structure, it is easy to understand. In this code, The expected signs of each coefficients are given by user as following rule.
- 1 : expected sign is plus(+)
- -1 : expected sign is mimus(-)
- 0 : expected sign is indeterminate
From the above estimation results, we can find that estimated coefficients are consistent with each expected sign. When estimated sing conflicts with the expected one, its coefficients is set to zero and is discarded. Therefore we can understand that the sign restrictions is another form of variable selection process which reduce more the range of selected variables.
Generally speaking, it is not easy to impose the expected sign restrictions but we can do it with powerful glmnet R package.\(\blacksquare\)