-
Notifications
You must be signed in to change notification settings - Fork 65
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
[ENH] - Add autocorrelation related functionality #331
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a4b1ee8
add ac fit funcs
TomDonoghue 59cf7ea
fix merge
TomDonoghue f262da8
minor docstring fixes
TomDonoghue e847f34
Merge branch 'main' into acf
TomDonoghue 20cbb53
Merge branch 'main' into acf
TomDonoghue 4ec8226
add compute_ac_fit to api list
TomDonoghue 1fed3d5
drop optional fs inpiut to fit_ac
TomDonoghue 62fc3b0
add param input and udpate docstring
TomDonoghue 6af8c61
fix bounds in fit_ac and add test
TomDonoghue 000322b
add some basic accuracy checking to ac fit
TomDonoghue File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tau is in samples. Could make a note in docstring that tau isn't in seconds (what I expected). Or the func could accept fs as a separate argument, then do the multiplication in the func. Here is an example:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right - there's an inconsistency here.
fs
isn't a required inpit tofit_autocorr
, so if not passed, then it's consistent (this make sense, I think):But if you do pass
fs
intofit_autocorr
, then the timepoints get rescaled, but the tau value does not, leading to the issue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way to write what you point out is that if
fs
is passed into the fit function, then thetimepoints
should be in time not in samples, and so recomputing the values consistently should look like (this is equivalent to multiplying the tau):corrs = exp_decay_func(lags / fs, tau, 1, 0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, the core of this issue is basically it's not a good idea to optionally take
fs
as an input infit_autocorr
and if so divide it out, because then it makes the values of the fit parameters different from the values of the inputs. I'll drop this, and then one can pass in timepoints as either samples or seconds, and it will work either way (and be consistent).