[R] Problem with new(er) R version's matrix package

Martin Maechler maechler at stat.math.ethz.ch
Sat Apr 26 22:00:13 CEST 2014

>>>>> Arne Henningsen <arne.henningsen at gmail.com>
>>>>>     on Sat, 26 Apr 2014 08:15:37 +0200 writes:

    > On 25 April 2014 20:15, David Winsemius
    > <dwinsemius at comcast.net> wrote:
    >> On Apr 25, 2014, at 9:17 AM, Werner W. wrote:
    >>> Dear Rs,
    >>> I am re-executing some older code. It does work in the
    >>> ancient R 2.12.0 which I still have on my PC but with
    >>> the new version R 3.1.0 it does not work any more (but
    >>> some other new stuff, which won't work with 2.12).
    >>> The problem arises in context with the systemfit package
    >>> using the matrix package. In R 3.1.0 the following error
    >>> is thrown: Error in as.matrix(solve(W, tol =
    >>> solvetol)[1:ncol(xMat), 1:ncol(xMat)]) : error in
    >>> evaluating the argument 'x' in selecting a method for
    >>> function 'as.matrix': Error in .solve.sparse.dgC(as(a,
    >>> "dgCMatrix"), b = b, tol = tol) : LU computationally
    >>> singular: ratio of extreme entries in |diag(U)| =
    >>> 7.012e-39
    >>> However, I have no clue what I can do about this. Was
    >>> there some change in the defaults of the matrix package?
    >>> I couldn't find anything apparent in the changelog. As
    >>> the same code works in R 2.12.0, I suppose that the
    >>> problem is not my data.
    >> You have not told us what version of the Matrix package
    >> you were using.  As such I would suggest that you review
    >> the Changelog which is a link for the CRAN page for
    >> pkg:Matrix and go back 4 years or so since R major
    >> versions change about once a year.
    >> http://cran.r-project.org/web/packages/Matrix/ChangeLog

    > In addition, please provide a minimal, self-contained,
    > reproducible example.

Yes, please do.   As maintainer of the Matrix package, I'm
willing to look into the situation of course.

As was mentioned, many things have changed in 4 years.
The error message above looks like you'd want to invert a
(very close to) singular matrix, and there could be quite few
reasons why parts of the older code gave slightly different

Without a reproducible example, we can't get started though.

Best regards,
Martin Maechler, ETH Zurich

More information about the R-help mailing list