Hi,
perhaps there's something I don't quite understand, but when I'm taking the unit test and multiplying the series with a high value the RFC algorithm gives back very different counting results.
edit:
I figured it out. the above code uses int32 which results in horrible calculation errors in the reversal function. by making sure the values are float before counting produces expected results.
For reference if anyone else is reading this down the road. the following produce expected results:
series = np.array([-2.0, 1.0, -3.0, 5.0, -1.0, 3.0, -4.0, 4.0, -2.0])
series *= 100000
print(count_cycles(series, ndigits=None, nbins=None, binsize=None))
Hi, perhaps there's something I don't quite understand, but when I'm taking the unit test and multiplying the series with a high value the RFC algorithm gives back very different counting results.
The unittest is as follows:
output: [(3, 0.5), (4, 1.5), (6, 0.5), (8, 1.0), (9, 0.5)]
by modifying the unittest slightly the number of cycles changes:
output: [(200000, 0.5), (500000, 0.5), (700000, 0.5)]
thoughts?
edit: I figured it out. the above code uses int32 which results in horrible calculation errors in the reversal function. by making sure the values are float before counting produces expected results.
For reference if anyone else is reading this down the road. the following produce expected results:
output: [(300000.0, 0.5), (400000.0, 1.5), (600000.0, 0.5), (800000.0, 1.0), (900000.0, 0.5)]