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.
The multi_normal lpdf relies on autodiff but the multi_normal_cholesky has derivatives. It makes sense to just call multi_normal_cholesky once the Cholesky decomposition is taken of the covariance matrix in the multi_normal_lpdf to take advantage of those derivatives.
The precision parameterization should have derivatives as well. A few ad hoc tests of mine show that the cholesky version is faster than precision, do others see the same?
The
multi_normal
lpdf relies on autodiff but themulti_normal_cholesky
has derivatives. It makes sense to just callmulti_normal_cholesky
once the Cholesky decomposition is taken of the covariance matrix in themulti_normal_lpdf
to take advantage of those derivatives.This should be a simple fix.