How does fitlme specify the residuals covariance matrix structure?

6 次查看(过去 30 天)
I am new to linear mixed effects models and still learning the nomenclature and decision points. I am running fitlme to estimate a model with multiple fixed and random effects, and I was asked by one of my advisors "how I specified the structure of the covariance matrix of the residuals". The documentation does not seem to say anything on this point, as I understand the 'CovariancePattern' argument to relate only to the matrix of random effects covariances, not to the residuals.
Is matlab doing something specific under the hood on this point?
Thanks in advance!

回答(1 个)

Yash
Yash 2023-10-23
Hi Emmett,
I understand that you are facing issues while specifying the structure of the matrix of residuals in a Liner Mixed Effects Model.
In MATLAB's "fitlme" function, the "CovariancePattern" argument does indeed relate to the specification of the random effects covariance structure, not the residuals. This is clearly specified in the documentation: https://www.mathworks.com/help/stats/fitlme.html.
When you fit a linear mixed effects model using the "fitlme" function in MATLAB, the estimation procedure automatically estimates the covariance matrix of the residuals based on the specified model and the observed data. MATLAB employs maximum likelihood estimation (MLE) to estimate the model parameters, including the covariance matrix of the residuals.
To obtain the residuals matrix, you can utilize the "residuals" function. This function allows you to extract the residuals from the fitted linear mixed effects model. For further information on the "residuals" function, you can refer to the MATLAB documentation at the following link: https://www.mathworks.com/help/stats/linearmixedmodel.residuals.html.
Hope this helps.
Best Regards,
Yash
  1 个评论
Emmett Larsen
Emmett Larsen 2023-10-30
Thank you for this, Yash! I think this helps, but I am still wondering whether matlab is freely estimating all components of the residuals covariance matrix or if it is making any assumptions that certain parts of the matrix will be specific values (eg I understand that softwares sometimes default to assuming values of 0 on outside the diagonal of the matrix)...
Emmett

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by