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

HydrogenBondLifetimes (Autocorrelation) has an increasing value #2247

Open
bieniekmateusz opened this issue Apr 14, 2019 · 4 comments

Comments

@bieniekmateusz
Copy link
Member

commented Apr 14, 2019

The autocorrelation has to be decreasing.

Adjusted test case from the test_waterdynamics.py file:

def test_HydrogenBondLifetimes_growing_continuous(universe):
    # The autocorrelation cannot grow
    hbl = waterdynamics.HydrogenBondLifetimes(
        universe, SELECTION1, SELECTION1, t0=0, tf=9, dtmax=5)
    hbl.run()
    print("results", hbl.timeseries)
    # Index 0 in frameX[0] refers to the continuous, 1 to intermittent
    assert all([frameX[0] > frameXplus1[0] for frameX, frameXplus1 in zip(hbl.timeseries, hbl.timeseries[1:])])

The current autocorrelation code in HydrogenBondLifetimes returns lifetimes that increase over time. We are planning to address this in the next Pull Request with @p-j-smith where we add the test case and use our standalone autocorrelation function.

  • Which version are you using? developing branch
  • Python 2.7
  • Linux Arch

bieniekmateusz added a commit to bieniekmateusz/mdanalysis that referenced this issue Apr 14, 2019

@orbeckst

This comment has been minimized.

Copy link
Member

commented Apr 17, 2019

Are you saying that the calculated ACF must be monotonically decreasing? Not even a little bit of noise allowed?

@bieniekmateusz

This comment has been minimized.

Copy link
Member Author

commented Apr 18, 2019

In the actual experiments I imagine the noise could create this kind of data. However, in the case of continuous ACF this cannot happen. This is because at each point t0, we take our bonds and check if they survive at every step up until a given tau, say tau=t4. If they leave at t3, we do not allow it to return, and so t4 is thrown away (we say it has left). So, by definition, the continuous ACF will be monotonically decreasing.

Now, some implementations of the intermittent ACF could lead to the noise you suggest. In our case, it is not possible: we say that if the molecule leaves only at t3 and returns at t4, with the intermittency=1, then we treat this bond as if it was there at every step from t0 to t4, including at t3. So again, it is not possible for the ACF to increase.

Paul & Mat

@richardjgowers

This comment has been minimized.

Copy link
Member

commented Apr 18, 2019

@bieniekmateusz

This comment has been minimized.

Copy link
Member Author

commented Apr 18, 2019

@richardjgowers The HydrogenBondLifetimes does not do anything extra. We're hoping to finish soon submit the next PR. We're going to add a function to the Richard's HydrogenBond finder to get the autocorrelation directly.

Mat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.