\HeaderA{predict.ellipsoid}{Predict Method for Ellipsoid Objects}{predict.ellipsoid}
\aliasA{ellipsoidPoints}{predict.ellipsoid}{ellipsoidPoints}
\keyword{dplot}{predict.ellipsoid}
\keyword{utilities}{predict.ellipsoid}
\begin{Description}\relax
Compute points on the ellipsoid boundary, mostly for drawing.
\end{Description}
\begin{Usage}
\begin{verbatim}
predict.ellipsoid(object, n.out=201, ...)
## S3 method for class 'ellipsoid':
predict(object, n.out=201, ...)
ellipsoidPoints(A, d2, loc, n.half = 201)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] an object of class \code{ellipsoid}, typically from
\code{\LinkA{ellipsoidhull}{ellipsoidhull}()}; alternatively any list-like object
with proper components, see details below.
\item[\code{n.out, n.half}] half the number of points to create.
\item[\code{A, d2, loc}] arguments of the auxilary \code{ellipsoidPoints},
see below.
\item[\code{...}] passed to and from methods.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Note \code{ellipsoidPoints} is the workhorse function of
\code{predict.ellipsoid} a standalone function and method for
\code{ellipsoid} objects, see \code{\LinkA{ellipsoidhull}{ellipsoidhull}}.
The class of \code{object} is not checked; it must solely have valid
components \code{loc} (length \eqn{p}{}), the \eqn{p \times p}{p x p}
matrix \code{cov} (corresponding to \code{A}) and \code{d2} for the
center, the shape (``covariance'') matrix and the squared average
radius (or distance) or \code{\LinkA{qchisq}{qchisq}(*, p)} quantile.
\end{Details}
\begin{Value}
a numeric matrix of dimension \code{2*n.out} times \eqn{p}{}.
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{ellipsoidhull}{ellipsoidhull}}, \code{\LinkA{volume.ellipsoid}{volume.ellipsoid}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
 ## see also  example(ellipsoidhull)

## Robust vs. L.S. covariance matrix
set.seed(143)
x <- rt(200, df=3)
y <- 3*x + rt(200, df=2)
plot(x,y, main="non-normal data (N=200)")
mtext("with classical and robust cov.matrix ellipsoids")
X <- cbind(x,y)
C.ls <- cov(X) ; m.ls <- colMeans(X)
d2.99 <- qchisq(0.99, df = 2)
lines(ellipsoidPoints(C.ls, d2.99, loc=m.ls), col="green")
if(require(MASS)) {
  Cxy <- cov.rob(cbind(x,y))
  lines(ellipsoidPoints(Cxy$cov, d2 = d2.99, loc=Cxy$center), col="red")
}# MASS
\end{ExampleCode}
\end{Examples}

