Can one get fitted value without going to predict?

조회 수: 1 (최근 30일)
alpedhuez
alpedhuez 2021년 7월 29일
댓글: alpedhuez 2021년 7월 30일
I have a regression
mdl=fitlm(X,Y)
How can one obtain the fitted value of the regression without going for predict?
  댓글 수: 1
Scott MacKenzie
Scott MacKenzie 2021년 7월 30일
I had posted an answer but then read Jeff's answer, posted a few hours after mine. As Jeff is "guessing" so was I.
@alpedhuez, if Jeff's answer is what you are looking for, that's great. Please accept his answer.
If it's not what you are looking for, then please explain what you want. Explain what you mean by "fitted value" (why singular? coefficients? predictions? just one prediction? closeness of fit? etc.) and "without going for predict".

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

채택된 답변

Jeff Miller
Jeff Miller 2021년 7월 30일
From your reference to 'predict', I'm guessing you have a vector of observed x values and you want to compute the predicted y for those x's. If so, then you want something like this:
xwithintercept = [1 x]; % maybe x' depending on row vs column vector
predictedY = sum( xwithintercept .* mdl.Coeffificent.Estimate)
  댓글 수: 1
alpedhuez
alpedhuez 2021년 7월 30일
I had hoped that
fitlm
had saved the value so that one can just reference it.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Support Vector Machine Regression에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by