Inversion of a singular matrix
Afficher commentaires plus anciens
Hello everyone,
I have a question that may sound akward, but I need to know. First, let me recall the discriminant function for a k-classes classification problem with Linear Discriminant Analysis (LDA).
I have a binary classification problem with a predictor matrix (X) of sizes NxK = 29x1018. I woud not expect a solution with LDA, given that the resulting covariance matrix would not be invertible. However, when I applied the fitcdiscr.m function it returns me a solution. Nonetheless, when I check the determinant of the covariance matrix (returned as an output from the returned Classification Discriminant object), it is, indeed, null.
So, do you have any explanation for this? I guess that the function internally does some type of "trick" to get an invertible matrix, but I could not reach that level of depth even by looking inside the matlab code (or maybe I am just missing something).
Find attached an example of X and Y elements slong with the code lines used to fit the LDA model and to check the determinant of the returned covariance matrix:
MdlLinear = fitcdiscr(xtrain,ytrain);
det(MdlLinear.Sigma)
Thank you so much in advance
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Discriminant Analysis dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!