choderalab / pymbar-examples

Examples of applications of pymbar to various problems in simulation and experiment
16 stars 22 forks source link

pymbar and high/infinity energies #22

Open halx opened 8 years ago

halx commented 8 years ago

Hi,

I am using pymbar through David Mobley's alchemical-analysis tool. I want to do BAR/MBAR analysis with AMBER. Strangely, AMBER will occasionally output very high energies, sometimes not even displaying the values anymore (Fortran all '*' output), for estimates for 'far-away" lambdas.

Anyway, I am wondering what pymbar does with high energies or 'Inf' values. I have tried to filter those out and compare with passing those values to pymbar. It seems that the results are the same. So, what does really happen?

Many thanks, Hannes.

jchodera commented 8 years ago

Excellent question. I'm not sure inputs containing inf have been rigorously tested in pymbar 3.x, but in principle, there is no problem with the mathematics because we are always working with the quantity exp[-u], which is 0 when this occurs.

The safest thing to do right now is to replace occurrences of inf with some energy that is larger than the most negative energy by some reasonable amount---say, 1000 kT. That will ensure there are no numerical issues int he resulting computation.

In the meantime, I will make a note to add some unit tests with inf energies.

jchodera commented 8 years ago

Whoops---this should not go in this issue tracker, but rather here:

https://github.com/choderalab/pymbar/issues

halx commented 8 years ago

Sorry, for asking this on the wrong tracker.

I guess the exp[-u] sort this out just fine. I will modify the AMBER parser to let these values pass through and probably also change 'Inf' to something 'high'.

On 10 December 2015 at 15:01, John Chodera notifications@github.com wrote:

Excellent question. I'm not sure inputs containing inf have been rigorously tested in pymbar 3.x, but in principle, there is no problem with the mathematics because we are always working with the quantity exp[-u], which is 0 when this occurs.

The safest thing to do right now is to replace occurrences of inf with some energy that is larger than the most negative energy by some reasonable amount---say, 1000 kT. That will ensure there are no numerical issues int he resulting computation.

In the meantime, I will make a note to add some unit tests with inf energies.

— Reply to this email directly or view it on GitHub https://github.com/choderalab/pymbar-examples/issues/22#issuecomment-163651351 .