-
Notifications
You must be signed in to change notification settings - Fork 1
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
EQA equations in compareToStateEnvelope() #3
Comments
Dear Jim, Thanks for your issue. You are totally right! There is a mistake in the paper and 1/2 should be removed from eqs. 3, 4 and 5. The mistake arised because, while eqs. 1 and 2 are correct in the paper, our implementation of VarE in ecotraj was doing the summation of all d_ij^2 elements whereas the equations indicates summation over the upper (or lower) triangle of the squared distance matrix. Thus, our estimation of VarE in the code was doubled and I divided by 2 in its application to estimate d2E. The net effect is that d2E is correctly estimated in ecotraj, but not VarE, and the equations 3, 4 and 5 should be corrected. We will have to send a correction. I will double check all this, but I am quite sure that this is the problem. Thanks again, |
Hi Miquel, Thanks for checking this, I'm glad I wasn't just misunderstanding something and appreciate your commitment to sending a correction over. I did suspect whether it was something to do with double-counting in the original distance matrix. That'd make complete sense and easy to miss. Looking at the code in
Can show this in a quick example
I think then when
If this is the case, I think your estimates of All the best, |
Hi Jim, I corrected the code in functions We will have to submit a corrigendum to the journal at some point, to inform about the mistakes in equations. Best wishes, |
Hello,
I am interested in applying the EQA framework to some data, however I have some questions regarding the equations, specifically this part of the
compareToStateEnvelope()
The bit I am specifically stuck with is why we subtract 0.5 of var_env. I have worked through the paper here (https://esajournals.onlinelibrary.wiley.com/doi/10.1002/ecs2.4726) to try and understand why D2E is derived this way, however I am still not sure. The paper makes a specific statement that seems to contradict the equation in its current form, it states:
'u(y, E) = 0.5 whenever D(y, E)2 = Var(E) meaning that the squared distance between the assessed ecosystem and (the centroid of) the reference envelope is equal to the average, across reference states, of the same squared distance.'
This implies that D2E == the squared distance of an ecological state to the reference envelope centroid. However, we can put together a 2D reprex to show that this isn't the case. Following the equation for D2E, D2E != the squared distance to the reference/target envelope, it is always out by a factor of 0.5 x var_env, which implies we should be subtracting var_env rather than 0.5 x var_env. Using the current equation for D2E, we can see that an ecological state within the reference envelope (m3 in the reprex), gets a value for D2E that is greater than Var(E), in contradiction to the statement highlighted above.
A simpler way to think about it is to imagine y is an ecological state located at the reference envelope centroid. By definition, if D2E == the squared distance of y to reference centroid, D2E must be 0 when y is at the centroid. However the current equation for D2E returns a value of 0.5*var_env.
It is possible that I am missing something here, I couldn't actually find any reasoning in the paper for why the equation foe D2E is what it is, as it is not mentioned in the citation included for Legendre & De Cáceres 2013 (as far as I could tell). There therefore may be a good reason for subtracting 0.5*var_env instead of var_env. However, given the written statements for what D2E represents and the goals of the general framework, the current D2E calculation seems incorrect. The consequence for this is that the current equations overestimate the distance of ecological conditions to the reference envelope, and so they receive lower Q values. Please see the reprex below, happy to chat more about this and I apologise in advance if there is a good reason for the current formulation.
The text was updated successfully, but these errors were encountered: