l1ce                 package:lasso2                 R Documentation

_R_e_g_r_e_s_s_i_o_n _F_i_t_t_i_n_g _W_i_t_h _L_1-_c_o_n_s_t_r_a_i_n_t _o_n _t_h_e _P_a_r_a_m_e_t_e_r_s

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

     Returns an object of class '"l1ce"' or '"licelist"' that
     represents fit(s) of linear models while imposing L1 constraint(s)
     on the parameters.

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

     l1ce(formula, data = sys.parent(), weights, subset, na.action,
          sweep.out = ~ 1, x = FALSE, y = FALSE,
          contrasts = NULL, standardize = TRUE,
          trace = FALSE, guess.constrained.coefficients = double(p),
          bound = 0.5, absolute.t = FALSE)

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

 formula: a formula object, with the response on the left of a ' ~ '
          operator, and the terms, separated by '+' operators, on the
          right.

    data: a 'data.frame' in which to interpret the variables named in
          the formula, the 'weights', the 'subset' and the 'sweep.out'
          argument.  If this is missing, then the variables in the
          formula should be globally available.

 weights: vector of observation weights.  The length of 'weights' must
          be the same as the number of observations.  The weights must
          be nonnegative and it is strongly recommended that they be
          strictly positive, since zero weights are ambiguous, compared
          to use of the 'subset' argument. 

  subset: expression saying which subset of the rows of the data should
          be used in the fit.  This can be a logical vector (which is
          replicated to have length equal to the number of
          observations), or a numeric vector indicating which
          observation numbers are to be included, or a character vector
          of the row names to be included.  All observations are
          included by default. 

na.action: a function to filter missing data.  This is applied to the
          'model.frame' after any 'subset' argument has been used. The
          default (with 'na.fail') is to create an error if any missing
          values are found.  A possible alternative is 'na.omit', which
          deletes observations that contain one or more missing values. 

sweep.out: a formula object, variables whose parameters are not put
          under the constraint are swept out first.  The variables
          should appear on the right of a ' ~ ' operator and be
          separated by '+' operators. Default is ' ~1 ', i.e. the
          constant term is not under the constraint.  If this parameter
          is 'NULL', then all parameters are put under the constraint. 

       x: logical indicating if the model matrix should be returned in
          component 'x'.

       y: logical indicating if the response should be returned in
          component 'y'.

contrasts: a list giving contrasts for some or all of the factors
          appearing in the model formula. The elements of the list
          should have the same name as the variable and should be
          either a contrast matrix (specifically, any full-rank matrix
          with as many rows as there are levels in the factor), or else
          a function to compute such a matrix given the number of
          levels. 

standardize: logical flag: if 'TRUE', then the columns of the model
          matrix that correspond to parameters that are constrained are
          standardized to have emprical variance one.  The
          standardization is done after taking possible weights into
          account and after sweeping out variables whose parameters are
          not constrained. 

   trace: logical flag: if 'TRUE', then the status during each
          iteration of the fitting is reported. 

guess.constrained.coefficients: initial guess for the parameters that
          are constrained. 

   bound: numeric, either a single number or a vector: the
          constraint(s) that is/are put onto the L1 norm of the
          parameters.

absolute.t: logical flag: if 'TRUE', then 'bound' is an absolute bound
          and all entries in 'bound' can be any positive number.  If
          'FALSE', then 'bound' is a relative bound and all entries
          must be between 0 and 1.

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

     an object of class 'l1ce' (if 'bound' was a single value) or
     'l1celist' (if 'bound' was a vector of values) is returned. See
     'l1ce.object' and 'l1celist.object' for details.

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

     Osborne, M.R., Presnell, B. and Turlach, B.A. (2000) On the LASSO
     and its Dual, _Journal of Computational and Graphical Statistics_
     *9*(2), 319-337.

     Tibshirani, R. (1996) Regression shrinkage and selection via the
     lasso, _Journal of the Royal Statistical Society, Series B_
     *58*(1), 267-288.

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

     data(Iowa)
     l1c.I <- l1ce(Yield ~ ., Iowa, bound = 10, absolute.t=TRUE)
     l1c.I

     ## The same, printing information in each step:
     l1ce(Yield ~ ., Iowa, bound = 10, trace = TRUE, absolute.t=TRUE)

     data(Prostate)
     l1c.P <- l1ce(lpsa ~ ., Prostate, bound=(1:30)/30)
     length(l1c.P)# 30 l1ce models
     l1c.P # -- MM: too large; should do this in summary(.)!


     plot(resid(l1c.I) ~ fitted(l1c.I))
     abline(h = 0, lty = 3, lwd = .2)

