def model(): sd = yield pm.Exponential("sd", 1) x = yield pm.Normal("x", 0, 1, observed=observed_kwargs["model/x"]) y = yield pm.HalfNormal("y", 1, observed=observed_kwargs["model/y"]) d = yield pm.Deterministic("d", x + y) z = yield pm.Normal("z", d, sd, observed=observed_kwargs["model/z"]) u = yield pm.Exponential("u", z) return u
def outer_model(): cond = yield pm.HalfNormal("cond", 1) dcond = yield pm.Deterministic("dcond", cond * 2) dx = yield nested_model(dcond) ddx = yield pm.Deterministic("ddx", dx) return ddx
def nested_model(cond): x = yield pm.Normal("x", cond, 1) dx = yield pm.Deterministic("dx", x + 1) return dx
def unvectorized_model(): norm = yield pm.Normal("norm", 0, 1, batch_stack=norm_shape) determ = yield pm.Deterministic("determ", tf.reduce_max(norm)) output = yield pm.Normal("output", determ, 1, observed=observed)
def simple_model_with_deterministic(): norm = yield simple_model() determ = yield pm.Deterministic("determ", norm * 2) return determ
def model(): x = yield pm.Normal("x", 0, 1) det = yield pm.Deterministic("det", x) y = yield pm.Normal("det", det, 1) return y
def model(): x = yield pm.Normal("x", 0, 1) det = yield pm.Deterministic("x", x) return det
def model(): x = yield pm.Normal("x", 0, 1) yield pm.Deterministic(None, x)
def model(): sd = yield pm.HalfNormal("sd", 1.0) mu = yield pm.Deterministic("mu", tf.convert_to_tensor(1.0)) x = yield pm.Normal("x", mu, sd, observed=observed) y = yield pm.Normal("y", x, 1e-9) dy = yield pm.Deterministic("dy", 2 * y)
def outer_model(): cond = yield pm.HalfNormal("cond", 1, conditionally_independent=True) dcond = yield pm.Deterministic("dcond", cond * 2) dx = yield nested_model(dcond) ddx = yield pm.Deterministic("ddx", dx) return ddx