Re: [Rd] Catching errors from solve() with near-singular matrices

From: Jon Clayden <jon.clayden_at_gmail.com>
Date: Tue, 11 Dec 2012 15:43:27 +0000

Dear David,

I can think of two strategies for dealing with this problem:
>
> Strategy 1: Some code like this:
> if (det(X) < epsilon) {
> warning("Near singular matrix")
> return(NULL)
> }
> return(solve(X))

This solution is probably the easiest one to take, but to match solve.default, the test should be

  if (rcond(X) < .Machine$double.eps)

Catching that case should avoid the error. I hope this helps.

All the best,
Jon

        [[alternative HTML version deleted]]



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 12 Dec 2012 - 06:38:59 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 12 Dec 2012 - 18:42:50 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive