No BSD License  

Highlights from
Box-Cox power transformation for Linear Models

5.0

5.0 | 2 ratings Rate this file 25 Downloads (last 30 days) File Size: 5.58 KB File ID: #10419
image thumbnail

Box-Cox power transformation for Linear Models

by Hovav Dror

 

18 Mar 2006 (Updated 21 Mar 2006)

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

| Watch this File

File Information
Description

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:

[LambdaHat,LambdaInterval]=boxcoxlm(y,X,PlotLogLike,LambdaValues,alpha)

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

MATLAB release MATLAB 7.1.0 (R14SP3)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
19 Apr 2006 Elisabeth O´neil  
09 Feb 2008 Corey Yanofsky  
03 Jul 2010 B

the function for LogLH is
LogLike(end+1)=-0.5*n*log(VarHat)+(Lambd-1)*SigmaLogY;

but this seems to be in consistent with Draper and Box (1969)
which lacks teh 0.5 but includes the term:
-(2sig)^-1 * sum(Zi-MUi)^2
where:
Zi = (YLambdai - 1)/lambda
MUi = "the mean specified by the relevant linear model"

Any explanation? Do you have a reference for this equation?

Thank you.

Please login to add a comment or rating.
Updates
21 Mar 2006

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

Tag Activity for this File
Tag Applied By Date/Time
statistics Hovav Dror 22 Oct 2008 08:18:51
probability Hovav Dror 22 Oct 2008 08:18:51
boxcox Hovav Dror 22 Oct 2008 08:18:51
transformation Hovav Dror 22 Oct 2008 08:18:51
regression Hovav Dror 22 Oct 2008 08:18:51
boxcox Timea Ignat 13 Dec 2011 07:37:00
boxcox Jan 31 May 2012 09:46:23

Contact us at files@mathworks.com