predict.ellipsoid          package:cluster          R Documentation

_P_r_e_d_i_c_t _M_e_t_h_o_d _f_o_r _E_l_l_i_p_s_o_i_d _O_b_j_e_c_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Compute points on the ellipsoid boundary, mostly for drawing.

_U_s_a_g_e:

     predict.ellipsoid(object, n.out=201, ...)
     ## S3 method for class 'ellipsoid':
     predict(object, n.out=201, ...)
     ellipsoidPoints(A, d2, loc, n=201)

_A_r_g_u_m_e_n_t_s:

  object: an object of class 'ellipsoid', typically from
          'ellipsoidhull()'; alternatively any list-like object with
          proper components, see details below.

 n.out,n: the number of points to create.

A, d2, loc: arguments of the auxilary 'ellipsoidPoints', see below.

     ...: passed to and from methods.

_D_e_t_a_i_l_s:

     Note 'ellipsoidPoints' is the workhorse function of
     'predict.ellipsoid' a standalone function and method for
     'ellipsoid' objects, see 'ellipsoidhull'. The class of 'object' is
     not checked; it must solely have valid components 'loc' (length
     p), the p x p matrix 'cov' (corresponding to 'A') and 'd2' for the
     center, the shape (``covariance'') matrix and the squared average
     radius or distance.

_V_a_l_u_e:

     a numeric matrix of dimension 'n.out' times p.

_S_e_e _A_l_s_o:

     'ellipsoidhull'.

_E_x_a_m_p_l_e_s:

      ## 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)")
     X <- cbind(x,y)
     C.ls <- cov(X) ; m.ls <- colMeans(X)
     lines(ellipsoidPoints(C.ls, d2 = 2, loc=m.ls), col="green")
     if(require(MASS)) {
       Cxy <- cov.rob(cbind(x,y))
       lines(ellipsoidPoints(Cxy$cov, d2 = 2, loc=Cxy$center), col="red")
     }# MASS

