04-14-2014 06:54 AM
Hi, I wanted to set a constraint on a linear regression model (y = b0+b1*x1+b2*x2+e), such that the the predicted value (b0+b1*x1+b2*x2) is positive. Is there a SAS procedure that can be used for the purpose. Any help is greatly appreciated!
04-14-2014 09:08 AM
Easy way: Fit log(y) and back transform.
More difficult way: Use PROC MODEL with a RESTRICT statement. I know it can be done, but I have never tried it myself.
04-14-2014 10:05 AM
Thank you Steve for your suggestions!
I did try PROC MODEL. I found it difficult to set up a RESTRICT statement for the purpose of bounding all the predicted values of y as positive.
I tried to use log(y) as the dependent variable, but the parameter estimates are not close to the values from the paper, which I was trying to replicate.
04-14-2014 11:07 AM
The RESTRICT statement in PROC REG only handles equality constraints, but you can use the BOUNDS statement in PROC NLIN to restrict the range of the parameters.
04-14-2014 10:06 AM
As stated, your problem is impossible unless b1=b2=0 and b0>0. Otherwise there will always be a value of (x1, x2) for which the predicted value will be negative.
If you know that (x1,x2) are restricted to some domain (like the unit square), then it is possible.
04-14-2014 10:17 AM
Thank you Rick for your reply!
The dependent variable is variance in stock market returns, which is why I want to make sure the predicted variance is positive.
The independent variables include variance and market return from last period. Market return can be negative.
04-14-2014 11:01 AM
In survival analysis, logistic regression, Poisson regression, and other models, the linear portion of the model is transformed by a "link function" to ensure that the result is positive.
04-14-2014 03:14 PM
Because your response variable is a variance, I recommend that you model it as a gamma distribution, with a log link. That is, use GENMOD or GLIMMIX, and choose dist=gamma and link=log. The gamma often works very well as an approximation for the true distribution of a variance at small (finite) sample sizes. You can still get predictions for the original scale in an output file. For instance,
proc glimmix ;
model var = .... / dist=gamma link=log s ;
output out=pred pred(blup ilink)=predicted;
There are many other options for the output file.
Schabenberger and Pierce (2002 textbook) give an example of a regression analysis of a variance dependent variable using this idea (but with GENMOD).