Comments (7)
The obvious thing here is ForwardDiff.gradient(x -> det(ForwardDiff.hessian(g, x)), x)
. Does this fail?
from forwarddiff.jl.
That might work; I didn't know you could do that. Just to be clear, though, my determinant is not the full determinant of the hessian (which would be a 3x3), so I'm still not sure how to construct it. I will experiment with the ForwardDiff.hessian function, see how its output is formatted, and see if I can select the first two rows and columns via an inline method.
from forwarddiff.jl.
I am new enough to Julia that I am not entirely sure which "x"s in your formula should be replaced with my input and which should be left alone (since my function is defined as g(x::Vector)=...). However, it was easy to select the first two rows and columns via an inline method, so I'm sure this will work, as soon as I figure it out.
from forwarddiff.jl.
Final question: is the partial derivative in row 2, column 1 of my formula in the corresponding location in the hessian?
from forwarddiff.jl.
Well, the code runs and appears to function, but the answer is very different from what I obtained by hand-coding a finite difference, so I think I screwed something up.
from forwarddiff.jl.
is this related to criticality conditions?
from forwarddiff.jl.
I found an example in a journal article, coded the example, and managed to replicate it, so perhaps the code is OK and my hand-coded version is wrong. I still have issues, but they seem to be chemistry issues, not numerical methods issues, so: thank you very much, your solution worked like a charm!
from forwarddiff.jl.
Related Issues (20)
- Cancellation with sparse arrays HOT 5
- Implement hessian! for scalar x
- Implement gammalogccdf for ForwardDiff HOT 1
- `ForwardDiff.jacobian` throws error for `fft` HOT 1
- Correctly forming nested dual numbers. HOT 8
- Symbolics.jl compatibility HOT 1
- Support derivative(f, ::Complex) HOT 1
- `ForwardDiff` fails to compute correct derivative HOT 3
- Incorrect Hessian by `exp` function HOT 1
- Method ambiguities reported by Aqua HOT 3
- Document internals? HOT 1
- Bug (NaNs) when differentiating eigenvectors of Symmetric matrices
- Error requiring `Symbolics` from `Optimization` HOT 1
- promote_rule ambiguity with AbstractIrrational and ForwardDiff.Dual HOT 2
- Allocation tests broken since Julia 1.9
- LoadError: ArgumentError: Package AdaptStaticArraysCoreExt does not have Adapt in its dependencies: HOT 2
- Working with anonymous functions HOT 2
- DiffResults objects are not re-aliased properly HOT 2
- `gradient!` allocates for matrices but not for vectors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forwarddiff.jl.