View source: R/densityMclust.R
predict.densityMclust | R Documentation |
Compute density estimation for multivariate observations based on Gaussian finite mixture models estimated by densityMclust
.
## S3 method for class 'densityMclust'
predict(object, newdata, what = c("dens", "cdens", "z"), logarithm = FALSE, ...)
object |
an object of class |
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 |
what |
a character string specifying what to retrieve: |
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. |
Returns a vector or a matrix of densities evaluated at newdata
depending on the argument what
(see above).
Luca Scrucca
Mclust
.
x <- faithful$waiting
dens <- densityMclust(x, plot = FALSE)
x0 <- seq(50, 100, by = 10)
d0 <- predict(dens, x0)
plot(dens, what = "density")
points(x0, d0, pch = 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.