Closed joshuawallace closed 5 years ago
Ah, I think you're right. Thanks for noticing this! I'll apply this to the other methods as well.
Wait, now I'm not sure anymore. Fractional difference between a current and previous value is (current - previous)/previous
I think. periodepsilon
is the minimum allowed fractional difference, so I think this is correct:
perioddiff > (periodepsilon*prevperiod)
I'll revert this merge for now. Is the current method not working as you expected?
Checking the difference between the previous and current period is accomplished in line 590. It seems that line 591 s intended to check the current period against all of the previously found best peaks (at least bestperiodsdiff
compares the difference between the current period and the best periods), so I thought the relevant fractional value to compare would be fractional value of the current period rather than the previous period.
I didn't notice it from a behavior thing. I was just looking at it closely to adapt it for some plots I was making last night.
Yep, I think I see it now. Your change was correct then. I'll apply this elsewhere in periodbase then. Thanks!
Noticed this, maybe I'm wrong but it made more sense for me that the bestperiodsdiff values be compared with the current period, not the previous period. I haven't checked whether a similar algorithm is used in the other period search algorithms but if so and this change is valid, those should be changed too.