qda | R Documentation |
The function returns the elements needed to calculate the quadratic
discrimination in (11.48). Use the output from this function in
predict_qda
(Section A.3.2) to find the predicted groups.
qda(x, y)
x |
The |
y |
The |
A 'list' with the following components:
A P \times K
matrix, where column K
contains
the coefficents a_k
for (11.31). The final column is all
zero.
A K \times P \times P
array, where the
Sigma[k,,] contains the sample covariance matrix for group
k
, \hat{\Sigma_k}
.
The K
-vector of constants c_k
for (11.48).
predict_qda
and lda
# Load Iris Data
data(iris)
# Iris example
x.iris <- as.matrix(iris[, 1:4])
# Gets group vector (1, ... , 1, 2, ... , 2, 3, ... , 3)
y.iris <- rep(1:3, c(50, 50, 50))
# Perform QDA
qd.iris <- qda(x.iris, y.iris)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.