Closed jack-pan-ai closed 1 year ago
Hello, could you please provide the template and the model code if possible?
Potentially same issue as #614
Hello, could you please provide the template and the model code if possible?
Thanks very much for your reply, the template I am using is https://pyabc.readthedocs.io/en/latest/examples/parameter_inference.html
I did thought it is the same problem with #614 where the transition pdf is 0 leading to the Nan value in the normalization.
The modified code I am using is in the abc_rainfall.ipynb
file (google cloud), where
https://drive.google.com/file/d/1unPilmUt58Pxc6-DYf9qj7ceJoEshdGC/view?usp=drive_link
Can't see any suspicious there, pulling in @arrjon if he know something.
The problem seems to lie in the transition kernel. Changing to a local transition instead of using a multivariate normal kernel seems to solve the issue:
abc = pyabc.ABCSMC(model, prior, distance,
transitions= pyabc.LocalTransition(),
summary_statistics=summary_statistics, population_size=50)
The transition kernel should ideally be kind of similar to the unknown posterior. You can find more details here in this nice paper.
Feel free to re-open if @arrjon's solution does not work.
The problem seems to lie in the transition kernel. Changing to a local transition instead of using a multivariate normal kernel seems to solve the issue:
abc = pyabc.ABCSMC(model, prior, distance, transitions= pyabc.LocalTransition(), summary_statistics=summary_statistics, population_size=50)
The transition kernel should ideally be kind of similar to the unknown posterior. You can find more details here in this nice paper.
great thanks! It does work!!
Bug description RuntimeWarning: divide by zero encountered in double_scalars
I construct a model with 8 parameters and then modify the template in the example to adapt the model. And then, I found the warning when I increased the population from 5 to 10,
RuntimeWarning: divide by zero encountered in double_scalars
weight = acceptance_weight * prior_pd / transition_pd
This warning will lead to the crush of the
run()
because it cannot deal with thenan
in theweight
, such asAssertionError: The population total weight nan is not normalized.
Expected behavior The
transition_pd
should be strictly large than 0;Environment Name: pyabc Version: 0.12.13 Python 3.10.9 system: Ubuntu]