A Nxp data matrix; N observations on the rows and p features on the columns.
ytrain
A N-vector containing the group labels. Should be coded as 1,2,...,G, where G is the number of groups.
lambda
Tuning parameter.
Vinit
A px(G-1) optional initial value for the optimization algorithm; the default value is NULL.
eps
Tolerance level for the convergence of the optimization algorithm; the default value is 1e-6.
maxiter
Maximal number of iterations for the optimization algorithm; the default value is 1000.
rho
A scalar that ensures the objective function is bounded from below; the default value is 1.
Author
Irina Gaynanova
Details
Solves the following optimization problem:
$$\min_V \frac12 Tr(V^tWV+\rho V^tDD^tV)-Tr(D^tV)+\lambda\sum_{i=1}^p\|v_i\|_2$$
Here W is the within-group sample covariance matrix and D is the matrix of orthogonal contrasts between the group means, both are constructed based on the supplied values of xtrain and ytrain.
When \(G=2\), the row penalty reduces to vector L_1 penalty.
References
I.Gaynanova, J.Booth and M.Wells (2016) "Simultaneous Sparse Estimation of Canonical Vectors in the p>>N setting", JASA, 111(514), 696-706.
# Example 1n=10p=100G=3ytrain=rep(1:G,each=n)
set.seed(1)
xtrain=matrix(rnorm(p*n*G),n*G,p)
V=dLDA(xtrain,ytrain,lambda=0.1)
sum(rowSums(V)!=0) # number of non-zero rows