DynamicsAndNeuralSystems / pycatch22

python implementation of catch22
https://time-series-features.gitbook.io/catch22/python
GNU General Public License v3.0
76 stars 15 forks source link

co_autocorrs NAN issue #32

Open Moonzyyy opened 1 month ago

Moonzyyy commented 1 month ago

I was testing what happened when you insert an array of just 0's into pycatch22 and its local C file. Functions that use co_autocorrs, such as Co_firstmin and co_f1, will face a division by zero error and therefore return NaN as a complex number, this happens when dividing F by the divisor.

However, what I found interesting is that running these functions on pycatch22 will return 0, while if you run them locally on C it returns the length of the array. Is this discrepancy happening due to the python wrapper (python_wrapper_int)?

Moonzyyy commented 1 month ago

Actually, coming back to this, it also happens on some time series values that running the C code locally gives different results than pycatch22.

For example: image

As you can see the output running it locally in C is -0.1409879

However on pycatch22 the output is different, this one is: image -0.7025243149147881

Is there a reason for this difference?