[R-sig-Geo] 3D kde output conversion to volume

kalee kathryn.lee1 at students.mq.edu.au
Fri Feb 3 06:04:11 CET 2012


I had a reply back from the developer of the ks package to the same query I
sent him. His response was:

"I'll include this functionality in a future update in the ks library.
But in the meantime, you can compute volumes manually using these
commands, continuing the 3-d example,

ct <- contourLevels(fhat, cont=95, approx=TRUE) ## compute 95% contour level
vol.voxel <- prod(sapply(fhat$eval.points, diff)[1,]) ## volume of an
individual voxel
no.voxel <- sum(fhat$estimate>ct) ## number of voxels inside contour region
vol <- no.voxel*vol.voxel  ## approx. volume of contour region

The volume is only approximate and depends highly on the estimation
grid. These commands also for 2D density estimates (of course then the
volume is replaced by area)."

--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/3D-kde-output-conversion-to-volume-tp7203184p7249728.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list