ellipse               package:cwhmath               R Documentation

_G_e_n_e_r_a_t_e _e_l_l_i_p_s_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Given a positive definite symmetric matrix 'A' of dimension 2 by 2
     and a constant 'cn', or the axes 'a, b' and an angle 'phi' (in
     radian, counter clockwise), and the midpoint coordinates 'm',
     points on the ellipse (y-m)'*A^{(-1)}*(y-m) = cn^2 or
     rotm(2,1,2,phi) %*% matrix(c(a,0,0,b), 2, 2) will be generated.

_U_s_a_g_e:

       ellipse(k, m, A, cn)
       ellipse(k, m, a=, b=, phi=)
       conf.ellipse(k, m, A, df, level = 0.95)

_A_r_g_u_m_e_n_t_s:

       k: the number of generated points on the ellipse.

       m: vector of length 2 containing the midpoint coordinates of the
          ellipse.

       A: positive definite symmetric matrix of dimension 2 by 2

      cn: positive constant.

       a: major axis

       b: minor axis

     phi: angle in radian describing the counter clockwise rotation
          from the x-axis to the major axis.

      df: degree of freedom of F-distribution.

   level: probability level of F-distribution F(2,df).

_V_a_l_u_e:

     The matrix with columns consisting of the x and y coordinates of
     the ellipse.

_A_u_t_h_o_r(_s):

     Of ellipse: originally Bernhard Flury and Marco Bee for Flury's
     book "A First Course in Multivariate Statistics" (Springer 1997).
     Of conf.ellipse: Roger Koenker 
      roger@ysidro.econ.uiuc.edu, <URL: http://www.econ.uiuc.edu> May
     19, 1999. 
      Refined by: Christian W. Hoffmann, christian.hoffmann@wsl.ch, 
      <URL: http://www.wsl.ch/staff/christian.hoffmann>

_S_e_e _A_l_s_o:

     'rotm'

_E_x_a_m_p_l_e_s:

     A <- matrix(c(1,1,1,2), ncol = 2)                # define matrix A
     m <- c(3, 4)                                     # define vector m
     plot(ellipse(1000,m,A,1))  

     plot(pe <- ellipse(800,m,A,1),pch=".",type="n")
     lines(rbind(pe,pe[1,]))
     lines({pe <- ellipse(600,m,A,0.5); rbind(pe,pe[1,])})
     lines({pe <- ellipse(400,m,A,0.25); rbind(pe,pe[1,])})
     lines(conf.ellipse(51,m,A,20,0.9),lty=4,col="red")
     lines(conf.ellipse(51,m,A,20,0.8),lty=4,col="green")

