Description Details Author(s) References Examples
Implements Multi-Group Sparse Discriminant Analysis proposal of I.Gaynanova, J.Booth and M.Wells (2016) "Simultaneous sparse estimation of canonical vectors in the p>>n setting", JASA, 111(514), 696-706.
Package: | MGSDA |
Type: | Package |
Version: | 1.5 |
Date: | 2021-01-25 |
License: | GPL(>=2) |
Three functions for estimation and prediction: cv.dLDA
, dLDA
and classifyV
.
Irina Gaynanova
Maintainer: Irina Gaynanova <irinag@stat.tamu.edu>
I.Gaynanova, J.Booth and M.Wells (2016). "Simultaneous sparse estimation of canonical vectors in the p>>N setting", JASA, 111(514), 696-706.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ### Example 1
# generate training data
n <- 10
p <- 100
G <- 3
ytrain <- rep(1:G,each=n)
set.seed(1)
xtrain <- matrix(rnorm(p*n*G),n*G,p)
# find matrix of canonical vectors V
V <- dLDA(xtrain,ytrain,lambda=0.1)
sum(rowSums(V)!=0)
# generate test data
m <- 20
set.seed(3)
xtest <- matrix(rnorm(p*m),m,p)
# perform classification
ytest <- classifyV(xtrain,ytrain,xtest,V)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.