Transformation of variables in regression

3 次查看(过去 30 天)
Hi everybody, I have a question on multiple linear regression. I'd like to check several transformations of my independent variables (for example 1/x, x^2, sqrt(x)) in order to get a better adjusted r2. i have 5 independent variables (x1, x2, x3, x4, x5) and i would like to check the impact of different transformations at the same time. for example, one possibility would be y=1/x1+x2*x2+x3*x3+sqrt(x4)+1/x5.
in the end, the output would be the best fitted model.(crieterion=adjr2) can anyone help? thanks a lot

回答(1 个)

Ahmet Cecen
Ahmet Cecen 2016-11-11
You can use my MultiPolyRegress.
Now this deviates from your parameters a little.
1) The code is limited to standard polynomial bases with minor modifications. But you can use 90% of the code with some manipulation for other transformations as well.
2) The code doesn't calculate adjusted R square, but calculates Leave One Out Cross Validated metrics automatically. You can use it for overfitting detection by comparing how close the RSquare is to CV_RSquare (closer the better).

类别

Help CenterFile Exchange 中查找有关 Linear Regression 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by