Ignoring the specifics of what you’re trying to achieve, it seems that:
- You have too many z variables for the number of observations
- Not enough w variables for the sigma hyperprior.
Given these I am not surprised the sample struggles.
For point 1 you can try a more informative prior
For point 2 you can try a non centered parametrization instead with w = mu_w + pm.Normal("w_raw" 0, 1, shape=...) × sigma