cv1EMtrain {mclust} | R Documentation

## Select discriminant models using cross validation

### Description

For the ten available discriminant models the leave-one-out cross validation error is calulated. The models for one-dimensional data are "E" and "V"; for higher dimensions they are "EII", "VII", "EEI", "VEI", "EVI", "VVI", "EEE", "EEV", "VEV" and "VVV".

### Usage

    cv1EMtrain(data, labels, modelNames)

### Arguments

`data` | A data matrix
`labels` | Labels for each row in the data matrix
`modelNames` | Vector of model names that should be tested.

### Value

Returns a vector where each element is the error rate for the corresponding model.

### Author(s)

C. Fraley

### See Also

`bicEMtrain`

### Examples

    data(lansing)
    odd <- seq(from=1, to=nrow(lansing), by=2)
    round(cv1EMtrain(data=lansing[odd,-3], labels=lansing[odd,3]), 3)

    cv1Modd <- mstepEEV(data=lansing[odd,-3], z=unmap(lansing[odd,3]))
    cv1Zodd <- do.call("estepEEV", c(cv1Modd, list(data=lansing[odd,-3])))$z
    compareClass(map(cv1Zodd), lansing[odd,3])

    even <- (1:nrow(lansing))[-odd]
    cv1Zeven <- do.call("estepEEV", c(cv1Modd, list(data=lansing[even,-3])))$z
    compareClass(map(cv1Zodd), lansing[odd,3])$error

[Package Contents]