Вопрос

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!

Это было полезно?

Решение

?npudens says that npdensity objects have a predict method:

predict(f,newdata=data.frame(eruptions=3.5,waiting=70))
## [1] 0.004473444
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top