# SDAP: Sparse Discriminant Analysis solved via Proximal Gradient In accSDA: Accelerated Sparse Discriminant Analysis

 SDAP R Documentation

## Sparse Discriminant Analysis solved via Proximal Gradient

### Description

Applies proximal gradient algorithm to the optimal scoring formulation of sparse discriminant analysis proposed by Clemmensen et al. 2011.

### Usage

``````SDAP(Xt, ...)

## Default S3 method:
SDAP(
Xt,
Yt,
Om,
gam,
lam,
q,
PGsteps,
PGtol,
maxits,
tol,
initTheta,
bt = FALSE,
L,
eta,
...
)
``````

### Arguments

 `Xt` n by p data matrix, (not a data frame, but a matrix) `Yt` n by K matrix of indicator variables (Yij = 1 if i in class j). This will later be changed to handle factor variables as well. Each observation belongs in a single class, so for a given row/observation, only one element is 1 and the rest is 0. `Om` p by p parameter matrix Omega in generalized elastic net penalty. `gam` Regularization parameter for elastic net penalty. `lam` Regularization parameter for l1 penalty, must be greater than zero. `q` Desired number of discriminant vectors. `PGsteps` Maximum number if inner proximal gradient algorithm for finding beta. `PGtol` Stopping tolerance for inner APG method. `maxits` Number of iterations to run `tol` Stopping tolerance for proximal gradient algorithm. `initTheta` Initial first theta, default value is a vector of ones. `bt` Boolean to indicate whether backtracking should be used, default false. `L` Initial estimate for Lipshitz constant used for backtracking. `eta` Scalar for Lipshitz constant.

### Value

`SDAP` returns an object of `class` "`SDAP`" including a list with the following named components: (More will be added later to handle the predict function)

`call`

The matched call.

`B`

p by q matrix of discriminant vectors.

`Q`

K by q matrix of scoring vectors.

`subits`

Total number of iterations in proximal gradient subroutine.

`totalits`

Number coordinate descent iterations for all discriminant vectors

`NULL`

`SDAPcv`, `SDAAP` and `SDAD`