[R] kernel smooth for tw-dimensional data

Patrick Wang pwang at berkeley.edu
Wed Jun 6 05:33:03 CEST 2007


Hi, I found kde2d in the MASS packages return densities for the bivariate
random varaibles.

I donot understand why each element of density Z is a 2*2 matrix.
Why it is not a number.

For example, a bivariate normula distribution given (x, y) will return a
number, the density, not a matrix.

Thanks
Pat


> Hi all:
>
> I can use the density() function to get the kernel density for given
> observed data X with bandwidth.
>
> Is there a function in R that can take in two dimensional data(x, y) and
> return a joint density based
> on the bandwidth. Do I need to provide bandwith for x and then for y?
>
> Is the GRASS package
> kde2d.G(x, y, h, G, reverse=reverse(G))
>
> provide such function?
>
> Thanks
> pat
>
> ______________________________________________
> 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
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list