Computes estimates and ancillary information for diagonal classifiers
Computes the maximum likelihood estimators (MLEs) for each class under the assumption of multivariate normality for each class. Also, computes ancillary information necessary for classifier summary, such as sample size, the number of features, etc.
matrix containing the training data. The rows are the sample observations, and the columns are the features.
vector of class labels for each training observation
vector with prior probabilities for each class. If NULL (default), then equal probabilities are used. See details.
logical value. If TRUE, calculates the pooled sample variances for each class.
the estimator for the class means. By default, we use the maximum likelihood estimator (MLE). To improve the estimation, we provide the option to use a shrunken mean estimator proposed by Tong et al. (2012).
This function computes the common estimates and ancillary information used in
all of the diagonal classifiers in the
The matrix of training observations are given in
x. The rows of
contain the sample observations, and the columns contain the features for each
The vector of class labels given in
y are coerced to a
The length of
y should match the number of rows in
An error is thrown if a given class has less than 2 observations because the variance for each feature within a class cannot be estimated with less than 2 observations.
prior, contains the a priori class membership for
each class. If
prior is NULL (default), the class membership
probabilities are estimated as the sample proportion of observations belonging
to each class. Otherwise,
prior should be a vector with the same length
as the number of classes in
prior probabilties should be
nonnegative and sum to one.
named list with estimators for each class and necessary ancillary information
Tong, T., Chen, L., and Zhao, H. (2012), "Improved Mean Estimation and Its Application to Diagonal Discriminant Analysis," Bioinformatics, 28, 4, 531-537. http://bioinformatics.oxfordjournals.org/content/28/4/531.long
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.