Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What does "multi point derivatives" mean? #181

Closed
gdalle opened this issue Mar 7, 2024 · 9 comments · Fixed by #182
Closed

What does "multi point derivatives" mean? #181

gdalle opened this issue Mar 7, 2024 · 9 comments · Fixed by #182

Comments

@gdalle
Copy link
Member

gdalle commented Mar 7, 2024

I'm not sure I understand what this function does: https://docs.sciml.ai/FiniteDiff/stable/#Multi-Point-Derivatives

@ChrisRackauckas
Copy link
Member

That's just a header? I'm not sure what you're pointing to since that's just a header for derivatives, gradients, and jacobians.

@gdalle
Copy link
Member Author

gdalle commented Mar 9, 2024

I pointed to the function finite_difference_derivative when applied to an array input.

In the docs the following list of headers exists:

  • scalar derivatives
  • "multi point derivatives"
  • gradients
  • jacobians
  • hessians

The term derivative usually applies to a function $f: R \to R$, or more generally $R \to R^m$, but in any case it takes a scalar input point.
Reading "multi point derivative" I imagine we have to supply several input points $x^{(1)},x^{(2)},x^{(3)}$ to this routine, and we get several derivatives, one at each point $f'(x^{(1)}),f'(x^{(2)}),f'(x^{(3)})$.
The source code gives me confirmation of that, but for lack of docstrings I was a bit confused when only reading the docs.

#=
Compute the derivative df of a scalar-valued map f at a collection of points x.
=#
function finite_difference_derivative(

@gdalle gdalle reopened this Mar 9, 2024
@ChrisRackauckas
Copy link
Member

They are different levels of headers. That's an H2 while the others are H3.

@gdalle
Copy link
Member Author

gdalle commented Mar 9, 2024

Screenshot 2024-03-09 at 16 15 47

If "multi point derivatives" is intended to be one level lower than derivative, gradient, jacobian and hessian, then that will make it much clearer indeed. But the toc doesn't suggest it

@ChrisRackauckas
Copy link
Member

It should just be multi-dimensional derivatives. I edited that already, and subsetting the header I thought was done already.

@gdalle
Copy link
Member Author

gdalle commented Mar 9, 2024

Okay thanks. But that might be confusing for another reason: "multi dimensional derivative" to me evokes the idea of a function $f: R \to R^m$, where the derivative is a vector. To get that we have to use finite_difference_gradient in FiniteDiff:

Gradients are either a vector->scalar map f(x), or a scalar->vector map f(fx,x) if inplace=Val{true} and fx=f(x) if inplace=Val{false}.

IIUC the section we are discussing would be better off with the original name "multi point derivative", or something like "multi input derivative", because is instead about several derivatives at different points of a function $f: R \to R$. The nesting will already improve matters :)

@ChrisRackauckas
Copy link
Member

I'm happy to consider any wording change you PR. Call it a partial derivative of a function with one variable, the total derivative optimized to the scalar input case, or whatnot. I'm happy to go with the words others consider easiest to understand, just write it out in full in a PR

@gdalle
Copy link
Member Author

gdalle commented Mar 9, 2024

Will do, thanks, just wanted to make sure I understood what it was first 😊

@gdalle
Copy link
Member Author

gdalle commented Mar 11, 2024

I decided to roll up my sleeves and make a proper documentation in the process. Now the multipoint derivative is clarified in the docstrings of #182, among other things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants