Dear all,
many thanks to Jon & Ravi for their help on this, and apologies if
r-help would have been a more appropriate forum.
On Tue, 2012-12-11 at 15:43 +, Jon Clayden wrote:
> Strategy 1: Some code like this:
>if (det(X) < epsilon) {
> warning("Near singular
I am not sure that this query is appropriate for r-devel, it seems to be more
appropriate for r-help.
In any case, you might want to try MASS::ginv instead of solve(), if you
expect ill-conditioning. Here is one possible solution:
f <- function(X) {
invX <- tryCatch(ginv(X,
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
sol