# Highly Asymmetric Hessian after optimization

**URL:** <https://discourse.julialang.org/t/highly-asymmetric-hessian-after-optimization/26027>\
**Category:** Optimization (Mathematical)\
**Created:** [July 4, 2019, 9:05pm UTC](https://discourse.julialang.org/t/highly-asymmetric-hessian-after-optimization/26027 "2019-07-04T21:05:53Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [July 6, 2019, 6:37am UTC](https://discourse.julialang.org/t/highly-asymmetric-hessian-after-optimization/26027/21 "2019-07-06T06:37:24Z")

</div>

> [@Tamas\_Papp](#):
>
> I think that a `Symmetric` wrapper would be preferable (because of what I said above: you can enforce symmetry in your output, but it can get lost easily again).

Yeah, good point. [Output a Symmetric from the Hessians by ChrisRackauckas · Pull Request #68 · JuliaDiff/FiniteDiff.jl · GitHub](https://github.com/JuliaDiffEq/DiffEqDiffTools.jl/pull/68)

---

<div class="post-metadata">

**Author:** ![Ross\_Boylan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ross_boylan/32/9210_2.png) [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Post date:** [July 6, 2019, 6:37am UTC](https://discourse.julialang.org/t/highly-asymmetric-hessian-after-optimization/26027/22 "2019-07-06T06:37:55Z")

</div>

This is a side-issue, but I don’t see `copytri!` in the LinearAlgebra documentation at [Linear Algebra · The Julia Language](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra), or anywhere in the docs according to the search web interface. Does that mean anything?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [July 6, 2019, 6:46am UTC](https://discourse.julialang.org/t/highly-asymmetric-hessian-after-optimization/26027/23 "2019-07-06T06:46:18Z")

</div>

It means it copies the triangular part to the other triangle.

---

<div class="post-metadata">

**Author:** ![Ross\_Boylan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ross_boylan/32/9210_2.png) [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Post date:** [July 6, 2019, 6:47am UTC](https://discourse.julialang.org/t/highly-asymmetric-hessian-after-optimization/26027/24 "2019-07-06T06:47:20Z")

</div>

I meant does the fact that `copytri!` isn’t documented mean anything?

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [July 6, 2019, 7:21am UTC](https://discourse.julialang.org/t/highly-asymmetric-hessian-after-optimization/26027/25 "2019-07-06T07:21:18Z")

</div>

It is not part of the official API and could change without warning.

But given that new releases are tested against registered packages, this is not a major concern.

---

<div class="post-metadata">

**Author:** ![Ross\_Boylan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ross_boylan/32/9210_2.png) [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Post date:** [July 6, 2019, 8:56pm UTC](https://discourse.julialang.org/t/highly-asymmetric-hessian-after-optimization/26027/26 "2019-07-06T20:56:32Z")

</div>

> [@pkofod](#):
>
> Since the hessian evaluation often shares considerable calculations with the gradient and value, it’s almost always better to evaluate them together (and with automatic differentiation you can actually get the gradient and value for free given you’ve decided to evaluate the hessian, so…). You only save some calculations in the last iteration, but all other iterations become more expensive - seems like stupid trade-off.

I’m not sure if those remarks were intended to cover Newton only, or all the optimization methods. What about methods that don’t use the 2nd derivative? The trade-off seems different there, since the optimization never uses the Hessian but the consumer of the result may want it aftewords.

---

<div class="post-metadata">

**Author:** ![pkofod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pkofod/32/2179_2.png) [@pkofod](https://discourse.julialang.org/u/pkofod)\
**Post date:** [July 6, 2019, 9:05pm UTC](https://discourse.julialang.org/t/highly-asymmetric-hessian-after-optimization/26027/27 "2019-07-06T21:05:18Z")

</div>

For BFGS we don’t assume that the hessian is available, so in that case it’s up to the user to do whatever they want.

[Previous page](https://discourse.julialang.org/t/highly-asymmetric-hessian-after-optimization/26027.md?page=1)
