Regress the class-indicator matrix on (1, h(x)), take the optimal scores
from the eigen-decomposition of Y'Y_hat / N relative to D_pi (Theta' D_pi
Theta = I, the constant score dropped), and classify the discriminant
functions eta(x) = Theta' eta*(x) to the nearest centroid with weights
1 / (alpha^2 (1 - alpha^2)) (ESL sec 12.5.1, as mda::fda). The linear basis
gives LDA.
Usage
morie_esl_fda(X, g, query = NULL, basis = NULL)
Arguments
- X
Predictors, N by p.
- g
Class labels.
- query
Points to classify (default X).
- basis
Optional function expanding a row.
Value
Named list: eigenvalues, scores, variates, centroids, prediction,
classes.
References
Hastie, T., Tibshirani, R. & Buja, A. (1994). JASA 89, 1255-1270.
Examples
i <- 1:60
X <- cbind(sin(i) + 0.2 * (i %% 3), cos(3 * i) + 0.4 * (i %% 3))
morie_esl_fda(X, i %% 3)$eigenvalues
#> [1] 0.2581433913 0.0008389194