why is LinearModel.stepwise() so much slower than stepwisefit() ?

조회 수: 8 (최근 30일)
William
William 2013년 1월 12일
why is LinearModel.stepwise() so much slower than stepwisefit(), the algorithm description of the two functions is the same.
Edit: to avoid confusion I do not mean the function stepwise(), I mean the method of the class LinearModel, "LinearModel.stepwise()".

채택된 답변

Tom Lane
Tom Lane 2013년 1월 14일
The stepwise method in the LinearModel class is written to make its selection using any of a variety of measures. Also, it considers not just single-column changes, but also changes that may involve multiple columns because the term being changed is a categorical variable with multiple levels. The stepwisefit function, on the other hand, is optimized for single-column terms using a specific measure.
I've noticed this performance issue also. I'm going to enter a request in the MathWorks request database asking that some effort be put into speeding up the LinearModel version.
  댓글 수: 1
William
William 2013년 1월 15일
So basically it is a more general implementation that can handle more cases but is less optimized for a specific case? Yes it would be nice if it were optimized as stepwisefit() is.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Greg Heath
Greg Heath 2013년 1월 13일
Stepwise involves human interaction.
Thank you for formally accepting my answer.
Greg
  댓글 수: 1
William
William 2013년 1월 13일
No it does not. You are thinking of the function stepwise(). I am asking about the method of the LinearModel class, LinearModel.stepwise().

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Model Building and Assessment에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by