Optimizing back box function wrt a predefined cost distribution

Hi, i need a process to find arguments a of a nonlinear backbox function f(x,a) where x are input vectors. With y=f(x,a) I need to fit the distribution of y to some predefined prior.

Is it possible to use pymc3 to find the best argument a?