Skip to content

ecodist (MRM) error message

5 messages · Sarah Goslee, Alfredo

#
Hi Everyone,

MRM is returning what seems to be a matrix singularity error: 

Error in solve.default(XX) : 
  system is computationally singular: reciprocal condition number =
1.88323e-86

when running MRM(Dy~exp(Dx)). 

I would appreciate it if anyone could help me around this.

Thanks,

A

--
View this message in context: http://r-sig-ecology.471788.n2.nabble.com/ecodist-MRM-error-message-tp6170910p6170910.html
Sent from the r-sig-ecology mailing list archive at Nabble.com.
#
Alfredo,

I'd be happy to try to help, but need rather more information.
What version of R, ecodist? What OS?

What do your data look like - str() is very helpful in this regard,
or possibly summary(as.vector(Dx)) and summary(as.vector(Dy)).
What are Dx and Dy? How were the dissimilarities calculated?

Can you provide a reproducible example so that I can see the error
for myself?

With only what you have provided here, there's nothing I or anyone else
can do to assist you.

Sarah
On Mon, Mar 14, 2011 at 6:08 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
[1] 0.06700782 0.08376230 0.09909706 0.12461558 0.14438454 0.06081251
  [7] 0.07148765 0.12363789 0.11589077 0.17594412 0.23683629 0.20668179
 [13] 0.13095731 0.16297324 0.13696261 0.14601568 0.20881977 0.14832791
 [19] 0.17773578 0.17901283 0.25579823 0.33966925 0.19422022 0.08303545
 [25] 0.07909383 0.14990078 0.15595243 0.09204931 0.08683072 0.11779759
 [31] 0.12444775 0.16406134 0.25084616 0.22665500 0.15704370 0.16780219
 [37] 0.14767869 0.14192482 0.22739584 0.15541371 0.13306881 0.17721980
 [43] 0.26714896 0.28449197 0.20127940 0.08083726 0.10962154 0.11345836
 [49] 0.07954765 0.06127723 0.14011358 0.12030707 0.14353869 0.20578010
 [55] 0.18541670 0.13782273 0.11022268 0.11764977 0.14781207 0.18777078
 [61] 0.11485322 0.14577802 0.15492318 0.22155020 0.31315450 0.15588707
 [67] 0.14414003 0.14247672 0.10155890 0.08317417 0.14763451 0.14792530
 [73] 0.14875964 0.20888002 0.17465407 0.13602950 0.13308165 0.12874080
 [79] 0.15034760 0.18140344 0.10823317 0.11705517 0.16173102 0.21262619
 [85] 0.27832472 0.15928755 0.06876770 0.13076783 0.09455192 0.17209052
 [91] 0.14840100 0.12422850 0.19023886 0.16950682 0.18101891 0.15449655
 [97] 0.15209334 0.16504904 0.19194634 0.13262124 0.16472254 0.17541841
[103] 0.23131761 0.31423360 0.14329032 0.11754625 0.09363360 0.18596449
[109] 0.14963883 0.14267731 0.19752469 0.18053717 0.16634437 0.14120062
[115] 0.14349948 0.17639152 0.19656690 0.14510724 0.16015122 0.17586870
[121] 0.22992404 0.26821391 0.14866853 0.06778119 0.10217397 0.08147583
[127] 0.13426895 0.17988601 0.17827445 0.08544477 0.12235510 0.10401747
[133] 0.10498380 0.18320970 0.11387430 0.14546688 0.14947183 0.19424262
[139] 0.30280431 0.14408871 0.12761382 0.11501332 0.11369858 0.18716134
[145] 0.16889755 0.12830243 0.12314921 0.10082947 0.12568844 0.16733396
[151] 0.09694770 0.11431960 0.14356895 0.21846974 0.30084684 0.13508708
[157] 0.04222194 0.09948040 0.21147397 0.17194458 0.12665215 0.13520422
[163] 0.13895700 0.08458339 0.19295051 0.14138126 0.13299794 0.14416027
[169] 0.23637788 0.29302635 0.17505158 0.07860891 0.19118050 0.15639354
[175] 0.11852640 0.11506420 0.12073787 0.07966940 0.18364503 0.13145598
[181] 0.14392055 0.15298438 0.21619575 0.29808153 0.15443375 0.11906375
[187] 0.12847290 0.12501444 0.10072444 0.10618654 0.06222056 0.14916935
[193] 0.08697711 0.10846572 0.14039835 0.16833996 0.28827410 0.09394061
[199] 0.12784852 0.13242015 0.11873356 0.12215396 0.14279656 0.11375601
[205] 0.12055113 0.13534332 0.12662213 0.07651950 0.26956270 0.07759475
[211] 0.14816469 0.09668246 0.12734489 0.12874116 0.07493926 0.11475184
[217] 0.13662820 0.09040167 0.11918906 0.25222106 0.09877668 0.11503860
[223] 0.09299715 0.09932252 0.15445820 0.09835570 0.13162197 0.12087659
[229] 0.15259950 0.30820412 0.12573894 0.05650551 0.09907881 0.12120693
[235] 0.08287615 0.10787729 0.07209802 0.14482351 0.26734141 0.08675368
[241] 0.10114104 0.12447440 0.07961229 0.08423764 0.08955118 0.16254741
[247] 0.28158102 0.08205883 0.13811524 0.07944738 0.12494488 0.12517100
[253] 0.16335532 0.28385888 0.11370302 0.10488326 0.11913666 0.10728133
[259] 0.10919732 0.22440659 0.11069469 0.07939423 0.09213015 0.12276458
[265] 0.27271430 0.06930216 0.07808054 0.15932098 0.22047097 0.10176994
[271] 0.12213696 0.23325491 0.09323771 0.22493665 0.08676381 0.25084021
Error in solve.default(XX) : 
  system is computationally singular: reciprocal condition number =
1.88323e-86

--
View this message in context: http://r-sig-ecology.471788.n2.nabble.com/ecodist-MRM-error-message-tp6170910p6173425.html
Sent from the r-sig-ecology mailing list archive at Nabble.com.
#
Alfredo,

The regression algorithm used in MRM chokes on exp(Dx)
because of the rather extreme range:
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:
[...]
---
Sarah Goslee
http://www.functionaldiversity.org
#
Sarah,

I don't think I've got the programming skills at the moment to contribute a
patch, but I'll keep it mind for the future. Thanks for the "log()"
reminder. It could definitely be tragic to confuse bases.

Best wishes,

A

--
View this message in context: http://r-sig-ecology.471788.n2.nabble.com/ecodist-MRM-error-message-tp6170910p6174551.html
Sent from the r-sig-ecology mailing list archive at Nabble.com.