[Rd] small bug in gl1ce, package lasso2 (PR#8279)

From: <izmirlig_at_mail.nih.gov>
Date: Fri 04 Nov 2005 - 00:10:14 GMT


Full_Name: Grant Izmirlian
Version: 2.2.0
OS: SuSe Linux version 9.2
Submission from: (NULL) (156.40.34.177)

The option exists to include all parameters, including the intercept, in the L-1 constraint, by specifying the argument, sweep.out=NULL, explicitly in the call. However, upon doing this, the function stops with an error report "Matrix build from transformed variables has a constant column"

I was able to fix it as follows. In the following line, taken from the same block of code producing the stop error, modify the existing line from

      X.to.C.stds <- sqrt(apply(X.to.C.w, 2, var))

to

      X.to.C.stds <- ifelse(con.int, 
                            c(1,sqrt(apply(X.to.C.w[,-is.null(sweep.out)], 2,
var))), 
                                sqrt(apply(X.to.C.w,2,var)))

That should work.



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri Nov 04 11:14:24 2005

This archive was generated by hypermail 2.1.8 : Fri 04 Nov 2005 - 02:22:14 GMT