EconForge / interpolation.py

BSD 2-Clause "Simplified" License
123 stars 35 forks source link

restore computation of derivatives to splines #41

Closed albop closed 3 years ago

albop commented 5 years ago

Main problem is to find a good API. I was thinking of something like:

eval_cubic(grid, C, points, Val[k]) # would differentiate up to order k and group the results by total order

eval_cubic(grid, C, points, ((V[0], V[0]), (V[2], V[0]), (V[0], V[2]) ) # would return the zero order and second order with respoect to each dimension. This is a bit to verbose.

It would be nice to do instead Orders[(0,0), (2,0), (0,2)] but I suspect it is not possible unless one can treat the numbers as literals.

albop commented 3 years ago

There has been an implementation of derivatives for a while.