Specify different prior distribution only for some variables in the variables dim

If you set dims="delay_vars" you will be sampling as many variables as there are delay_vars.

You can always sample a smaller subset of variables and then broadcast them to the final shape (or use them to fill an array with arbitrary indexing routines).

The traditional case is in linear models, where coefficients can be reused for multiple observations:

with pm.Model(coords=coords) as m:
  group_coeffs = pm.Normal("group_coefs", 0, 1, dims="unique_groups")
  # Deterministic is optional
  trial_mu = pm.Deterministic("trial_mu", group_coeffs[group_idxs] * x, dims="trials")
  pm.Normal("llike", trial_mu, observed=data, dims="trials")

Where indexing with [group_idxs], expands the small number of group_coeffs variables into a vector of size trials

1 Like