brentp / skidmarks

find runs (non-randomness) in sequences
MIT License
7 stars 2 forks source link

Concerning autocorrelation test #4

Closed lopeLH closed 6 years ago

lopeLH commented 8 years ago

Is the Autocorrelation test suited for non-binary sequences? For example a real valued sequence in the interval [-1,1].

Can you provide some documentation about the implemented algorithm?

Thanks in advance, Daniel

brentp commented 8 years ago

It's just running np.corrcoef(seq[1:], seq[:-1])

robertour commented 6 years ago

I don't think this is suitable for real valued sequences as they are converted to int

It is in the documentation of the method: https://github.com/brentp/skidmarks/blob/master/skidmarks.py#L107-L110

This seem to have been a provision for converting the basestring to numerical sequences: https://github.com/brentp/skidmarks/blob/master/skidmarks.py#L121-L122

However, the line that converts to int is outsite the if isinstance(sequence, basestring): https://github.com/brentp/skidmarks/blob/master/skidmarks.py#L123

brentp commented 6 years ago

I guess it could just use float instead of int to be more general. I'd accept a PR that did that if anyone needs it.