[R-sig-eco] cross validation in CoCA and CCA

Gavin Simpson ucfagls at gmail.com
Wed Apr 2 21:47:44 CEST 2014


The only wrinkle might be the PLS toolbox - not knowing octave I don't
know if the PLS codes for it match with the commercial PLS toolbox
used by the matlab code in the ESA Archive bundle relating to the
paper.

If I recall correctly, everything is in cocorresp to allow you to
write the loops shown in the example matlab file using R code. Some
functions may be hidden, I doubt I want the mean centring functions
and the individual crossval functions exported, but you can access
them via cocorresp:::

G

On 1 April 2014 15:23, Martin Weiser <weiser2 at natur.cuni.cz> wrote:
> Besides, one can use (I hope) GNU Octave (free, libre, opensource) to do
> it with the original MatLab code, as Octave is compatible with MatLab.
> HTH.
> Martin
>
>  Gavin Simpson píše v Pá 28. 03. 2014 v 20:44 -0600:
>> In short, no. I haven't ported the rough code for LOO CV of CCA or
>> CCA-PLS models. I think I ported the mean centring and crossval
>> functions from the Matlab sources, but not the code in the
>> `example_crossvalCCA.m` file from the supplementary materials on the
>> CoCA paper in Ecology.
>>
>> I could take a look and see how easy i will be to add this, but it
>> doesn't sit well with cocorresp or vegan as the former was designed
>> really for CoCA and the latter doesn't have the other functionality
>> needed (which exists in cocorresp) and we've not really implemented CV
>> for ordination methods.
>>
>> That said, this is R and it is relatively trivial to write your own
>> LOO or k-fold CV loop, and you can predict from a CCA model using the
>> `predict()` method for cca objects available in vegan.
>>
>> Part of the reason, at least as far as I see things, for not having CV
>> in the common ordination software (closed or open source) is that
>> these methods tend not to be seen as purely predictive models, which
>> is what CV is designed to evaluate.
>>
>> Don't hold your breath for me getting this in cocorresp, but if you
>> want to follow up I might be persuaded to take a look and see if what
>> is already in cocorresp will enable you to follow the code in the
>> `example_crosvalCCA.m` file to write your own LOO code.
>>
>> HTH
>>
>> G
>>
>> On 28 March 2014 14:57, Jesse Becker <jcbecker42 at gmail.com> wrote:
>> > Hello list,
>> > I am doing a concordance study between riverine environmental conditions,
>> > invertebrate, and fish assemblages.  I am doing a predictive CoCA as part
>> > of the analysis with the cocorresp package.  My question is whether there
>> > is an implementation of the cross-validation procedure in the cocorresp
>> > package that would work on the results of a CCA or RDA, without having to
>> > use MATLAB (which I don't have access to)?  My understanding is that by
>> > doing the cross validation on the CCA (and hopefully RDA, although I've
>> > never seen it done) it allows for a more consistent evaluation of
>> > differences between the two methods.  I haven't seen this as a function in
>> > vegan.
>> >
>> > Jari?  Gavin?
>> >
>> > Thanks,
>> > Jesse
>> >
>> >
>> > Jesse C. Becker, Ph.D.
>> > 765.285.8889765.285.8889 office
>> > 512.587.4428512.587.4428 cell
>> > jcbecker at bsu.edu
>> > jcbecker42 at gmail.com
>> >
>> > Call
>> > Send SMS
>> > Add to Skype
>> > You'll need Skype CreditFree via SkypeI am
>> >
>> >         [[alternative HTML version deleted]]
>> >
>> > _______________________________________________
>> > R-sig-ecology mailing list
>> > R-sig-ecology at r-project.org
>> > https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>>
>>
>>
>
>
>
>
> --
>
> ------------------------------
> Pokud je tento e-mail součástí obchodního jednání, Přírodovědecká fakulta
> Univerzity Karlovy v Praze:
> a) si vyhrazuje právo jednání kdykoliv ukončit a to i bez uvedení důvodu,
> b) stanovuje, že smlouva musí mít písemnou formu,
> c) vylučuje přijetí nabídky s dodatkem či odchylkou,
> d) stanovuje, že smlouva je uzavřena teprve výslovným dosažením shody na
> všech náležitostech smlouvy.



-- 
Gavin Simpson, PhD



More information about the R-sig-ecology mailing list