Frozen or non-adaptive distribution for random variable

Thank you Christian. That thread with the updated API yields the following code, which will fix the shaker volume variables so they do not update:

import theano.tensor as tt
rand_stream = tt.random.utils.RandomStream()

with pm.Model() as model:
    yeast_conc = pm.Normal("yeast conc", 
                           mu=2 * billion, sd=0.4 * billion)

    shaker1_vol = pm.Deterministic("shaker1 vol", 
                                rand_stream.normal(9.0, 0.05))
    shaker2_vol = pm.Deterministic("shaker2 vol", 
                                rand_stream.normal(9.0, 0.05))
    shaker3_vol = pm.Deterministic("shaker3 vol", 
                                rand_stream.normal(9.0, 0.05))

I added similar code to an example in the notebook link (previous post) in case others need to solve the same problem.

Thanks,
Greg

2 Likes