Internal function for crossval_sparsity
err_back(dat, index, p, q)
Matrix with numeric row/col names
Get from which(..., arr.ind = T)
Number of variables in X
Number of variables in Y
This function finds the most sparse combination of keepx and keepy (min(keepx/p + keepy/q)) that yields cov(T,U) within 1 std error of the largest cov(T,U). Note that it's possible that the resulting keepx or keepy is larger than the orignal when p >> q or p << q.