[R] Cross-correlated variables in kernel density estimation

Adam Gobena agobena at ualberta.ca
Wed Nov 17 03:44:18 CET 2004


Hi Andy,
Sorry about the vague subject line. I think I overlooked a lot of things
including the description of the function itself. Anyway, you have got the
essence of my question. Thanks for the reply. 

I am using kernel density estimation to estimate the pdf some data. The pdf
estimation is an intermediate step in a modeling work. So, I can work with
one variable at a time and combine the final results from my model in some
way but I thought it would be good to look at the joint PDF. The problem is,
my (X,Y) data have a correlation structure.  

Thanks,
Adam

----------------------------------------------------------------------------
Adam K. Gobena
Research Assistant, Water Resources Engineering
Department of Civil & Environmental Engineering
220 Civil/Electrical Eng Bldg
University of Alberta
Edmonton, AB
CANADA T6G 2G7
 

-----Original Message-----
From: Liaw, Andy [mailto:andy_liaw at merck.com] 
Sent: Tuesday, November 16, 2004 6:06 PM
To: 'Adam Gobena'; r-help at stat.math.ethz.ch
Subject: RE: [R] Cross-correlated variables in kernel density estimation

> From: Adam Gobena
> 
> Hi,
> I am wondering if the kde2d 2-D kernel density estimation 
> function in the
> MASS package can take into account the effect of correlations 
> between the
> variables. I couldn't find any achieved information on this issue.
> Unfortunately, I don't have the 2002 edition of Modern 
> Applied Statistics
> with S by Venables and Ripley in case it was described there. 

The subject of your message doesn't seem to have much to do with your
question...  Also, it's not clear to me what you mean by taking into account
the effect of correlations between variables.  Do you mean a kernel function
that is something like a bivariate Gaussian density with non-diagonal
covariance matrix?  If so, ?kde2d in MASS says:

     Two-dimensional kernel density estimation with an axis-aligned
     bivariate normal kernel, evaluated on a square grid.

so the answer is no.  No other R packages that does 2D kernel density
estimation (that I know of, anyway) can do it, either, and probably for a
good reason.  Why would you need it?  If there are correlation structures in
the (X, Y) data, small enough bandwidths in both direction should give
satisfactory estimate of the density.

Andy
 
> Thanks in advance.
> Adam
> --------------------------------------------------------------
> --------------
> Adam Kenea Gobena
> Research Assistant, Water Resources Engineering
> Department of Civil & Environmental Engineering
> 220 Civil/Electrical Eng Bldg
> University of Alberta
> Edmonton, AB
> CANADA T6G 2G7
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.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}}




More information about the R-help mailing list