Box-Cox power transformation for Linear Models

A utility helping finding lamda to transform y-->y^lamda to best fit multiple linear regression ...
Updated 31 Mar 2016

View License

Helps choose a Box-Cox power transformation for a multivariate linear regression.
Assume you are looking at the residuals of [b,bint,r] = regress(y,X) and it seems a transformation is in place. Use:
boxcoxlm(y,X) to find the best lambda for a Box-Cox power transformation (y^lambda, or log(y) for lambda=0)

The function will also plot the Maximum Log-Likelihood as a function of lambda, and a 95% confidence region for the best value of lambda

More control can be obtained using:


which allows ommiting the plot, a different region or precision, and a different alpha value for the confidence interval

Cite As

Hovav Dror (2024). Box-Cox power transformation for Linear Models (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14SP3
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Linear and Nonlinear Regression in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

Refresh to provide a BSD License

minor improvements: an optional output argument with the confidence interval, more examples, out of range flag