-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metropolis MCMC using Riemann Langevin updates #182
Comments
Yes, the "gradient-of-the-hessian" is used in TMB to get the derivative of Laplace approximation of with respect to model parameters. |
I had imagined that the gradient of the log-determinant of the Hessian is jim On Mon, Apr 11, 2016 at 2:26 AM, Hans J. Skaug notifications@github.com
|
@James-Thorson get3rdDeriv <- function(obj, par = obj$env$par, w = NULL){
ADHess <- environment(obj$env$spHess)$ADHess
.Call("EvalADFunObject",
ADHess$ptr,
par,
control = list(
order = as.integer(1),
hessiancols = integer(0),
hessianrows = integer(0),
sparsitypattern = as.integer(0),
rangecomponent = as.integer(1),
dumpstack = as.integer(0),
rangeweight = w),
PACKAGE = obj$env$DLL)
} Here's a demo: library(TMB)
runExample("simple") Get all derivatives (280 non-zero hessian elements times 118 parameters) : D3mat <- get3rdDeriv(obj)
dim(D3mat) You can get specific linear combinations of derivatives very fast w <- rnorm(280)
wD3mat <- get3rdDeriv(obj, w=w)
range( wD3mat - t(w) %*% D3mat ) |
@James-Thorson FYI Michael Betancourt has some papers on RHMC and from what I understand you have to be careful w/ using the Hessian because it isn't always positive definite.
From http://arxiv.org/pdf/1312.0906.pdf I'd be curious to see if you could get it working with TMB. Supposedly it works great for low dimensional posteriors with very difficult geometries. |
Kasper and everyone,
I was reading through a method for MCMC sampling using Langevin proposals on a Riemann manifold of the neg-log-like function:
http://arxiv.org/pdf/1309.2983v1.pdf
courtesy of Daniel Simpson. The algorithm between Eq. 9 and 10 should be feasible to implement and test, except that Gamma_i requires the gradient of elements of the hessian matrix w.r.t model coefficients. I have read that TMB has access to higher-order derivatives -- is this gradient-of-the-hessian calculation convenient?
cheers,
jim
The text was updated successfully, but these errors were encountered: