





> Date: Sun, 19 Jun 2011 19:06:20 +1200
> From: agw1118@gmail.com
> To: r-help@r-project.org
> Subject: [R] Multivariate HPD credible volume -- is it computable in R?
> 
> Hi all,
> 
> I'm new to the list and am hoping to get some advice. I have a set of
> multivariate data and would like to find the densest part of the data cloud
> containing 95% of the data, like a 95% HPD credible volume. Is there any R
> code available to compute that?

It looks like the LaplacesDemon pkg was just updated FWIW,

http://www.google.com/search?hl=en&q=hpd+credible+volume+cran

If youjust  want to find the density of your data in some n-dim space, that sounds like
multi dim binning or histogram would work (you can check google but IIRC there is
no general n-dim binning pacakge.  I also mentioned a version based
on a density field being associated with each point which could be summed over
all points to get density at arbirtary point but you need to implrement that in some
intelligent way for it to be fast ). I guess you could bin using aggregate see if this
example would work,

df<-data.frame(z=runif(100), x<-runif(100)*10,y<-runif(100)*5,c<-rep(1,100))
d<-aggregate(c~floor(x)+floor(y),df,FUN="sum")
d
which (d$c==max(d$c))

now at this point you can imagine you may be able to find a surface that encloses 
a certain amount of your data



> 
> Thank you very much! Your help and patience are much appreciated.
> 
> G.S.
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
 		 	   		  
	[[alternative HTML version deleted]]

