markovmodel / PyEMMA

🚂 Python API for Emma's Markov Model Algorithms 🚂
http://pyemma.org
GNU Lesser General Public License v3.0
311 stars 118 forks source link

Chapman-Kolmogorov fails for analysis on largest connected set #431

Closed nsplattner closed 9 years ago

nsplattner commented 9 years ago

The function cktest() in msm.bayesian_markov_model fails if applied to a model where not all states are in the largest connected set. (Tested on Trypsin/Benzamidine data) The error message is something like 'index XXX is out of bounds for axis 1 with size YYY'

franknoe commented 9 years ago

thanks. I will look at this.

Am 20/07/15 um 18:12 schrieb nsplattner:

The function cktest() in msm.bayesian_markov_model fails if applied to a model where not all states are in the largest connected set. (Tested on Trypsin/Benzamidine data) The error message is something like 'index XXX is out of bounds for axis 1 with size YYY'

— Reply to this email directly or view it on GitHub https://github.com/markovmodel/PyEMMA/issues/431.


Prof. Dr. Frank Noe Head of Computational Molecular Biology group Freie Universitaet Berlin

Phone: (+49) (0)30 838 75354 Web: research.franknoe.de

Mail: Arnimallee 6, 14195 Berlin, Germany

franknoe commented 9 years ago

can you please post the full python exception?

Am 20/07/15 um 18:12 schrieb nsplattner:

The function cktest() in msm.bayesian_markov_model fails if applied to a model where not all states are in the largest connected set. (Tested on Trypsin/Benzamidine data) The error message is something like 'index XXX is out of bounds for axis 1 with size YYY'

— Reply to this email directly or view it on GitHub https://github.com/markovmodel/PyEMMA/issues/431.


Prof. Dr. Frank Noe Head of Computational Molecular Biology group Freie Universitaet Berlin

Phone: (+49) (0)30 838 75354 Web: research.franknoe.de

Mail: Arnimallee 6, 14195 Berlin, Germany

nsplattner commented 9 years ago

Here the full exception:

----> 2 cktest = M.cktest(4)
      3 mpl.plot_cktest(cktest);

/storage/mi/nplattner/miniconda/envs/PyE-devR/lib/python2.7/site-packages/pyemma/msm/estimators/maximum_likelihood_msm.pyc in cktest(self, nsets, memberships, mlags)
    251             self.pcca(nsets)
    252             memberships = self.metastable_memberships
--> 253         ck = ChapmanKolmogorovValidator(self, self, memberships, mlags=mlags)
    254         ck.estimate(self._dtrajs_full)
    255         return ck

/storage/mi/nplattner/miniconda/envs/PyE-devR/lib/python2.7/site-packages/pyemma/msm/estimators/lagged_model_validators.pyc in __init__(self, model, estimator, memberships, mlags, conf, err_est)
    314         self.active_set = types.ensure_ndarray(np.array(estimator.active_set), kind='i')  # create a copy
    315         self._full2active = np.zeros(self.nstates, dtype=int)
--> 316         self._full2active[self.active_set] = np.arange(self.nstates)
    317         # define starting distribution
    318         self.P0 = memberships * model.stationary_distribution[:, None]

IndexError: index 271 is out of bounds for axis 1 with size 271
franknoe commented 9 years ago

thanks!

Am 21/07/15 um 17:36 schrieb nsplattner:

Here the full exception:

----> 2 cktest = M.cktest(4) 3 mpl.plot_cktest(cktest);

/storage/mi/nplattner/miniconda/envs/PyE-devR/lib/python2.7/site-packages/pyemma/msm/estimators/maximum_likelihood_msm.pyc in cktest(self, nsets, memberships, mlags) 251 self.pcca(nsets) 252 memberships = self.metastable_memberships --> 253 ck = ChapmanKolmogorovValidator(self, self, memberships, mlags=mlags) 254 ck.estimate(self._dtrajs_full) 255 return ck

/storage/mi/nplattner/miniconda/envs/PyE-devR/lib/python2.7/site-packages/pyemma/msm/estimators/lagged_model_validators.pyc in init(self, model, estimator, memberships, mlags, conf, err_est) 314 self.active_set = types.ensure_ndarray(np.array(estimator.active_set), kind='i') # create a copy 315 self._full2active = np.zeros(self.nstates, dtype=int) --> 316 self._full2active[self.active_set] = np.arange(self.nstates) 317 # define starting distribution 318 self.P0 = memberships * model.stationary_distribution[:, None]

IndexError: index 271 is out of bounds for axis 1 with size 271

— Reply to this email directly or view it on GitHub https://github.com/markovmodel/PyEMMA/issues/431#issuecomment-123374885.


Prof. Dr. Frank Noe Head of Computational Molecular Biology group Freie Universitaet Berlin

Phone: (+49) (0)30 838 75354 Web: research.franknoe.de

Mail: Arnimallee 6, 14195 Berlin, Germany

franknoe commented 9 years ago

I think I have fixed this now in dev_release_1.3. Please try.

nsplattner commented 9 years ago

Now it works! :-)

franknoe commented 9 years ago

great! thanks.

Am 23/07/15 um 10:43 schrieb nsplattner:

Now it works! :-)

— Reply to this email directly or view it on GitHub https://github.com/markovmodel/PyEMMA/issues/431#issuecomment-124023435.


Prof. Dr. Frank Noe Head of Computational Molecular Biology group Freie Universitaet Berlin

Phone: (+49) (0)30 838 75354 Web: research.franknoe.de

Mail: Arnimallee 6, 14195 Berlin, Germany