choderalab / pymbar

Python implementation of the multistate Bennett acceptance ratio (MBAR)
http://pymbar.readthedocs.io
MIT License
240 stars 93 forks source link

Questions on `compute_expectations` #514

Open gooaah opened 1 year ago

gooaah commented 1 year ago

I have alreadly applied pymbar to umbrella sampling data successfully. Now I'd like to compute the effective mass of CV at the transition state. A function compute_expectations under MBAR can get the expectation of an observable at all states. When all the data is generated by US, can I regard the mu values from this functions as the unbiased expectation at the center of umbrellas? And how to get the expectation of observables when the region of interst doesn't cover the spring center locations?

mrshirts commented 1 year ago

I'm not sure I 100% understand the question, but I'll give pass here. For the expectation of an observable at a state that is not sampled, you will need to pass in the energies at that state as well for all samples. But for umbrella sampling, this should be easy, since you know the potential there.

Check out the examples directory, and particularly harmonic_oscillators examples; there, various observables like <x^2> are calculated both at states that are sampled, and states that are not sampled. The potential of mean force example calculations should do something very much like you want to do as well.

And how to get the expectation of observables when the region of interst doesn't cover the spring center locations?

If these regiouns are close enough to the spring center locations (i.e. high overlap), everything should work out well. If they are too far away, then you will get answers back but the uncertainties will be larger and unreliable; you can use the functions calculating the number of effective samples to test - less than 50 or 100 effective samples means you are probably too far away.

gooaah commented 1 year ago

Thanks for your answer! Maybe my question is a bit confusing and I try to make it clear. As you said, what I want to get is very similar to the potential of mean force. Using notation from the paper J. Chem. Theory Comput. 16, 4107 (2020), the desired "observable depending on CV" is $A'(\xi) = \left \langle A(x_n) \delta (\Phi(x_n) - \xi) \right \rangle$ I already got the potential of mean force from umbrella sampling data. And the observables of all the samples are available. In this case, how to get $A'(\xi)$ by pymbar?