andgoldschmidt / derivative

Optimal numerical differentiation of noisy time series data in python.
https://derivative.readthedocs.io/en/latest/
Other
56 stars 8 forks source link

axis default parameter #5

Closed briandesilva closed 4 years ago

briandesilva commented 4 years ago

I noticed that the default value for axis throughout derivative.py is 1. What's the rationale for using 1 instead of 0? The only reason I ask is because we've got to set axis=0 when using derivative objects in PySINDy (to conform to sklearn's conventions and those in the original SINDy paper, the 0 axis corresponds to time and the 1 axis to features).

andgoldschmidt commented 4 years ago

X = [n,t] is how I would write my data matrix for DMD to make sure I have access to left multiplication, AX. I think PySINDy should make its choice explicit because of this unfortunate discrepancy in the two major algo's the group uses. Is there a change we should make to derivative to make a kind of global setter/getter or is the current access enough?

briandesilva commented 4 years ago

I think the current implementation is fine, though I think I found a bug. On this line of derivative.py, I think you forgot to pass the axis argument to d.