# cov_mle: Computes the maximum likelihood estimator for the sample... In sparsediscrim: Sparse and Regularized Discriminant Analysis

## Description

For a sample matrix, x, we compute the sample covariance matrix of the data as the maximum likelihood estimator (MLE) of the population covariance matrix.

## Usage

 1 cov_mle(x, diag = FALSE) 

## Arguments

 x data matrix with n observations and p feature vectors diag logical value. If TRUE, assumes the population covariance matrix is diagonal. By default, we assume that diag is FALSE.

## Details

If the diag option is set to TRUE, then we assume the population covariance matrix is diagonal, and the MLE is computed under this assumption. In this case, we return a vector of length p instead.

## Value

sample covariance matrix of size p \times p. If diag is TRUE, then a vector of length p is returned instead.

sparsediscrim documentation built on July 1, 2021, 9:07 a.m.