diff --git a/pymc/sampling/mcmc.py b/pymc/sampling/mcmc.py index 96190e5ff0..7cbd2da98a 100644 --- a/pymc/sampling/mcmc.py +++ b/pymc/sampling/mcmc.py @@ -742,6 +742,7 @@ def sample( if var_names is not None: trace_vars = [v for v in model.unobserved_RVs if v.name in var_names] + trace_vars = model.replace_rvs_by_values(trace_vars) assert len(trace_vars) == len(var_names), "Not all var_names were found in the model" else: trace_vars = None