markovmodel / PyEMMA

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

IndexError: index 188 is out of bounds for axis 0 with size 184 #1588

Open vas2201 opened 1 year ago

vas2201 commented 1 year ago

HI ,

I am getting following error, while doing msm analysis, Could you please suggest me how to fix this error ?

Regards Vas


IndexError Traceback (most recent call last) Cell In[39], line 4 1 fig, axes = plt.subplots(1, 2, figsize=(10, 6), sharex=True, sharey=True) 2 pyemma.plots.plot_contour( 3 tica_concatenated[:, :2].T, ----> 4 msm.pi[dtrajs_concatenated], 5 ax=axes[0], 6 mask=True, 7 cbar_label='stationary distribution') 8 pyemma.plots.plot_free_energy( 9 tica_concatenated[:, :2].T, 10 weights=np.concatenate(msm.trajectory_weights()), 11 ax=axes[1], 12 legacy=False, kT=0.6, cbar_label='Free Energy (kcal/mol)') 13 for ax in axes.flat:

IndexError: index 188 is out of bounds for axis 0 with size 184

vas2201 commented 1 year ago

use msm.pi[np.concatenate(msm.dtrajs_active)] instead.

AChatzigoulas commented 1 year ago

Is there a way to keep all microstates? I tried using mincount_connectivity=0 in bayesian_markov_model() but it didn't change anything.

clonker commented 1 year ago

For it to be a valid msm with associated stationary distribution over all states you need regularization or ideally more statistics. It'll currently subselect the largest set of micro states which are still connected. Mincount connectivity in that sense is a misleading name, it means that it there are strictly more than 0 counts it's deemed connected