How does fitlme specify the residuals covariance matrix structure?
6 views (last 30 days)
Show older comments
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!
0 Comments
Answers (1)
Yash
on 23 Oct 2023
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
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!