orientlm              package:orientlib              R Documentation

_L_i_n_e_a_r _m_o_d_e_l_s _f_o_r _o_r_i_e_n_t_a_t_i_o_n _d_a_t_a

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

     Regression models for matched pairs of orientations.

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

     orientlm(observed, leftformula, trueorient = rotmatrix(diag(3)), 
              rightformula, data = list(), subset, weights, na.action, 
              iterations = 5)

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

observed: Observed orientations 

leftformula: Formula for ``left'' model (see below) 

trueorient: ``True'' orientation (see below) 

rightformula: Formula for ``right'' model (see below) 

    data: Optional data frame for predictors in linear model 

  subset: Optional logical vector indicating subset of data 

 weights: Optional weights 

na.action: Optional NA function for predictors 

iterations: How many iterations to use.  Ignored unless both 
          'leftformula' and 'rightformula' are specified.

_D_e_t_a_i_l_s:

     The Prentice (1989) model for matched pairs of orientations was


                    E(Vi) = k t(A1) %*% Ui %*% A2


     where Vi is the observed orientation, A1 and A2 are orientation
     matrices, and Ui is the ``true'' orientation, and k is a constant.
      It was assumed that errors were symmetrically distributed about
     the identity matrix.

     This function generalizes this model, allowing A1 and A2 to depend
     on regressor variables through 'leftformula' and 'rightformula'
     respectively.   These formulas should include the predictor
     variables (right hand side) only, e.g. use '~ x + y + z' rather
     than 'response ~ x + y + z'.  Specify the response using the
     'observed' argument.  If  both formulas are '~ 1', i.e. intercepts
     only, then Prentice's original model is  recovered.  More general
     models are fit by coordinatewise linear regression in the
     'rotmatrix' representation of the orientation, with fitted values
     projected onto SO(3) using the  'nearest.SO3' function.

     When both left and right models are given, Prentice's iterative
     approach is used with a fixed number of iterations.  Note that
     Shin (1999) found that Prentice's scheme sometimes fails to find
     the  global minimum; this function presumably suffers from the
     same failing.

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

     Returns a list containing the following components: 

leftfit : Result of 'lm' call based on 'leftformula'

rightfit : Result of 'lm' call based on 'rightformula'

     A1 : Fitted values of A1 for each observation

     A2 : Fitted values of A2 for each observation

 predict: Fitted values of t(A1) %*% Ui %*% A2 for each observation

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

     Duncan Murdoch

_R_e_f_e_r_e_n_c_e_s:

     Prentice, M.J. (1989).  Spherical regression on matched pairs of
     orientation statistics. JRSS B 51, 241-248.

     Shin, H.S.H. (1999).  Experimental Design for Orientation Models. 
     PhD thesis, Queen's University.

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

     x <- rep(1:10,10)
     y <- rep(1:10,each=10)
     A1 <- skewvector(cbind(x/10,y/10,rep(0,100)))
     A2 <- skewvector(c(1,1,1))
     trueorientation <- skewvector(matrix(rnorm(300),100))
     noise <- skewvector(matrix(rnorm(300)/10,100))
     obs <- t(A1) %*% trueorientation %*% A2 %*% noise

     fit <- orientlm(obs, ~ x + y, trueorientation, ~ 1)

     context <- boat3d(A1, x, z=y, col = 'green', graphics='scatterplot3d')
     boat3d(fit$A1, x, z=y, add=context)

