JuliaMath / JuliaMath/Calculus.jl

Disallow second_derivative and hessian functions to be called without g

Open
#18 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
285
Forks
78
PR merge metrics
No merged PRs in 30d

Description

Currently, `derivative.jl` has the two following definintions

``` .jl
second_derivative(f::Function) = second_derivative(f, derivative(f), :scalar, :central)
hessian(f::Function) = second_derivative(f, gradient(f), :vector, :central)
```

however we discussed that by estimating the first derivative to hand to the second derivative is error prone and subject to possibly large round off error.

I think it's simple enough for a user to input `second_derivavitve(f,derivative(f))` explicitly if they want to take this risk.

Thoughts?
@johnmyleswhite

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.