Can rejected samples be plotted in parameter space? #611
-
Is there a way to access the rejected particles and plot their positions in parameter space (similar to the upper right-hand corner in (According to the docstrings in pyabc/storage/history, rejected particles do not get stored in the database. However, can they somehow be retrieved directly from the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @lm1909 , no, unfortunately rejected particles are currently not stored anywhere. If needed, this could be done as the sampler already has the ability to also return rejected particles (https://github.com/ICB-DCM/pyABC/blob/main/pyabc/population/population.py#L269), but the subsequent processing (akin to here https://github.com/ICB-DCM/pyABC/blob/main/pyabc/inference/smc.py#L566 all particles could be extracted and stored somewhere) and storage would need to be rewritten. |
Beta Was this translation helpful? Give feedback.
-
If someone faces the same problem (displaying the rejected samples in parameter space to debug acceptance rate issues), I solved it (in a hacky way) with code that looks something like this:
In the ABC run enable recording rejected particles, e.g. like:
Note that this
(this code could be made much cleaner, but I just wanted to briefly copy it here in case it helps someone with the same issue :) ) |
Beta Was this translation helpful? Give feedback.
Hi @lm1909 , no, unfortunately rejected particles are currently not stored anywhere. If needed, this could be done as the sampler already has the ability to also return rejected particles (https://github.com/ICB-DCM/pyABC/blob/main/pyabc/population/population.py#L269), but the subsequent processing (akin to here https://github.com/ICB-DCM/pyABC/blob/main/pyabc/inference/smc.py#L566 all particles could be extracted and stored somewhere) and storage would need to be rewritten.