MATLAB Answers

store residuals of fitlm model

46 views (last 30 days)
Dear Matlab community,
I made a multiple time series regression model, using the command
M1 = fitlm(model,Y)
I now would like to store the residuals as a separate variable.
the command
Resid1 = residuals(M1)
does not work somehow, as it says it is for mixed effect models.
What would be the right command for a fitlm model?
Thank you very much in advance!
Chris

  0 Comments

Sign in to comment.

Accepted Answer

Christoph Meier
Christoph Meier on 13 Aug 2015
I found the answer myself! Hope this helps fellow Rookies:
for raw residuals:
VARIABLENAMEFORRESIDUALS = MODELNAME.Residuals.Raw
You can alternatively store standardised residuals, see link:

  1 Comment

Qinyao Zhou
Qinyao Zhou on 4 Dec 2019
thank you! Great help!

Sign in to comment.

More Answers (0)