import pymc3 as pm
BILLION = 1e9
TOTAL_SQUARES = 25
squares_counted = 5
yeast_counted = 95
yeast_conc = pm.Normal("cells/mL", mu=2 * BILLION, sd=0.4 * BILLION)
yeast_slurry_volume = pm.Normal("initial yeast slurry volume (mL)",
mu=1.0,
sd=0.01)
shaker1_volume = pm.Normal("shaker1 volume (mL)",
mu=9.0,
sd=0.05)
dilution_shaker1 = (yeast_slurry_volume /
(yeast_slurry_volume + shaker1_volume))
shaker2_volume = pm.Normal("shaker2 volume (mL)",
mu=9.0,
sd=0.05)
shaker1_to_shaker2_volume = pm.Normal("shaker1 to shaker2 (mL)",
mu=1.0,
sd=0.01)
dilution_shaker2 = (shaker1_to_shaker2_volume /
(shaker1_to_shaker2_volume + shaker2_volume))
shaker3_volume = pm.Normal("shaker3 volume (mL)",
mu=9.0,
sd=0.05)
shaker2_to_shaker3_volume = pm.Normal("shaker2 to shaker3 (mL)",
mu=1.0,
sd=0.01)
dilution_shaker3 = (shaker2_to_shaker3_volume /
(shaker2_to_shaker3_volume + shaker3_volume))
...
dilution_shaker1 = (yeast_slurry_volume /
(yeast_slurry_volume + shaker1_volume))
...
dilution_shaker2 = (shaker1_to_shaker2_volume /
(shaker1_to_shaker2_volume + shaker2_volume))
...
dilution_shaker3 = (shaker2_to_shaker3_volume /
(shaker2_to_shaker3_volume + shaker3_volume))
...
final_dilution_factor = dilution_shaker1 * dilution_shaker2 * dilution_shaker3
volume_of_chamber = pm.Gamma("volume of chamber (mL)", mu=0.0001, sd=0.0001 / 20)
...
final_dilution_factor = dilution_shaker1 * dilution_shaker2 * dilution_shaker3
volume_of_chamber = pm.Gamma("volume of chamber (mL)", mu=0.0001, sd=0.0001 / 20)
yeast_visible = pm.Poisson("cells in visible portion",
mu=yeast_conc * final_dilution_factor * volume_of_chamber)
import pymc3 as pm
BILLION = 1e9
TOTAL_SQUARES = 25
squares_counted = 5
yeast_counted = 95
...
yeast_visible = pm.Poisson("cells in visible portion",
mu=yeast_conc * final_dilution_factor * volume_of_chamber)
number_of_counted_cells = pm.Binomial("number of counted cells",
yeast_visible, squares_counted/TOTAL_SQUARES,
observed=yeast_counted)