[R] Cross-correlated variables in kernel density estimation
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. 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 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
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 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
RE: [R] Cross-correlated variables in kernel density estimation
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:[EMAIL PROTECTED] Sent: Tuesday, November 16, 2004 6:06 PM To: 'Adam Gobena'; [EMAIL PROTECTED] 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 __ [EMAIL PROTECTED] 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}} __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Cross-correlated variables in kernel density estimation
Yes it can and it is in the reference. On Tue, 16 Nov 2004, Adam Gobena wrote: 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. -- Brian D. Ripley, [EMAIL PROTECTED] 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, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html