Message-ID: <43E28DF3.3060107@zoo.ufl.edu>
Date: 2006-02-02T22:55:47Z
From: Ben Bolker
Subject: is there a way to visualize 3D normal distributions?
In-Reply-To: <b1f16d9d0602021401k9655566n214c6e68c6215043@mail.gmail.com>
Michael wrote:
> shape3d only gives rigid sphere... not the free form ellipsoid that I
> want...
>
one or the other of us is missing something.
after running demo(shapes3d)
[to define ellipsoid3d] and rgl.clear(),
s1 <- ellipsoid3d(qmesh = TRUE, trans = diag(4))
shade3d(rotate3d(scale3d(s1, 1, 1, 2),
angle=pi/4, x=0, y=1, z=0),
col = "red")
axis3d()
produces an ellipsoid with radii (1,1,2) rotated by pi/4 around
the y axis. I'm too lazy to figure out how to
translate a variance-covariance matrix into
a scaling/rotation matrix (the scale will want
to be something like eigen(v)$values*qnorm(0.975)
for a 95% contour, the rotation matrix is some
function of the eigenvectors), but it seems to
me that this will produce any ("free form"?) ellipsoid
you want.
cheers
Ben Bolker