Regarding readability, you can still assign expressions to intermediate Python variables:
mu = alpha + omega * epsilon_alpha_g[g] + (beta + tau * epsilon_beta_g[g]) * x
pm.Normal("y_obs", mu=mu + sigma=sigma)
Regarding not having to define two models. We are working on it in Add var_names argument to sample by fonnesbeck · Pull Request #7206 · pymc-devs/pymc · GitHub
In the meantime here is a hack you can use:
with pm.Model() as m:
...
# Move deterministics "outside" of model
deterministics = m.deterministics
m.deterministics = []
with m:
idata = pm.sample()
# Restore deterministics
m.deterministics = deterministics
It’s not discouraged, just depends on whether 1) you need them and 2) you have enough RAM. That being said many time people use Deterministics when the only thing they want to do is to define intermediate variables when writing model code, which you can definitely do without them. See discussion in Consider renaming `Deterministic` to `store_in_trace` · Issue #6695 · pymc-devs/pymc · GitHub
Regarding saving things to disk directly. I think you can do that with GitHub - pymc-devs/mcbackend: A backend for storing MCMC draws.
@michaelosthege is there an example of doing that (I didn’t check if there’s one in the Readme)