On 16/01/2013, at 13:50 PM, Duarte Viana wrote:

> Hi Jesse and Gavin,
> 
> I remember that post and I think that turning the argument LINPACK of
> the function "svd" on solved the problem. I did so by:
> 
> 1. pasting the code of function svd (that can be found in the source code
> of the base package) on the console
> 2. changing the argument LINPACK=FALSE to LINPACK=TRUE
> 3. re-assigning the function to the base package with the code:
> assignInNamespace("svd", svd, "base")
> 
> However I do not know whether this is the best solution. Perhaps Gavin
> can find out what the real problem is. I would appreciate if you both
> could keep me informed about any progress.

We have had this problem sometimes in svd in vegan functions (rda, cca), and 
then LINPACK = TRUE has helped. However, this is not a good solution as LINPACK 
is phasing out from R. In the current development version (and probably in the 
next R release later this year), LINPACK is defunct, and this solution won't 
work. 

It seems that the basic problem  is in the svd function of the LAPACK that is 
used as the default now and that will be the only choice later this year. 
LAPACK is an external library that is beyond the control of package developers 
and R core team so that these problems may be unsolvable. It seems that the 
problems with the LAPACK code are so common that even the help page of svd() 
function tells about them:

     Unsuccessful results from the underlying LAPACK code will result
     in an error giving a positive error code (most often ‘1’): these
     can only be interpreted by detailed study of the FORTRAN code but
     mean that the algorithm failed to converge.

Sometimes rescaling of the data (= multiplying with a suitable constant) has 
helped, too, and that may be the only thing we can try once LINPACK = TRUE 
option disappears within a few months.

Best wishes, Jari Oksanen

> 
> On Wed, Jan 16, 2013 at 11:35 AM, Gavin Simpson <gavin.simp...@ucl.ac.uk> 
> wrote:
>> Hi Jesse,
>> 
>> Can you send me the data *and* *exact* code you used so I can look into
>> this further? I promise to delete the data once I have gotten to the
>> bottom of the problem.
>> 
>> If you can, please do so *off list*. If you can't then it might help to
>> scale the numbers a bit as range of 5 orders of magnitude may be causing
>> some numerical issues with your data.
>> 
>> Note this has nothing to do with vegan; cocorresp is a separate package.
>> 
>> Re the last question; it is possible and IIRC there is some Matlab code
>> to do some of this in the supplementary materials for the ter braak &
>> schaffers paper. I got some way to implementing this in R but finishing
>> it off went to the back burner and I never get back to it since.
>> 
>> All the best,
>> 
>> Gavin
>> 
>> On Tue, 2013-01-15 at 19:09 -0800, Jesse_B wrote:
>>> Question 1 - It's been a while, so I don't know who will see this, but I am
>>> having the same issue.  I have count data from two species matrices (fish
>>> and inverts) and I am trying to run CoCA through cocorresp.  Symmetric CoCA
>>> works fine, and is the main thing that I need, but I would like to be able
>>> to switch predictor-response species matrices in a predictive CoCA, to see
>>> if there are differing patterns of top-down/bottom-up concordance.   I have
>>> substantial skew in the data, so I have log+1 transformed both sets of data.
>>> I can run crossval on the raw data (not transformed, 99 samples [33 sites
>>> over 3 seasons], 72 fish species, 226 invert species, individual numbers are
>>> in the same ranges, between 0 and 10K for both fish and inverts), but on the
>>> transformed data, I get the "Error in La.svd(x, nu, nv) : error code 1 from
>>> Lapack routine 'dgesdd' " message consistently on the 5th site.  I am
>>> comfortable _using_ R and the vegan package in particular, but I am not
>>> experienced in more deep coding, so I don't have a handle on how to turn
>>> LINPACK on.  R version 2.15.2, vegan 2.0-4, cocorresp 0.2-0
>>> 
>>>> crossval(fishlog,invertlog)
>>> LOO - Site: 1 - Complete
>>> LOO - Site: 2 - Complete
>>> LOO - Site: 3 - Complete
>>> LOO - Site: 4 - Complete
>>> LOO - Site: 5Error in La.svd(x, nu, nv) : error code 1 from Lapack routine
>>> 'dgesdd'
>>> 
>>> Question 2 - Is it possible to run crossval on matricies for a CCA? to make
>>> it a PLS-CCA (as in Schaffers et al. 2008) or am I misunderstanding the
>>> process that they used?
>>> 
>>> Thanks in advance!
>>> 
>>> Jesse
>>> 
>>> 
>>> 
>>> 
>>> --
>>> View this message in context: 
>>> http://r-sig-ecology.471788.n2.nabble.com/Error-in-La-svd-x-nu-nv-error-code-1-from-Lapack-routine-dgesdd-tp7556369p7577802.html
>>> Sent from the r-sig-ecology mailing list archive at Nabble.com.
>>> 
>>> _______________________________________________
>>> R-sig-ecology mailing list
>>> R-sig-ecology@r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>>> 
>> 
>> --
>> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
>> Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
>> ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
>> Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
>> Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
>> UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
>> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
>> 
>> _______________________________________________
>> R-sig-ecology mailing list
>> R-sig-ecology@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> 
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

-- 
Jari Oksanen, Dept Biology, Univ Oulu, 90014 Finland
jari.oksa...@oulu.fi, Ph. +358 400 408593, http://cc.oulu.fi/~jarioksa

_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

Reply via email to