gl1ce                 package:lasso2                 R Documentation

_G_e_n_e_r_a_l_i_z_e_d _R_e_g_r_e_s_s_i_o_n _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:

     Fit a generalized regression problem while imposing an L1
     constraint on the parameters.  Returns an object of class 'gl1ce'.

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

     gl1ce(formula, data = sys.parent(), weights, subset, na.action,
           family = gaussian, control = glm.control(...), sweep.out = ~ 1,
           x = FALSE, y = TRUE, contrasts = NULL, standardize = TRUE,
           guess.constrained.coefficients = double(p), bound = 0.5, ...)
     ## S3 method for class 'gl1ce':
     family(object, ...)

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

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

    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 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 be 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. 

  family: a 'family' object - a list of functions and expressions for
          defining the link and variance functions, initialization and
          iterative weights.  Families supported are gaussian,
          binomial, poisson, Gamma, inverse.gaussian and quasi.
          Functions like binomial produce a family object, but can be
          given without the parentheses.  Family functions can take
          arguments, as in 'binomial(link=probit)'. 

 control: a list of iteration and algorithmic  constants.  See
          glm.control for their names and default values.  These can
          also be set as arguments to gl1ce itself. 

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 flag: if 'TRUE', the model matrix is returned in
          component 'x'. 

       y: logical flag: if 'TRUE', the response is 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 empirical variance one.  The
          standardization is done after taking possible weights into
          account and after sweeping out variables whose parameters are
          not constrained. 

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.

     ...: potential arguments for 'glm.control', as default for the
          'control' argument above.

  object: an R object of class '"gl1ce"'.

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

     an object of class 'gl1ce' is returned by 'gl1ce()'. See
     'gl1ce.object' for details.

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

     See the references in 'l1ce'.

     Justin Lokhorst (1999). The LASSO and Generalised Linear Models,
     Honors Project, Nov.1999, Dept.Statist., Univ. of Adelaide.
     Available as file 'Doc/justin.lokhorst.ps.gz' in both shar files
     from <URL:
     http://www.maths.uwa.edu.au/~berwin/software/lasso.html>.

_S_e_e _A_l_s_o:

     'glm' for unconstrained generalized regression modeling.

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

     ## example from base:
     data(esoph)
     summary(esoph)
     ## effects of alcohol, tobacco and interaction, age-adjusted
     modEso <- formula(cbind(ncases, ncontrols) ~ agegp + tobgp * alcgp)
     glm.E   <- glm(modEso, data = esoph, family = binomial())
     gl1c.E <- gl1ce(modEso, data = esoph, family = binomial())
     gl1c.E
     plot(residuals(gl1c.E) ~ fitted(gl1c.E))

     sg1c <- summary(gl1c.E)
     sg1c

     ## Another comparison  glm() / gl1c.E:
     plot(predict(glm.E,  type="link"), predict(glm.E,  type="response"),
          xlim = c(-3,0))
     points(predict(gl1c.E, type="link"), predict(gl1c.E, type="response"),
            col = 2, cex = 1.5)

     labels(gl1c.E)#-- oops! empty!!

