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

Numerical tests don't assert; also is there a better way of testing? #17

Closed Jacob-Stevens-Haas closed 2 years ago

Jacob-Stevens-Haas commented 2 years ago

I noticed compare() doesn't assert the numerics, it just issues a warning. All tests currently pass with the change to assert, so I assume it's OK to submit a PR that would make them assert? It would be helpful to have this in place when changing the repo for #15.

I noticed #15 was causing issues with x having multiple time series (e.g. x.shape==(2,100)), so also added some tests. ~Some existing methods fail on either the median or residual tests even when they pass on the individual series.~ EDIT: Solved, it was for very aperiodic tests and spectral derivatives.

That brings up another question: Is there a reason to test median and standard deviation of the residual, instead of inf norm, MAE, MSE?

EDIT: Okay, ran a lot of tests and median seems better than 1-norm/MAE for variable numbers of timepoints.

Jacob-Stevens-Haas commented 2 years ago

Disregard - all info is in #18