plus                  package:plus                  R Documentation

_F_i_t_s _l_i_n_e_a_r _r_e_g_r_e_s_s_i_o_n _w_i_t_h _a _q_u_a_d_r_a_t_i_c _s_p_l_i_n_e _p_e_n_a_l_t_y, _i_n_c_l_u_d_i_n_g _t_h_e _L_a_s_s_o, _M_C+ _a_n_d _S_C_A_D.

_D_e_s_c_r_i_p_t_i_o_n:

     The algorithm generates a piecewise linear path of coefficients
     and penalty levels as critical points of a penalized loss in
     linear regression, starting with zero coefficients for infinity
     penalty and ending with a least squares fit for zero penalty. It
     is an extension of the LARS algorithm from the absolute value
     penalty to quadratic spline penalties.

_U_s_a_g_e:

     plus(x,y, method = c("lasso", "mc+", "scad", "general"), m=2, gamma,v,t,
        monitor=FALSE, normalize = TRUE, intercept = TRUE,
        Gram, use.Gram = FALSE, eps=1e-15, max.steps=500, lam)

_A_r_g_u_m_e_n_t_s:

       x: predictors, an n by p matrix with n > 1 and p > 1.  

       y: response, an n-vector with n > 1. 

  method: c("lasso", "mc+", "scad", "general"); the LASSO penalty is
          specified by m = 1, MC+ is specified by m = 2 and gamma > 0,
          SCAD by m = 3 and gamma > 1.  A general quadratic penalty is
          specified by m-vectors v and t. 

       m: number of knots with a quadratic spline penalty: m = 1 for
          Lasso, m = 2 for MC+, m = 3 for SCAD. Default is m = 2.  

   gamma: the largest knot of a quadratic spline penalty, say rho(.);
          gamma = 0 for lasso.  

       v: m-vector giving the negative second derivative rho(.) of the
          penalty between two knots or beyond gamma.  

       t: m-vector giving the discontinuities of the derivatives of the
          penalty function rho(.) as knots, including 0 as a knot.  

 monitor: If TRUE, plus prints out its progress when variables move in
          and out of the active set. Default is FALSE.  

normalize: If TRUE, each variable is standardized to have unit mean
          squares, otherwise it is left alone. Default is TRUE.  

intercept: If TRUE, an intercept is included in the model (and not
          penalized), otherwise no intercept is included. Default is
          TRUE.  

    Gram: The X'X matrix; useful for repeated runs (e.g. bootstrap)
          where a large X'X stays the same.  

use.Gram: When p is very large, you may not want PLUS to precompute the
          entire Gram matrix. Default is FALSE.  

     eps: An effective zero.  

max.steps: Limit the number of steps taken. Default is 500. There can
          be many more steps than n or p since variables can be removed
          and added as the algorithm proceeds. Users should check if
          the desired penalty level is reached if PLUS ends in the
          maximum step.  

     lam: A decreasing sequence of nonnegative numbers as penalty
          levels for which penalized estimates of coefficients are
          generated. Default is the vector of ordered penalty levels at
          the turning points of the computed path. If lam is set, the
          computation stops when the path first hits the minimum of
          lam. The scale of lam is determined by the penalized loss
          sum((y - x  

_D_e_t_a_i_l_s:

     PLUS is described in detail in Zhang (2007). It computes a
     complete path of crititcal points of a  penalised squared loss
     emcompassing from zero for infinite penalty to a lease squares fit
     for zero  penalty, including possible multiple local minima for
     each penalty level.

_V_a_l_u_e:

     A "plus" object is returned, for which print, predict, coef and
     plot methods exist. In addition  to arguments x, y, max.steps, and
     the used values of method, gamma and lam, the object  contains the
     following items: 

     Some significant components of the object are: 

       v: matrix with rows as p-vectors indicating the parallelepipeds
          in which the computed path lives

beta.path: Tmatrix with rows as p-vectors of regression coefficients at
          the turning points of the solution path

lam.path: penalty levels at the turning points of the computed path.
          When the penalty function is concave,  lam.path may not be a
          decreasing sequence but always takes nonnegative values.

    beta: matrix with rows as p-vector of coefficients when the
          solution path first hits lam

     lam: the specified penalty levels hit by lam.path. This may not be
          the same as argument lam if  the minimum of the argument is
          not reached by the computed solution path. 

     dim: the number of nonzero beta

r.square: R-square values for beta

total.hits: length of output lam

total.steps: total number of steps executed, the same as the total
          number of segments in the  computed solution path. With zero
          as the first coefficient vector, beta.path contains  one more
          vector than total.steps. 

full.path: TRUE if zero penalty is reached.

forced.stop: TRUE if PLUS is forced to stop due to reasons other than
          reaching max.steps or the  minimum of argument lam.

singular.Q: TRUE if PLUS is forced to stop when a matrix is not
          invertible.

_A_u_t_h_o_r(_s):

     Cun-Hui Zhang and Ofer Melnik

_R_e_f_e_r_e_n_c_e_s:

     Zhang, C.-H. (2007). Penalized linear unbiased selection.
     Technical Report No. 2007-003.  Department of Statistics, Rutgers
     University.

_S_e_e _A_l_s_o:

     print, plot, and predict methods

_E_x_a_m_p_l_e_s:

     data(sp500)
     attach(sp500)
     x <- sp500.percent[,3: (dim(sp500.percent)[2])] 
     y <- sp500.percent[,1]

     par(mfrow=c(2,3))
     object <- plus(x,y,method="lasso")
     plot(object)
     plot(object, yvar="dim")
     plot(object, yvar="R-sq")
     object <- plus(x,y,method="mc+")
     plot(object)
     plot(object, yvar="dim")
     plot(object, yvar="R-sq")
     detach(sp500)

