It may be that I have not entirely understood what I have researched online but is there an example of how to include a user defined function in brms, where the function is of the predictor variable(s) and there is a parameter to be optimized. The function f() consumes one of the predictor variables in a regression and there is a parameter p1 that I need to optimize during fitting. Is this possible?

y~f(x,p1)