choderalab / pymbar

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

Error in computePMF example #25

Closed trendelkampschroer closed 11 years ago

trendelkampschroer commented 11 years ago

I think I've spotted an error in the examples section of the MBAR.computePMF funcion. But it could also be me geting confused with the indices

>>> from pymbar import oldtestsystems
>>> [x_kn, u_kln, N_k] = oldtestsystems.HarmonicOscillatorsSample(N_k=[100,100,100])
>>> mbar = MBAR(u_kln, N_k)
>>> u_kn = u_kln[0,:,:]

If $u_{kln}=u_l(x_n^{(k)})$ shouldn't it be

>>> u_kn=u_kln[:, 0, :]

in the 3rd line?

In other words don't you use the potential energy at fixed state $l_0$ for data generated at different thermodynamic states $k$ to estimate the pmf at the desired state $l_0$?

jchodera commented 11 years ago

Yes, that's an error, all right!

jchodera commented 11 years ago

@kyleabeauchamp: Can you fix this?

kyleabeauchamp commented 11 years ago

Done