Solved – Negative fitted values in OLS regression

linear modelregression

I am running a regression where my dependent variable is a cross-section of variances. Therefore, I require my predicted values (fitted values) to be positive.

However, when running a simple OLS regression, a small percentage of my fitted values are negative, which is non-intuitive in this case (since variance cannot be negative).

Please note that approximately, my dependent variable is distributed according to a Chi-square distribution.

The output that I need from the regression are the fitted values in the original scale, as well a closed form expression of the MSE (Mean Square Error) of these fitted values.

Is there a way to impose a lower bound on the predicted values?

Best Answer

I am running a regression where my dependent variable is a cross-section of variances. Therefore, I require my predicted values (fitted values) to be positive.

Then don't fit a model that doesn't obey such an obvious requirement...

However, when running a simple OLS regression,

... like, you know, OLS.

Please note that approximately, my dependent variable is distributed according to a Chi-square distribution.

Or rather, since population variances are usually not $1$, it should probably be approximately $\sigma^2$ times a chi-square -- so why not model it as, say a Gamma random variable (the distribution of a multiple of a chi-square)?

So why not use a GLM for this problem? All your fitted values are guaranteed to not go negative. See the example here (however, if you fit a straight line model, predicted values can - indeed, must - still go negative outside the data).

Is there a way to impose a lower bound on the predicted values?

If you fit a model for the mean such that the mean will remain positive (log-link, say, rather than identity-link) then out-of-sample predictions will obey the positivity restriction.

If you're modelling variances, the identity link usually won't make sense anyway. Choose one of the others, and the model - fitted and predicted - will stay positive.