junjun deng
2007-Mar-17 22:14 UTC
[R] What function in R is to estimate the marginal denstiy from bivarate samples?
I have 10000 bivarate samples (x1, x2), and I want to estimate the marginal density of x2. I searched the R manual but couldn't find a function that can do this job. It seems "density" only works for single-variate samples. Can anybody help me with it? Thanks a lot! Best, J. Deng
(Ted Harding)
2007-Mar-17 22:33 UTC
[R] What function in R is to estimate the marginal denstiy f
On 17-Mar-07 22:14:54, junjun deng wrote:> I have 10000 bivarate samples (x1, x2), and I want to estimate the > marginal density of x2. I searched the R manual but couldn't find a > function that can do this job. It seems "density" only works for > single-variate samples. Can anybody help me with it? Thanks a lot! > > Best, > J. DengSuppose your bivariate data are in (say) a matrix with 10000 rows and two columns (col 1 for x1, col 2 for x2). If you are happy to use "density" to estimate the density of a univariate variable, then what is wrong with density(x[,2])? Provided the points (x1,x2) are a sample from the bivariate distribution of x1 and x2, the values of x1 are irrelevant to the marginal distribution of x1. Best wishes, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <ted.harding at nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 17-Mar-07 Time: 22:33:09 ------------------------------ XFMail ------------------------------
Seemingly Similar Threads
- [PATCH v2] i2c: virtio: add a virtio i2c frontend driver
- [PATCH v2] i2c: virtio: add a virtio i2c frontend driver
- [PATCH v2] i2c: virtio: add a virtio i2c frontend driver
- [PATCH v2] i2c: virtio: add a virtio i2c frontend driver
- Centos7 Samba 4.1.12 -> Centos 5.11 Samba 3.5.2 = Rejecting auth request