predict.densityMclust: Density estimate of multivariate observations by Gaussian...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/densityMclust.R

Description

Compute density estimation for multivariate observations based on Gaussian finite mixture models estimated by densityMclust.

Usage

1
2
  ## S3 method for class 'densityMclust'
predict(object, newdata, what = c("dens", "cdens"), logarithm = FALSE, ...)

Arguments

object

an object of class 'densityMclust' resulting from a call to densityMclust.

newdata

a vector, a data frame or matrix giving the data. If missing the density is computed for the input data obtained from the call to densityMclust.

what

a character string specifying what to retrieve: "dens" returns a vector of values for the mixture density: "cdens" returns a matrix of component densities for each mixture component (along the columns).

logarithm

A logical value indicating whether or not the logarithm of the density or component densities should be returned.

...

further arguments passed to or from other methods.

Value

Returns a vector or a matrix of densities evaluated at newdata depending on the argument what (see above).

Author(s)

Luca Scrucca

See Also

Mclust.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
x <- faithful$waiting
dens <- densityMclust(x)
x0 <- seq(50, 100, by = 10)
d0 <- predict(dens, x0)
plot(dens)
points(x0, d0, pch = 20)

## End(Not run)

Example output

Package 'mclust' version 5.3
Type 'citation("mclust")' for citing this R package in publications.

mclust documentation built on July 2, 2018, 9:03 a.m.