Learn R Programming

⚠️There's a newer version (0.3.0) of this package.Take me there.

sparsediscrim

The R package sparsediscrim provides a collection of sparse and regularized discriminant analysis classifiers that are especially useful for when applied to small-sample, high-dimensional data sets.

Installation

You can install the stable version on CRAN:

install.packages('sparsediscrim', dependencies = TRUE)

If you prefer to download the latest version, instead type:

library(devtools)
install_github('ramhiser/sparsediscrim')

Classifiers

The sparsediscrim package features the following classifier (the R function is included within parentheses):

  • High-Dimensional Regularized Discriminant Analysis (hdrda) from Ramey et al. (2015)

The sparsediscrim package also includes a variety of additional classifiers intended for small-sample, high-dimensional data sets. These include:

ClassifierAuthorR Function
Diagonal Linear Discriminant AnalysisDudoit et al. (2002)dlda
Diagonal Quadratic Discriminant AnalysisDudoit et al. (2002)dqda
Shrinkage-based Diagonal Linear Discriminant AnalysisPang et al. (2009)sdlda
Shrinkage-based Diagonal Quadratic Discriminant AnalysisPang et al. (2009)sdqda
Shrinkage-mean-based Diagonal Linear Discriminant AnalysisTong et al. (2012)smdlda
Shrinkage-mean-based Diagonal Quadratic Discriminant AnalysisTong et al. (2012)smdqda
Minimum Distance Empirical Bayesian Estimator (MDEB)Srivistava and Kubokawa (2007)mdeb
Minimum Distance Rule using Modified Empirical Bayes (MDMEB)Srivistava and Kubokawa (2007)mdmeb
Minimum Distance Rule using Moore-Penrose Inverse (MDMP)Srivistava and Kubokawa (2007)mdmp

We also include modifications to Linear Discriminant Analysis (LDA) with regularized covariance-matrix estimators:

  • Moore-Penrose Pseudo-Inverse (lda_pseudo)
  • Schafer-Strimmer estimator (lda_schafer)
  • Thomaz-Kitani-Gillies estimator (lda_thomaz)

Copy Link

Version

Install

install.packages('sparsediscrim')

Monthly Downloads

785

Version

0.2.4

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

John Ramey

Last Published

August 14th, 2017

Functions in sparsediscrim (0.2.4)

cov_block_autocorrelation

Generates a \(p \times p\) block-diagonal covariance matrix with autocorrelated blocks.
cov_eigen

Computes the eigenvalue decomposition of the maximum likelihood estimators (MLE) of the covariance matrices for the given data matrix
cov_mle

Computes the maximum likelihood estimator for the sample covariance matrix under the assumption of multivariate normality.
cov_pool

Computes the pooled maximum likelihood estimator (MLE) for the common covariance matrix
generate_blockdiag

Generates data from K multivariate normal data populations, where each population (class) has a covariance matrix consisting of block-diagonal autocorrelation matrices.
generate_intraclass

Generates data from K multivariate normal data populations, where each population (class) has an intraclass covariance matrix.
cov_intraclass

Generates a \(p \times p\) intraclass covariance matrix
cov_list

Computes the covariance-matrix maximum likelihood estimators for each class and returns a list.
hdrda_cv

Helper function to optimize the HDRDA classifier via cross-validation
lda_pseudo

Linear Discriminant Analysis (LDA) with the Moore-Penrose Pseudo-Inverse
lda_schafer

Linear Discriminant Analysis using the Schafer-Strimmer Covariance Matrix Estimator
lda_thomaz

Linear Discriminant Analysis using the Thomaz-Kitani-Gillies Covariance Matrix Estimator
print.mdmeb

Outputs the summary for a MDMEB classifier object.
print.mdmp

Outputs the summary for a MDMP classifier object.
cov_shrink_diag

Computes a shrunken version of the maximum likelihood estimator for the sample covariance matrix under the assumption of multivariate normality.
cv_partition

Randomly partitions data for cross-validation.
diag_estimates

Computes estimates and ancillary information for diagonal classifiers
dlda

Diagonal Linear Discriminant Analysis (DLDA)
dmvnorm_diag

Computes multivariate normal density with a diagonal covariance matrix
dqda

Diagonal Quadratic Discriminant Analysis (DQDA)
no_intercept

Removes the intercept term from a formula if it is included
plot.hdrda_cv

Plots a heatmap of cross-validation error grid for a HDRDA classifier object.
print.lda_thomaz

Outputs the summary for a lda_thomaz classifier object.
print.smdlda

Outputs the summary for a SmDLDA classifier object.
print.smdqda

Outputs the summary for a SmDQDA classifier object.
update_hdrda

Helper function to update tuning parameters for the HDRDA classifier
var_shrinkage

Shrinkage-based estimator of variances for each feature from Pang et al. (2009).
mdmeb

The Minimum Distance Rule using Modified Empirical Bayes (MDMEB) classifier
mdmp

The Minimum Distance Rule using Moore-Penrose Inverse (MDMP) classifier
print.dqda

Outputs the summary for a DQDA classifier object.
log_determinant

Computes the log determinant of a matrix.
mdeb

The Minimum Distance Empirical Bayesian Estimator (MDEB) classifier
print.lda_pseudo

Outputs the summary for a lda_pseudo classifier object.
print.lda_schafer

Outputs the summary for a lda_schafer classifier object.
rda_cov

Calculates the RDA covariance-matrix estimators for each class
center_data

Centers the observations in a matrix by their respective class sample means
cov_autocorrelation

Generates a \(p \times p\) autocorrelated covariance matrix
h

Bias correction function from Pang et al. (2009).
hdrda

High-Dimensional Regularized Discriminant Analysis (HDRDA)
posterior_probs

Computes posterior probabilities via Bayes Theorem under normality
print.dlda

Outputs the summary for a DLDA classifier object.
print.sdlda

Outputs the summary for a SDLDA classifier object.
print.sdqda

Outputs the summary for a SDQDA classifier object.
sdlda

Shrinkage-based Diagonal Linear Discriminant Analysis (SDLDA)
sdqda

Shrinkage-based Diagonal Quadratic Discriminant Analysis (SDQDA)
rda_weights

Computes the observation weights for each class for the HDRDA classifier
print.hdrda

Outputs the summary for a HDRDA classifier object.
regdiscrim_estimates

Computes estimates and ancillary information for regularized discriminant classifiers
risk_stein

Stein Risk function from Pang et al. (2009).
smdlda

Shrinkage-mean-based Diagonal Linear Discriminant Analysis (SmDLDA) from Tong, Chen, and Zhao (2012)
smdqda

Shrinkage-mean-based Diagonal Quadratic Discriminant Analysis (SmDQDA) from Tong, Chen, and Zhao (2012)
print.mdeb

Outputs the summary for a MDEB classifier object.
quadform

Quadratic form of a matrix and a vector
quadform_inv

Quadratic Form of the inverse of a matrix and a vector
solve_chol

Computes the inverse of a symmetric, positive-definite matrix using the Cholesky decomposition
tong_mean_shrinkage

Tong et al. (2012)'s Lindley-type Shrunken Mean Estimator