Closed bob-carpenter closed 1 year ago
I missed this one earlier, too
we will now support an option for max a posteriori (MAP) estimates.
It would be good to be explicit whether the MAP is in unconstrained or constrained space (as these are not in general the same)
We compute the optimization in the unconstrained space using the Jacobian adjustment. We then map the posterior mode in the unconstrained space back to the constrained space.
Then for the Laplace approximation, we map back from constrained to unconstrained, lay down the normal approximation in the unconstrained space (including Jacobian for the MAP option), sample from the approximate normal in the unconstrained space, and then inverse transform the draws back to the constrained space.
Submission Checklist
./runTests.py src/test/unit
make cpplint
[can't figure out how to do this as it hardcodespython
and I need to usepython3
on Mac OS X and it doesn't seem to take aliases or a specification ofPYTHON2
environment variable]Summary
Add a template parameter to all optimization functions (Newton, BFGS, L-BFGS) to indicate whether or not to include Jacobian adjustments. Until now, we had hard coded turning the Jacobian off to provide maximum likelihood estimates. With the Jacobian turned on, we will now support an option for max a posteriori (MAP) estimates.
Intended Effect
Use MAP estimates in Laplace approximation.
How to Verify
Unit tests with a new model with the Jacobian calculated and optimized explicitly.
Side Effects
Shouldn't be any because I made it the last argument and gave it a default of
false
so that it falls back on existing behavior.Documentation
Yes, in code.
Copyright and Licensing
Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):
Simons Foundation
By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses: