Draws in Optimizing

I’m attempting to use optimizing to compare maximum a posteriori methods with MCMC for my own edification. The optimizing function comes with a parameter called draws.

From the documentation for optimizing

draws

A non-negative integer (that defaults to zero) indicating how many times to draw from a multivariate normal distribution whose parameters are the mean vector and the inverse negative Hessian in the unconstrained space.

However, when I pass a non-negative integer to this function the resulting object doesn’t have anything that looks like draws from a normal distribution. The theta_tilde only has one row when it should have draws, correct?

Why could this be the case?

EDIT: I see now that the optimizer returns a warning that the leading minor is not positive definite. I imagine it has something to do with not being able to find the cholesky factor of the Hessian. The warning is

Chain 1: Optimization terminated with error:
Chain 1: Line search failed to achieve a sufficient decrease, no more progress can be made
non-zero return code in optimizingError in chol.default(-H) :
the leading minor of order 308 is not positive definite

1 Like

The first part of the error says

Chain 1: Optimization terminated with error:
Chain 1: Line search failed to achieve a sufficient decrease, no more progress can be made

which also indicates numerical problem and it’s likely that the optimization didn’t end up exactly at the mode, or the mode is somewhere where the floating point accuracy is nit sufficient, or the there is perfect correlation between some variables, or the posterior is flat in some direction.

Note that even if the drawing works, after unconstraining they may look something else than normally distributed.

1 Like

I know that this will depend on my problem, but are there any pieces of advice to avoid these problems in the posterior?

Generic advice 1. Check that the parameters are identifiable. 2. Use proper priors. 3. Use weakly informative priors. 4. Use informative priors.

I figured. OK, thanks!

1 Like