-
Notifications
You must be signed in to change notification settings - Fork 98
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
likely error in CLR formula in decostand docs #621
Comments
@antagomir Have you looked at this? |
Woops, yes. This we should be able to solve asap. I will have a look today/tomorrow and open a PR. The broader rCLR improvements might take more time. |
I think the issue confused arithmetic and geometric mean, and the documentation is correct. The documentation states that
This is how CLR transformation is formally defined. Log of geometric mean can be written as: Thus, This is also seen with:
I am not sure whether the documentation could/should be improved since it already states that g(x) is the geometric mean, and this is how CLR definition is written in most sources afaik. As far as I can see the documentation is correct and this issue could be closed unless there are further suggestions on how to improve. |
Thanks @antagomir. I've yet to find a solid mnemonic for the order in the CLR transform (hence the OP), but if I've got this correctly: Definition of the CLR (as above): Definition in the Is that not incorrect?... |
Thanks @handibles - yes - that seems incorrect. Looking at the current master branch of the man pages in github:vegandevs/vegan, lines 94-109 (clr documentation) refers to the geometric mean. So at least that manpage seems to be correct. Where did you find that incorrect formula exactly - could you point me to the exact source? I will correct asap if we have a mistake anywhere. But right now I am not able to trace this..! |
Dear Devs,
Thanks as always for the work. I was using
decostand
as a quick look up for the CLR formula, but think it's wrong in the vegan docs.While the code for CLR (
.calc_clr
) is fine - mean of logs :The docs indicate that the formula here is$log(x) - log(u)$ , where $x$ are the beasties and $u$ is the beastie mean, i.e. log of means.
Sadly,
> mean(log(1:10)) == log(mean(1:10))
> [1] FALSE
Might save the next veganner from a mishap. All the best,
CH
The text was updated successfully, but these errors were encountered: