Usage
PenalizedLDA(x, y, xte=NULL, type = "standard", lambda, K = 2, chrom =
NULL, lambda2 = NULL, standardized = FALSE, wcsd.x = NULL, ymat = NULL,
maxiter = 20, trace=FALSE)
Arguments
x
A nxp data matrix; n observations on the rows and p features on the columns.
y
A n-vector containing the class labels. Should be coded as 1, 2, . . . ,
nclasses, where nclasses is the number of classes.
xte
A mxp data matrix; m test observations on the rows and p features on
the columns.
Predictions will be made at these test observations. If NULL then no
predictions will be output.
type
Either "standard" or "ordered". The former will result in the use of
lasso penalties, and the latter will result in fused lasso
penalties. "Ordered" is appropriate if the features are ordered and it
makes sense for the discriminant vector(s) to preserve that ordering.
lambda
If type="standard" then this is the lasso penalty tuning parameter. If
type="ordered" then this is the tuning parameter for the sparsity
component of the fused lasso penalty term.
K
The number of discriminant vectors desired. Must be no greater than
(number of classes - 1).
chrom
Only applies to type="ordered". Should be used only if the p features
correspond to chromosomal locations. In this case, a numeric vector of
length p indicating which "chromosome" each feature belongs to. The
purpose is to avoid imposing smoothness between chromosomes.
lambda2
If type="ordered", then this penalty controls the smoothness term in the
fused lasso penalty. Larger lambda2 will lead to more smoothness.
standardized
Have the features on the data already been standardized to have mean zero and
within-class standard deviation 1? In general, set standardized=FALSE.
wcsd.x
If the within-class standard deviation for each feature has already been
computed, it can be passed in. Usually will be NULL.
ymat
If y has already been converted into a n x nclasses matrix of indicator
variables, it can be passed in. Usually will be NULL.
maxiter
Maximum number of iterations to be performed; default is 20.
trace
Print out progress through iterations?