Help with a custom Deterministic variable

Hi, I’m very new to Bayesian approaches, but I’m trying to model the following:

z \sim N(\mu, \Sigma_1)

\hat{x_t} = f(t, z) (a three-dimensional vector)

\Sigma_2 = diag(\sigma_{t, 1}, \sigma_{t,2}, \sigma_{t,3})

x_t \sim N(\hat{x_t}, \Sigma_2)

In short, I would like to estimate the posterior distribution of z. A nonlinear function f of z is observed, and the observations are normally distributed with known noise for each x_t. However, the f I’m using is a non-differentiable function (in Python), and I can’t figure out how to use a Deterministic for \hat{x_t}. I also don’t understand the input formats for MvN – is it possible to pass in a separate \mu and cov for each observation without introducing a for loop?

Instead, I’ve been following the black-box likelihood function tutorial, and while Metropolis-Hastings converges, it works at ~12 draw/s. Are there general tips for approaching this kind of problem, in terms of creating the model optimally and choosing/initializing a sampler properly? Sorry for all these questions. I have been looking around the discourse for similar problems, and will continue to do so-- please feel free to link if this is a redundant question. Thank you!