Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common infrastructure for constrained ordination #218

Closed
jarioksa opened this issue Nov 29, 2016 · 1 comment
Closed

common infrastructure for constrained ordination #218

jarioksa opened this issue Nov 29, 2016 · 1 comment
Assignees
Milestone

Comments

@jarioksa
Copy link
Contributor

I have now implemented a first sweep on basing all constrained ordination methods in shared code. The major merges to master are

The general idea is that all these functions (cca, rda, capscale and dbrda) are very similar with the following major differences:

  1. Inertia is defined and data are initialized in different ways. In rda the inertia is variance or standardized variances (correlations), in cca inertia is derived from Chi-square and data are double-standardized, in dbrda inertia is based on squared dissimilarities and dissimilarity data are Gower double-centred, and in capscale the dissimilarities are mapped onto Euclidean coordinates and analysed like in rda.

  2. cca is double-standardized and we need to handle row and column weights unlike in other methods.

  3. dbrda is based on eigen decomposition of symmetric data, but other methods on singular value decomposition of rectangular data.

  4. 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, CCA and CA to Partial, Constrained and Unconstrained like @gavinsimpson suggested in issue #207.

There may be still opportunity to clean up. Currently the final result objects are built with separate layers:

  1. ordConstrained builds and returns the basic ordination structure.
  2. ordConstrained is called by old functions and these add items to the data: information of NA handling, missing species, centroids of factor variables if formula interface was used etc. The man/cca.object.Rd files still looks unnecessarily complicated, and several of its items are not derived from ordConstrained.

Currently ordConstrained is exported, and it could be used by a knowledgeable user in the same way as lm.fit can be used instead of lm (please read ?lm.fit to see the difference). I don't know if ordConstrained should be visible or made non-exported function. That is open to discussion.

@jarioksa
Copy link
Contributor Author

Discussion in issue #100 is relevant here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant