Skip to content

Predicting components for new data? #1

@mschubert

Description

@mschubert

Hi,

Thank you for this useful package!

I'm using mixtools to fit a Normal mixture model similar to the vignette example:

library(mixtools)
data(faithful)
attach(faithful)

wait1 = normalmixEM(waiting, mu=c(50, 70))

head(wait1$posterior, 2)
#              comp.1       comp.2
#   [1,] 1.023874e-04 9.998976e-01
#   [2,] 9.999089e-01 9.109251e-05

Is there a way to predict the posterior component likelihood for new data (analogous to e.g. predict on an lm model)?

predict(wait1, newdata=data.frame(waiting=c(42,44,61)))
# Error in UseMethod("predict") :
#   no applicable method for 'predict' applied to an object of class "mixEM"
mod = lm(eruptions ~ waiting, data=faithful)
predict(mod, newdata=data.frame(waiting=c(45,77)))

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions