[R] SparseM and Stepwise Problem

roger koenker roger at ysidro.econ.uiuc.edu
Wed Jan 31 03:05:34 CET 2007


One simple possibility  -- if you can generate the X matrix in dense  
form is
the coercion

	X <- as.matrix.csr(X)

Unfortunately, there is no current way to go from a formula to a  
sparse X
matrix  without  passing through a dense version of X first.   
Otherwise you
need to use new() to define the X matrix directly.  This is usually  
not that
difficult, but it depends on the model....



url:    www.econ.uiuc.edu/~roger                Roger Koenker
email   rkoenker at uiuc.edu                       Department of Economics
vox:    217-333-4558                            University of Illinois
fax:    217-244-6678                            Champaign, IL 61820


On Jan 30, 2007, at 5:31 PM, davidkat at davidkatzconsulting.com wrote:

> I'm trying to use stepAIC on sparse matrices, and I need some help.
> The documentation for slm.fit suggests:
> slm.fit and slm.wfit call slm.fit.csr to do Cholesky decomposition  
> and then
> backsolve to obtain the least squares estimated coefficients. These  
> functions can be
> called directly if the user is willing to specify the design matrix  
> in matrix.csr form.
> This is often advantageous in large problems to reduce memory  
> requirements.
> I need some help or a reference that will show how to create the  
> design matrix from
> data in matrix.csr form.
> Thanks for any help.
>
>
> -- 
> David Katz
>  www.davidkatzconsulting.com
>    541 482-1137
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting- 
> guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list