Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

truncated negative autocorealation #123

Closed

Conversation

denizhanpak
Copy link
Contributor

Based on issue #64

@Datseris
Copy link
Member

By definition, autocorrelation functions start from 1, so positive. You only need to find the index when it first becomes negative. You can also do this in 1 line of code using idx = findfirst(<(0), c).

@denizhanpak denizhanpak closed this Apr 3, 2023
@denizhanpak
Copy link
Contributor Author

Fixed!

@denizhanpak denizhanpak reopened this Apr 3, 2023
@Datseris
Copy link
Member

Datseris commented Apr 4, 2023

Great, but there is still no test calling this new method! Please add a test to the appropriate file in the tests folder.

Comment on lines +55 to +56
idx = findfirst(<(0), c)
τ = exponential_decay_fit(τs[:idx], c[:idx])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here idx is the first index that c is negative. So by doing c[1:idx] you will for sure include the negative value. You need to do c[1:idx-1]. Also, please explicitly always include starting index, this [:idx] is python syntax.

@Datseris
Copy link
Member

Datseris commented Jul 7, 2023

bump @denizhanpak

1 similar comment
@Datseris
Copy link
Member

Datseris commented Aug 7, 2023

bump @denizhanpak

@denizhanpak denizhanpak deleted the positive_correlation branch September 22, 2023 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants