# Problem with computing Hessian in mixed mode (math library)

**URL:** <https://discourse.mc-stan.org/t/problem-with-computing-hessian-in-mixed-mode-math-library/3561>\
**Category:** General\
**Tags:** stan-math\
**Created:** [March 14, 2018, 9:26pm UTC](https://discourse.mc-stan.org/t/problem-with-computing-hessian-in-mixed-mode-math-library/3561 "2018-03-14T21:26:44Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mirkhosro](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mirkhosro/32/1979_2.png) [@mirkhosro](https://discourse.mc-stan.org/u/mirkhosro)\
**Post date:** [March 15, 2018, 4:14am UTC](https://discourse.mc-stan.org/t/problem-with-computing-hessian-in-mixed-mode-math-library/3561/2 "2018-03-15T04:14:11Z")

</div>

I found this thread in the discussions which is the most similar to the problem I have:

> [@Matrix transformations of parameters (Stan math library)](http://discourse.mc-stan.org/t/matrix-transformations-of-parameters-stan-math-library/2624):
>
> I am trying to build a model in which my parameter vector is transformed in various ways before calculating the likelihood. Eventually, I will want to calculate the gradient and Hessian of the likelihood. One or more of the transformations of (parts of) the input vector will involve matrix-matrix or matrix-vector multiplication, where the matrices and vectors involved will either contain doubles, or (transformations of) parameter elements. As a simple example, here is some code which calculates…

I wonder if the recommended workaround is still the same as the ones suggested there.

---

_[View the full topic](https://discourse.mc-stan.org/t/problem-with-computing-hessian-in-mixed-mode-math-library/3561)._
