Defining random for a CustomDist time series

The new behavior is because GRW is no longer a simple Distribution. What PyMC does whe you have some observed data and missing entries is pull those apart and create two variables: one fully observed and one fully unobserved. To be able to do this it needs to know how to pull apart the parameters as well.

It doesn’t know for the GRW, but it does for the Normal, which your last model uses.

In your case it seems like your model is just GRW + daily intercepts. I don’t think you need a custom distribution at all

Untested code:

coords={'days': df.index.values, 'weekdays':range(7)}
with pm.Model(coords=coords) as m:
    innovation_mag = pm.HalfNormal('innovation_mag', sigma=.2)
    latent = pm.GaussianRandomWalk('latent', sigma=innovation_mag, dims="days")
    
    dow_innovation_mag = pm.HalfNormal('dow_innovation_mag', sigma=.2)
    dow = pm.Normal(
            'weekly_seasonality',
             sigma=dow_innovation_mag,          
             dims="weekdays"
    )
    mu=latent
    for i in range(7):
      mu = at.set_subtensor(mu[i::7], mu[i::7] + dow[i])
    
    obs_noise_mag = pm.HalfNormal('obs_noise_mag', sigma=.2)
    observed = pm.Normal('observed', 
                         mu=mu, 
                         sigma=obs_noise_mag, 
                         observed=df.value_with_dow_noisy)

If your observed has np.nan for the future entries PyMC will sample those as well.