On 10/4/07, Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
> On Thu, 4 Oct 2007, Caio Azevedo wrote:
>
> > Hi all,
> >
> > I have a sample of n values from a bivariate distribution (from a MCMC
> > procedure). How could I draw a contour plot of "the joint density" based on
> > that sample ?
>
> You need to estimate the density, and contour that estimate.  MASS has
> examples using its kde2d function.  There are other methods available,
> e.g. in package sm.

If you want something ready made, ggplot2 uses kde2d to draw contours
from a kernel density estimate -
http://had.co.nz/ggplot2/stat_density_2d.html

Hadley


-- 
http://had.co.nz/

______________________________________________
R-help@r-project.org 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.

Reply via email to