abc.run stuck at t=1 for integer parameters
See original GitHub issueHi, so if for models with integer parameters the abc.run gets stuck at t=1 without running the model. Weirdly, there is no error message or crush. Maybe there is an issue with the transition kernel for integer parameters. The problem can be circumvented by using a float parameter that gets rounded to the next integer, however, it still consider the current behavior a bug. Here’s a MWE:
import pyabc
from pyabc.sampler import SingleCoreSampler
import numpy as np
import tempfile
import os
import matplotlib.pyplot as plt
def model(par):
# print('new run!')
return {"data": np.random.binomial(par['n'], 0.5)}
def distance(x, y):
return abs(x["data"] - y["data"])
prior = pyabc.Distribution(n=pyabc.RV("randint", 1, 21)) # it works if I switch to 'uniform'
abc = pyabc.ABCSMC(model, prior, distance, sampler=SingleCoreSampler()) # SingleCoreSampler because I am on Windows
db_path = ("sqlite:///" +
os.path.join(tempfile.gettempdir(), "test.db"))
observation = 5
abc.new(db_path, {"data": observation})
history = abc.run(minimum_epsilon=0., max_nr_populations=10)
fig, ax = plt.subplots()
for t in range(1, history.max_t+1, 2):
df, w = history.get_distribution(m=0, t=t)
pyabc.visualization.plot_kde_1d(
df, w,
xmin=0, xmax=20,
x="n", ax=ax,
label="PDF t={}".format(t))
plt.legend()
plt.show()
I am on Windows 10x64 with the latest Anaconda environment, where I installed pyabc via pypi. My pyabc version is 0.10.4.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Int) with actual type `(t0, t1, t2) - haskell - Stack Overflow
I got stuck in this program. It takes three numbers and puts them in ascending order. Can anyone help me and tell me...
Read more >Update statement - Ask TOM
Hi Tom 1. I have an Update statement which is taking too long. It has a co-related subquery. How can I optimize it...
Read more >Find the Cause of a UI Freeze | dotTrace Documentation
In Profiling type, select Timeline. T1 profiling options. Click Run. dotTrace will run our application and display a special controller window ...
Read more >PandaAthena < PanDA < TWiki
(integer N>0); I want to run a transformation like Reco_tf.py with N events per job. I want to launch M jobs, each with...
Read more >Advanced Bash-Scripting Guide
Within a script, an exit nnn command may be used to deliver an nnn exit status to the shell (nnn must be an...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you @yannikschaelte , that sounds very promising, I will contact you via email about it!
warning added in #331