qda {msos} | R Documentation |
Quadratic discrimination
Description
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.
Usage
qda(x, y)
Arguments
x |
The |
y |
The |
Value
A 'list' with the following components:
- Mean
A
P \times K
matrix, where columnK
contains the coefficentsa_k
for (11.31). The final column is all zero.- Sigma
A
K \times P \times P
array, where the Sigma[k,,] contains the sample covariance matrix for groupk
,\hat{\Sigma_k}
.- c
The
K
-vector of constantsc_k
for (11.48).
See Also
predict_qda
and lda
Examples
# 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)
[Package msos version 1.2.0 Index]