What should a empty prior return?
In the case where parameter priors are not defined in a optimization problem currently problem.x_priors returns None.
To keep things simple (and integrate in the MCMC sampling workflow), I think it would be better to return zero in the case of "missing" priors and always work with the log prior object then.
To sum up,
in case of no priors defined, create a "dummy" prior that returns zero as log prior value, gradient and hessian.
- Any thoughts on this?
I think returning None is what I would expect. What about creating a copy of the objective and adding a zero-returning prior within the MCMC routines that need a prior?
Why copy of the objective?
It may be better to instead of a "zero" prior raise a warning and define a uniform prior based on the parameter bounds.
Why copy of the objective?
To ensure we don't accidentally modify the original objective? Could also transiently add it and ensure its removed upon exit of the sampling routine.
Agreed. So I would say create a copy of the objective, and make the posterior an aggregated objective of the objective and a uniform prior based on the lb,ub bounds.