Path: blob/master/incubator/dose-response-activation.ipynb
411 views
Kernel: bayesian-analysis-recipes
In [1]:
Out[1]:
WARNING (theano.configdefaults): install mkl with `conda install mkl-service`: No module named 'mkl'
Instead of doing an IC50 curve, where the dose-response is inhibition, I'd like to try a dose-response curve where the response is activation as a function of concentration.
In [2]:
In [3]:
In [4]:
Out[4]:
<matplotlib.collections.PathCollection at 0x7f03883cbf10>
Here, we have three separate curves.
The blue one shows a nice and clean dose response relationship within the same bounds
The orange one shows an example where we do not hit
In [5]:
In [6]:
In [7]:
Out[7]:
Auto-assigning NUTS sampler...
Initializing NUTS using jitter+adapt_diag...
Multiprocess sampling (4 chains in 4 jobs)
NUTS: [sd, slope, c50, upper, lower]
Sampling 4 chains, 1,727 divergences: 100%|██████████| 10000/10000 [00:34<00:00, 286.33draws/s]
There were 479 divergences after tuning. Increase `target_accept` or reparameterize.
There were 493 divergences after tuning. Increase `target_accept` or reparameterize.
There were 413 divergences after tuning. Increase `target_accept` or reparameterize.
There were 342 divergences after tuning. Increase `target_accept` or reparameterize.
The number of effective samples is smaller than 10% for some parameters.
In [8]:
Out[8]:
/home/ericmjl/anaconda/envs/bayesian-analysis-recipes/lib/python3.8/site-packages/pymc3/plots/__init__.py:21: UserWarning: Keyword argument `varnames` renamed to `var_names`, and will be removed in pymc3 3.8
warnings.warn('Keyword argument `{old}` renamed to `{new}`, and will be removed in pymc3 3.8'.format(old=old, new=new))
It's clear that we have some unreasonable values, based on prior knowledge, which we did not encode in the model.
Let's try a 2nd version of the model.
In [9]:
In [10]:
Out[10]:
Auto-assigning NUTS sampler...
Initializing NUTS using jitter+adapt_diag...
Multiprocess sampling (4 chains in 4 jobs)
NUTS: [sd, slope, slope_sd, c50, c50_sd, c50_mu, upper, upper_sd, upper_mu, lower, lower_sd, lower_mu]
Sampling 4 chains, 34 divergences: 100%|██████████| 10000/10000 [00:27<00:00, 368.43draws/s]
There were 14 divergences after tuning. Increase `target_accept` or reparameterize.
There were 8 divergences after tuning. Increase `target_accept` or reparameterize.
There were 8 divergences after tuning. Increase `target_accept` or reparameterize.
The acceptance probability does not match the target. It is 0.9113691245971718, but should be close to 0.8. Try to increase the number of tuning steps.
There were 4 divergences after tuning. Increase `target_accept` or reparameterize.
The number of effective samples is smaller than 10% for some parameters.
In [11]:
Out[11]:
/home/ericmjl/anaconda/envs/bayesian-analysis-recipes/lib/python3.8/site-packages/pymc3/plots/__init__.py:21: UserWarning: Keyword argument `varnames` renamed to `var_names`, and will be removed in pymc3 3.8
warnings.warn('Keyword argument `{old}` renamed to `{new}`, and will be removed in pymc3 3.8'.format(old=old, new=new))
array([[<matplotlib.axes._subplots.AxesSubplot object at 0x7f036523c160>,
<matplotlib.axes._subplots.AxesSubplot object at 0x7f036417f5e0>]],
dtype=object)
In [12]:
In [13]:
Out[13]:
Auto-assigning NUTS sampler...
Initializing NUTS using jitter+adapt_diag...
Multiprocess sampling (4 chains in 4 jobs)
NUTS: [sd, slope, slope_sd, c50, c50_sd, c50_mu, upper, upper_sd, upper_mu, lower, lower_sd, lower_mu]
Sampling 4 chains, 75 divergences: 100%|██████████| 10000/10000 [00:34<00:00, 293.93draws/s]
There were 30 divergences after tuning. Increase `target_accept` or reparameterize.
There were 11 divergences after tuning. Increase `target_accept` or reparameterize.
There were 24 divergences after tuning. Increase `target_accept` or reparameterize.
The acceptance probability does not match the target. It is 0.7161589402283773, but should be close to 0.8. Try to increase the number of tuning steps.
There were 10 divergences after tuning. Increase `target_accept` or reparameterize.
The number of effective samples is smaller than 10% for some parameters.
In [14]:
Out[14]:
/home/ericmjl/anaconda/envs/bayesian-analysis-recipes/lib/python3.8/site-packages/pymc3/plots/__init__.py:21: UserWarning: Keyword argument `varnames` renamed to `var_names`, and will be removed in pymc3 3.8
warnings.warn('Keyword argument `{old}` renamed to `{new}`, and will be removed in pymc3 3.8'.format(old=old, new=new))
array([[<matplotlib.axes._subplots.AxesSubplot object at 0x7f035f42b100>,
<matplotlib.axes._subplots.AxesSubplot object at 0x7f035f409910>]],
dtype=object)
In [15]:
In [16]:
Out[16]:
array([6.115337 , 8.349469 , 5.3776417], dtype=float32)
In [ ]: