[R-sig-eco] order of explanatory variables in vegan CCA

Gregory, Matthew matt.gregory at oregonstate.edu
Thu Dec 29 21:15:50 CET 2011


Hi Jari and Gavin,

Jari Oksanen wrote:
> I've seen this before, and I think this can be difficult to handle in
> vegan: The problem is not in vegan, and it is not in R, but it is in
> LAPACK library. When I last had this problem, I hacked the vegan code
> and ran svd() within cca/rda with option LINPACK = TRUE. This helped me
> to get around the problem.
> 
> I think that LAPACK DGESDD error code 1 tries to tell in a cryptic way
> that the convergence failed. It is surprising to hear that reordering
> data helped here. Looks like DGESDD failed in pivoting the data when it
> should have done so. Are the variables very differently scaled? Vegan
> does not scale explanatory variables in cca/rda/capscale, but you could
> try if manual scaling helps here. If scaling helps, then we could re-
> consider scaling of constraints within cca/rda as a safe option.
> However, that would break at least predict(..., newdata=) and probably
> something else and cannot be done light-heartedly.

Thank you both for your help.  I've sent Gavin sample data and a script to see if he can replicate the issue.

Yes, the explanatory variables are somewhat differently scaled (I was under the naïve assumption that cca does an internal rescaling of the constraints).  If I do a simple

  env <- scale(env) 

before running cca, then both ways of ordering the constraints run to completion with identical results.  Thanks for the very helpful suggestion.  

I won't presume to understand all that is involved with making this change to the codebase in 'safe' mode.  I do understand that I have a work-around in case I receive this error message again.

thanks, matt



More information about the R-sig-ecology mailing list