Unable to parameterize lag parameter

In your example it doesn’t matter that you defined u at all, you are sampling a single variable z and there is no observed data linked to it, so the posterior you are getting is the same as the prior.

A simpler comparison would have some variable downstream of u.

with pm.Model() as correct_m:
  x = pm.Normal("x")
  u = x  # You don't need any operation to prove the point, but you can do the int if you want
  z = pm.Normal("z", u, 1e-3, observed=100)

with pm.Model() as broken_m:
  x = pm.Normal("x")
  u = x.eval()  # The eval breaks the relationship between `x` and `z`
  z = pm.Normal("z", u, 1e-3, observed=100)

In the first model, x is going to have a posterior shifted towards 100, and in the second not, because you broke the relationship between z and x with that eval. In fact the posterior for x is going again to be the prior, because it’s not linked to any observed data.

1 Like