Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
common infrastructure for constrained ordination #218
Comments
jarioksa
self-assigned this
Dec 9, 2016
jarioksa
added the
request-for-comments
label
Dec 30, 2016
|
Discussion in issue #100 is relevant here. |
jarioksa
added this to the
2.5-0
milestone
May 17, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jarioksa commentedNov 29, 2016
I have now implemented a first sweep on basing all constrained ordination methods in shared code. The major merges to master are
ordConstrainedinfrastructureccarda, first steprda, second step + support functionscapscaledbrdaand downgrading ofcapscale(issue #217)The general idea is that all these functions (
cca,rda,capscaleanddbrda) are very similar with the following major differences:Inertia is defined and data are initialized in different ways. In
rdathe inertia is variance or standardized variances (correlations), inccainertia is derived from Chi-square and data are double-standardized, indbrdainertia is based on squared dissimilarities and dissimilarity data are Gower double-centred, and incapscalethe dissimilarities are mapped onto Euclidean coordinates and analysed like inrda.ccais double-standardized and we need to handle row and column weights unlike in other methods.dbrdais based on eigen decomposition of symmetric data, but other methods on singular value decomposition of rectangular data.There are no other differences.
The new functions should appear nearly unchanged to the user. There is one known issue that has not be implemented yet: handling of zero-rank components. However, possible new problems only crop out in use. I hope many people haven on opportunity to try and tease these new functions to fix the problems prior the CRAN release.
The new infrastructure is cleaner, more consistent among methods and more easily maintained (it is also somewhat faster for some methods). It is also more easily extended to new analyses. It would also be very simple to change the name of the ordination components from
pCCA,CCAandCAtoPartial,ConstrainedandUnconstrainedlike @gavinsimpson suggested in issue #207.There may be still opportunity to clean up. Currently the final result objects are built with separate layers:
ordConstrainedbuilds and returns the basic ordination structure.ordConstrainedis called by old functions and these add items to the data: information ofNAhandling, missing species, centroids of factor variables if formula interface was used etc. Theman/cca.object.Rdfiles still looks unnecessarily complicated, and several of its items are not derived fromordConstrained.Currently
ordConstrainedis exported, and it could be used by a knowledgeable user in the same way aslm.fitcan be used instead oflm(please read?lm.fitto see the difference). I don't know ifordConstrainedshould be visible or made non-exported function. That is open to discussion.