

   aaccee:: AAlltteerrnnaattiinngg CCoonnddiittiioonnaall EExxppeeccttaattiioonnss

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

   AArrgguummeenntts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).

   EExxaammppllees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

