-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to compute any actual quantity of the coarse-grained kinetics with employing the fuzzy memberships? #279
Comments
It most likely means that due to the sampling you have produced a few hmm's who live on different states (or at least not a subset) of the prior's states. I suggest you subselect the samples accordingly. It might even be enough to call |
Thank you very much for your prompt reply! `--------------------------------------------------------------------------- File ~/whshen/anaconda3/envs/workshop/lib/python3.9/site-packages/deeptime/base.py:238, in BayesianModel.evaluate_samples(self, quantity, delimiter, *args, **kwargs) File ~/whshen/anaconda3/envs/workshop/lib/python3.9/site-packages/deeptime/util/stats.py:189, in evaluate_samples(samples, quantity, delimiter, *args, **kwargs) ValueError: Chosen set contains states that are not included in the active set. To add, I use BayesianMSM to calculate MFPT on the same sample data, and I can get the result, but I don't know what is wrong with BayesianHMM. |
Yeah so I looked into and I should have seen it sooner 😆 the transition model is the -coarse grained- space, so when you are looking at "metastable_sets", this is in finegrained space, ie clustering space! now you are asking to compute mfpt over clustering-space states (which there are presumably many more than in coarse grained space), and it rightfully complains about it. Try the following: If you are computing MFPT between coarse-grained set 0 and 1, you can call
This already takes care of the fuzzy state assignment, as you are not operating in fine-grained space. |
By the way! We gave a workshop on deeptime/pyemma a while ago and also covered HMMs there. You can find the corresponding notebook here. Given a few free minutes I'll integrate it into the documentation here, I think. :) https://github.com/markovmodel/pyemma-workshop/blob/master/notebooks/06-hmm.ipynb |
That's right, I understand now, but I have encountered another problem, please ask for your advice, it seems to be a problem with my data sample, the MFPT I calculated is too large. At the same time give me the following warning: |
It could be that the transitions are not sampled well enough, but I am guessing here. Have you tried other combinations of metastable states? It could also be a problem with your clustering, projection method, featurization.... MSM and HMM estimation can be tricky. I suggest you methodically check everything and also score it with eg VAMP-2 score. And yeah, that rcond number does not inspire confidence. You could also look at your transition matrix (of the CG matrix) to see how it looks like. And visualizing the population of data frames onto a 2d projection of your data (don't forget to check all relevant projections that fall out of the projection method of your choice). Relevance is correlated to the singular (or eigen) value of the projection component. |
And if you get reasonable results with bayesian msm you may have to tweak the estimation parameters a little when it comes to the bhmm. The prior is estimated with lower precision than the 'normal' bhmm. Also the mfpt of the prior itself would be interesting. is it also ill conditioned? |
bayesian_hmm.gather_stats('transition_model/mfpt', A=[hmm.prior.metastable_sets[1]], B=hmm.prior.metastable_sets[1]).mean
After executing the above code it gives me error:
ValueError: Chosen set contains states that are not included in the active set.
I don't know how to choose active set, please help me, thanks.
The text was updated successfully, but these errors were encountered: