mclustDAtest {mclust} | R Documentation

## MclustDA Testing

### Description

Testing phase for MclustDA discriminant analysis.

### Usage

    mclustDAtest(data, models)

### Arguments

`data` | A numeric vector, matrix, or data frame of observations to be classified.
`models` | A list of MCLUST-style models including parameters, usually the result of applying `mclustDAtrain` to some training data.

### Value

A matrix in which the `[i,j]`th entry is the density for that test observation i in the model for class j.

### References

C. Fraley and A. E. Raftery (2002a). Model-based clustering, discriminant analysis, and density estimation. Journal of the American Statistical Association 97:611-631. See http://www.stat.washington.edu/mclust.

C. Fraley and A. E. Raftery (2002b). MCLUST:Software for model-based clustering, density estimation and discriminant analysis. Technical Report, Department of Statistics, University of Washington. See http://www.stat.washington.edu/mclust.

### See Also

`summary.mclustDAtest`, `mclustDAtrain`

### Examples

    n <- 250 ## create artificial data
    set.seed(0)
    x <- rbind(matrix(rnorm(n*2), n, 2) %*% diag(c(1,9)),
               matrix(rnorm(n*2), n, 2) %*% diag(c(1,9))[,2:1])
    xclass <- c(rep(1,n),rep(2,n))
    ## Not run:
    par(pty = "s")
    mclust2Dplot(x, classification = xclass, type="classification", ask=FALSE)
    ## End(Not run)

    odd <- seq(1, 2*n, 2)
    train <- mclustDAtrain(x[odd, ], labels = xclass[odd]) ## training step
    summary(train)

    even <- odd + 1
    test <- mclustDAtest(x[even, ], train) ## compute model densities
    summary(test)$class ## classify training set

[Package mclust version 2.1-10 Index]