Let's say I have a list of values: [0, 10, 20, 10, 0, 10, 20, 10, 0, ...]
Clearly there's periodicity. We see that there is a cycle every 5 entries. I want to measure the average periodicity, or the average number of entries it takes to complete a cycle, within the list above.
This seems similar to measuring autoocorrelation but I don't know where to begin to get some sort of measure of the "frequency" or "periodicity", aka how fast a cycle is completed.
Initiate an empty list
interval = []
and use a recursive function, like so:
OPTIMIZED CODE ONLY, WITHOUT COMMENTS
To do what you want, simply run your function after initiating []
should work for pretty much any case, delivering you the interval as output.