

ace(acepack)                                 R Documentation

_A_l_t_e_r_n_a_t_i_n_g _C_o_n_d_i_t_i_o_n_a_l _E_x_p_e_c_t_a_t_i_o_n_s

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

     Uses the alternating conditional expectations algorithm
     to find the transformations of y and x that maximise
     the proportion of variation in y explained by x.

_U_s_a_g_e_:

     ace(x, y, wt, mon, lin, cat, circ, delrsq)

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

       x: a matrix containing the independent variables.

       y: a vector containing the response variable.

      wt: an optional vector of weights.

     mon: an optional integer vector specifying which vari-
          ables are to be transformed by monotone transfor-
          mations.  Positive values in `mon' refer to
          columns of the `x' matrix and zero to the response
          variable.

     lin: an optional integer vector specifying which vari-
          ables are to be transformed by linear transforma-
          tions.  Positive values in `lin' refer to columns
          of the `x' matrix and zero to the response vari-
          able.

     cat: an optional integer vector specifying which vari-
          ables assume categorical values.  Positive values
          in `cat' refer to columns of the `x' matrix and
          zero to the response variable.

    circ: an integer vector specifying which variables
          assume circular (periodic) values.  Positive val-
          ues in `circ' refer to columns of the `x' matrix
          and zero to the response variable.

  delrsq: termination threshold.  Iteration stops when R-
          squared changes by less than `delrsq' in 3 consec-
          utive iterations (default 0.01).

_V_a_l_u_e_:

     A structure with the following components:

       x: the input x matrix.

       y: the input y vector.

      tx: the transformed x values.

      ty: the transformed y values.

     rsq: the multiple R-squared value for the transformed
          values.

       l: not used in this version of ace

       m: not used in this version of ace

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

     Breiman and Friedman, Journal of the American Statisti-
     cal Association (September, 1985).

     The R code is adapted from S code for avas() by Tibshi-
     rani, in the Statlib S archive; the FORTRAN is a dou-
     ble-precision version of FORTRAN code by Friedman and
     Spector in the Statlib general archive.

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

     TWOPI <- 8*atan(1)
     x <- runif(200,0,TWOPI)
     y <- exp(sin(x)+rnorm(200)/2)
     a <- ace(x,y)
     par(mfrow=c(3,1))
     plot(a$y,a$ty)  # view the response transformation
     plot(a$x,a$tx)  # view the carrier transformation
     plot(a$tx,a$ty) # examine the linearity of the fitted model

