Re: [R] plot smooth density estimates for bivariate data

2005-02-06 Thread Romain Francois
Hello,
try to look at those pages :
library(MASS)
?kde2d
?contour
?image
?persp
x11(height=6,width=12)
par(mfrow=c(1,2))
X - rnorm(200)
Y - rnorm(200)
d - kde2d(X,Y)
persp(d,phi=30,theta=30)
image(d,col=terrain.colors(25))
contour(d,add=T)

Romain.
Le 05.02.2005 23:51, Yulei He a écrit :
Hi, there.
Suppose I have a bivarariate data matrix y1 and y2. I want to plot a 3-D
picture of the estimated density f(y1, y2) against y1 and y2? How can I do
that? Do I use persp() or density()?
 

density is for 1d estimation of density.
Thanks for your help.
Yulei
$$$
Yulei He
1586 Murfin Ave. Apt 37
Ann Arbor, MI 48105-3135
[EMAIL PROTECTED]
734-647-0305(H)
734-763-0421(O)
734-763-0427(O)
734-764-8263(fax)
$$
 

--
Romain FRANCOIS : [EMAIL PROTECTED]
page web : http://addictedtor.free.fr/  (en construction)
06 18 39 14 69 / 01 46 80 65 60
___
Etudiant en 3eme année
Institut de Statistique de l'Université de Paris (ISUP)
Filière Industrie et Services
http://www.isup.cicrp.jussieu.fr/
__
R-help@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


[R] plot smooth density estimates for bivariate data

2005-02-05 Thread Yulei He
Hi, there.

Suppose I have a bivarariate data matrix y1 and y2. I want to plot a 3-D
picture of the estimated density f(y1, y2) against y1 and y2? How can I do
that? Do I use persp() or density()?

Thanks for your help.

Yulei


$$$
Yulei He
1586 Murfin Ave. Apt 37
Ann Arbor, MI 48105-3135
[EMAIL PROTECTED]
734-647-0305(H)
734-763-0421(O)
734-763-0427(O)
734-764-8263(fax)
$$

__
R-help@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