Dear All, I am trying to visualize the surface of a bivariate kernel density estimate. I have a vector of bivariate observations(x,y), and a function which computes the kernel density estimate z corresponding to each observation. I cannot generate the (x,y) data in the ascending order needed by persp(x,y,z). I was wondering whether there is an R version of the S function interp. Would anybody be able to help. Thank you in advance. Chiara
Dear All, I am trying to visualize the surface of a bivariate kernel density estimate. I have a vector of bivariate observations(x,y), and a function which computes the kernel density estimate z corresponding to each observation. I cannot generate the (x,y) data in the ascending order needed by persp(x,y,z). I was wondering whether there is an R version of the S function interp. Would anybody be able to help. Thank you in advance. Chiara
See ?interp in the `akima' package. Also, I believe the `sm' package does have function that produce the surface plot of 2D kernel density surface. HTH, Andy> From: C Peroni > > Dear All, > > I am trying to visualize the surface of a bivariate kernel density > estimate. > I have a vector of bivariate observations(x,y), and a function which > computes the kernel density estimate z corresponding to each > observation. > I cannot generate the (x,y) data in the ascending order needed by > persp(x,y,z). > I was wondering whether there is an R version of the S > function interp. > > Would anybody be able to help. > Thank you in advance. > > Chiara > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments,...{{dropped}}
On Wed, 17 Mar 2004, C Peroni wrote:> Dear All, > > I am trying to visualize the surface of a bivariate kernel density > estimate. > I have a vector of bivariate observations(x,y), and a function which > computes the kernel density estimate z corresponding to each > observation. I cannot generate the (x,y) data in the ascending order > needed by persp(x,y,z). > I was wondering whether there is an R version of the S function interp.There is, in package akima. But, you really want to be interpolating in the kde: both MASS and KernSmooth have functions to do 2D kde for you. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595