In your initial model, you only have 7 different dow_effect values (I assume one per weekday), so what I would do with that is update the model to:
coords = {
"weekday": ["Monday", "Thursday", "Wednesday", # continue with rest of days so it is a list of length 7
}
with pm.Model(coords=coords) as model1:
# priors
sigma = pm.HalfStudentT("sigma", 4, 1)
dow_effect = pm.Normal("dow_effect", mu=0, sigma=7.14, dims="weekday")
# the dims="weekday" will repeat/batch the normal to get a variable with 7 dims,
# so you can skip the repeat part now
slope = pm.Normal("slope", mu=0, sigma=.0109)
# likelihood
likelihood = pm.Normal(
"y",
mu=(
slope * ds1["day"].values
+ dow_effect[ds1["weekday"].values]
),
sigma=sigma,
observed=ds1["y"]
)
It might also be possible to add some dimensions to the likelihood, but I don’t know what these would be.