linear vs nonlinear regression model

조회 수: 3 (최근 30일)
Mohammadreza
Mohammadreza 2023년 6월 23일
편집: John D'Errico 2023년 6월 24일
This is a question in Mathworktutorial of Machine learning. I do think it is wrong!
Quiz (Select two) :Which of these is not a linear regression model? please say your reasons for all of them .
A) y = a + bx + cx^2
B) y = ax1 + bx2 + cx3
C) y = ax1x2 + bx2x3 + cx1x3
D) y = a + bsin(x1) + csin(x2)
E) y = a + bsin(cx)
F) y = a + bx + x ^c
the answer is y = a + bsin(cx) and y = a + bx + x ^c ( why y = a + bx + cx^2 and y = a + bsin(x1) + csin(x2) are not not non-linear?
  댓글 수: 1
John D'Errico
John D'Errico 2023년 6월 23일
편집: John D'Errico 2023년 6월 23일
No. It is not wrong. @the cyclist is of course correct.
y = a*x^2
is LINEAR in a. It is nonlinear in x. But that is not relevant to the question.

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

채택된 답변

John D'Errico
John D'Errico 2023년 6월 24일
편집: John D'Errico 2023년 6월 24일
As I said in my comment, there are two different kinds of linearity. Consider the model:
y = a*exp(x)
Is y linear in x? A linear model has properties like:
y(k*x) == k*y(x)
y(x1+x2) = y(x1) + y(x2)
Is that the case here? NO!!!!!!!
An exponential function like that is not linear. y is clearly nonlinear in x. And that is why you are confused. You mistake one kind of nonlinearity for another.
That y is nonloinear in x, does not make the model nonlinear in a. It is truly linear in a. For example, we see that:
a1*exp(x) + a2*exp(x) = (a1 + a2)*exp(x)
Now, what were you asked?
"Which of these is not a linear regression model?"
So in a linear regression context versus a nonlinear regression context, which models are linear? Which models can have their paameters estimated using a LINEAR regression? That is all that matters here. It is not what you think that is at all relevant, since what you think is wrong. (That is why you are a student, after all.)

추가 답변 (1개)

the cyclist
the cyclist 2023년 6월 23일
Whether a model is linear or not refers to the coefficients being solved for (a, b, c), not the data (x, x1, x2).
  댓글 수: 3
Torsten
Torsten 2023년 6월 24일
편집: Torsten 2023년 6월 24일
Then your thinking is not correct.
Linear or nonlinear always refers to the variables you solve for - and these are the fitting parameters.
the cyclist
the cyclist 2023년 6월 24일
You can of course think that's how it is, or how it should be. But that is not how experts refer to it. (This is a common misunderstanding that people new to mathematical modeling have.)
See, for example, the Linear regression models section of the Linear Model wikipedia page. It explicitly states that the function of the independent variables can be nonlinear.

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by