Closed ramhiser closed 11 years ago
For a cross-validation fold, there is no reason to compute XU = X_k %*% U_1
for each set of tuning parameters. This is very likely the most computationally expensive operation, given that X_k
is an n_k
by p
matrix and U_1
is a p
by q
matrix. The subsequent operations, i.e., calculating Q
and W_inv
, should be lightning fast because XU
is n_k
by q
.
Hence, the cross-validation function should simply update the estimates rather than recomputing them each time.
Copied from previous
regdiscrim
package