The Stan Math Library is a C++ template library for automatic differentiation of any order using forward, reverse, and mixed modes. It includes a range of built-in functions for probabilistic modeling, linear algebra, and equation solving.
accept the hessian vector product (hvp or Hv, respectively) as an Eigen::VectorXd& out parameter. Similar to issue #2739, it would benefit BridgeStan to allow signatures that effectively write into double* hvp such that BridgeStan could offer cheaper hessian vector products.
In fact, stan::math::hessian could benefit from a similar added function, but I'm having a hard time wrapping my head around the design of the signature since the out parameter here is a matrix. @WardBrian, would you mind lending an opinion?
The hessian could be represented as a strided matrix (essentially a rowise or columnwise flattening). Since it should always be symmetric it doesn’t even matter which direction you flatten in
The functions
stan::math::internal::finite_diff_hessian_times_vector_auto()
stan::math::hessian_times_vector()
accept the hessian vector product (hvp or Hv, respectively) as an
Eigen::VectorXd&
out parameter. Similar to issue #2739, it would benefit BridgeStan to allow signatures that effectively write intodouble* hvp
such that BridgeStan could offer cheaper hessian vector products.I propose adding functions with signatures
stan::math::internal::finite_diff_hessian_times_vector_auto()
stan::math::hessian_times_vector()
In fact,
stan::math::hessian
could benefit from a similar added function, but I'm having a hard time wrapping my head around the design of the signature since the out parameter here is a matrix. @WardBrian, would you mind lending an opinion?Current Version:
v4.7.0