# matrixqda: Quadratic Discriminant Analysis for Matrix Variate... In MixMatrix: Classification with Matrix Variate Normal and t Distributions

## Description

See `matrixlda`: quadratic discriminant analysis for matrix variate observations.

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10``` ```matrixqda( x, grouping, prior, tol = 1e-04, method = "normal", nu = 10, ..., subset ) ```

## Arguments

 `x` 3-D array of matrix data indexed by the third dimension `grouping` vector `prior` a vector of prior probabilities of the same length as the number of classes `tol` by default, `1e-4`. Tolerance parameter checks for 0 variance. `method` whether to use the normal distribution (`normal`) or the t distribution (`t`). By default, normal. `nu` If using the t-distribution, the degrees of freedom parameter. By default, 10. `...` Arguments passed to or from other methods, such as additional parameters to pass to `MLmatrixnorm` (e.g., `row.mean`) `subset` An index vector specifying the cases to be used in the training sample. (NOTE: If given, this argument must be named.)

## Details

This uses `MLmatrixnorm` or `MLmatrixt` to find the means and variances for the case when different groups have different variances.

## Value

Returns a list of class `matrixqda` containing the following components:

`prior`

the prior probabilities used.

`counts`

the counts of group membership

`means`

the group means.

`U`

the between-row covariance matrices

`V`

the between-column covariance matrices

`lev`

levels of the grouping factor

`N`

The number of observations used.

`method`

The method used.

`nu`

The degrees of freedom parameter if the t-distribution was used.

`call`

The (matched) function call.

## References

 ```1 2 3``` ```G Z Thompson, R Maitra, W Q Meeker, A Bastawros (2019), "Classification with the matrix-variate-t distribution", arXiv e-prints arXiv:1907.09565 ```

Venables, W. N. & Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth Edition. Springer, New York. ISBN 0-387-95457-0

 ```1 2``` ```Pierre Dutilleul. The MLE algorithm for the matrix normal distribution. Journal of Statistical Computation and Simulation, (64):105–123, 1999. ```

`predict.matrixqda()`, `MASS::qda()`, `MLmatrixnorm()`, `MLmatrixt()`, `matrixlda()`, and `matrixmixture()`
 ``` 1 2 3 4 5 6 7 8 9 10``` ```set.seed(20180221) # construct two populations of 3x4 random matrices with different means A <- rmatrixnorm(30, mean = matrix(0, nrow = 3, ncol = 4)) B <- rmatrixnorm(30, mean = matrix(1, nrow = 3, ncol = 4)) C <- array(c(A, B), dim = c(3, 4, 60)) # combine together groups <- c(rep(1, 30), rep(2, 30)) # define groups prior <- c(.5, .5) # set prior D <- matrixqda(C, groups, prior) logLik(D) print(D) ```