Pregunta

I've estimated the density of old faithful using:

 library(np)
 library(datasets)
 data(faithful)
 f <- npudens(~eruptions+waiting,data=faithful)

How do I find the density of a point not in faithful? Thanks!

¿Fue útil?

Solución

?npudens says that npdensity objects have a predict method:

predict(f,newdata=data.frame(eruptions=3.5,waiting=70))
## [1] 0.004473444
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top