Starts from the best of a set of posterior draws and refines with a derivative-free optimizer.
Value
Numeric vector: the MAP parameter estimate. For a bounded prior
(from prior_uniform() or a prior_custom() with lower/upper), the
estimate always falls inside the prior's support – the search never
accepts a step that leaves it, the same guarantee sample() and
log_prob() give. Errors if the seeding draw comes back short of
n_init – including empty – which for a bounded prior means the
estimator is leaking mass outside the prior support faster than
rejection sampling can keep up; there is no starting point to search
from in that case, so this stops rather than continuing on a shorter,
silently misleading draw.
