# What default method does the lda() and qda() R functions use? [closed]

I am asking this question to help me with this bountied question.

The Wikipedia article for LDA describes three discrimination rules: Maximum likelihood, Bayes discriminant rule, and Fisher's linear discriminant rule.

The function definitions for the lda() and qda() R functions (from the MASS package) have a method argument:

However, I cannot find any source that specifies what the default method used for these functions is. So what is the default method used for these functions? (If you read my bountied question, you'll be able to understand why I'm trying to understand the default method.)

• I'd guess it's the first that is mentioned. Jan 29, 2021 at 9:52
• @Lewian perhaps. But what does the first one even mean? Jan 29, 2021 at 9:53
• It means that the standard estimators (sample mean and sample covariance matrix) are plugged into the theoretical population formula for the discriminant functions/decision boundaries. Jan 29, 2021 at 9:57
• @Lewian ahh, yes, I see Jan 29, 2021 at 9:58
• I agree by the way that this is not clearly enough stated on the help page, and you may write to the package maintainer to amend this. Jan 29, 2021 at 9:59

Yes, this is not clearly enough stated on the help page (but maybe in the book), but here is how you can find out: type the R prompt:

library(MASS)
MASS:::lda.default
function (x, grouping, prior = proportions, tol = 1e-04, method = c("moment",
"mle", "mve", "t"), CV = FALSE, nu = 5, ...)
...


and look at the method =  argument. As always in R, the first value mentioned is the default.

• Thanks for the answer. It prints out exactly the same thing function (x, grouping, prior = proportions, tol = 1e-04, method = c("moment", "mle", "mve", "t"), CV = FALSE, nu = 5, ...), and then what looks like source code. So the first value in the vector (seems to be moment) is the default? Jan 29, 2021 at 13:05
• YES. And, this is the standard way in R, at the prompt, to investigate the source code. Alternatively, to get less output, type  args(MASS:::lda.default)  Jan 29, 2021 at 13:09