[R-sig-eco] ecodist (MRM) error message

Sarah Goslee sarah.goslee at gmail.com
Tue Mar 15 17:47:37 CET 2011


Alfredo,

The regression algorithm used in MRM chokes on exp(Dx)
because of the rather extreme range:
> summary(exp(Dx))
     Min.   1st Qu.    Median      Mean   3rd Qu.      Max.
1.000e+00 2.000e+01 1.319e+09 2.209e+42 9.254e+29 2.688e+43

Fixing the problem would require rewriting MRM with a
more robust regression method. I don't have the time right now,
but if you are interested I'd welcome a patch.

I'm glad you've found a work-around for your data, but if you
back-transform your coefficients don't forget that log() is natural
log by default.

Sarah

On Tue, Mar 15, 2011 at 12:33 PM, Alfredo Tello <alfredotello at gmail.com> wrote:
> Hi Sarah,
>
> Thanks for your reply. I've solved the problem (or at least gotten around
> it). Dy is a Bray-Curtis dissimilarity matrix and Dx a euclidean matrix
> representing an environmental gradient. I was running MRM as:
> MRM(Dy~exp(Dx)). If I run MRM(log(Dy)~Dx) I don't get the error message.
> Should have thought about it before. I have provided the information you
> asked for below in case this is something you might want to check (I'd be
> interested in hearing back if you do). Thanks for your good disposition to
> help!
>
> R v.2.11.1
> ecodist v.1.2.2
> OS MacOSX v.10.6.6
>
> summary(as.vector(Dx)):
> Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
>   0.00    3.00   21.00   34.61   69.00  100.00
> summary(as.vector(Dy)):
> Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
> 0.04222 0.11010 0.13800 0.14760 0.17480 0.33970
>
>>X<-rep(c(100,31,3,10,1,0),c(4,4,4,4,4,4))
>>Dx<-vegdist(X,"euclidean")
>
>>as.numeric(Dy)
>  [1] 0.06700782 0.08376230 0.09909706 0.12461558 0.14438454 0.06081251
[...]


>>MRM(Dy~exp(Dx))
> Error in solve.default(XX) :
>  system is computationally singular: reciprocal condition number =
> 1.88323e-86
>




---
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-sig-ecology mailing list