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

[ENHANCEMENT] a closer look into the pastas CCF function #730

Open
2 tasks
dbrakenhoff opened this issue Apr 9, 2024 · 2 comments
Open
2 tasks

[ENHANCEMENT] a closer look into the pastas CCF function #730

dbrakenhoff opened this issue Apr 9, 2024 · 2 comments
Assignees
Labels
enhancement Indicates improvement of existing features priority 1 normal, deal with in the foreseeable future

Comments

@dbrakenhoff
Copy link
Member

When developing code to visualize the cross-correlation between synthetically generated heads based on actual rainfall, I noticed that pastas CCF function does not produce correlations that match the block response function. The pastas implementation is based on the pearson correlation coefficient whereas the CCF I developed uses np.correlate which uses a different definition of correlation.

According to theory, the cross-correlation should be equal to the block response as long as autocorrelation in the stress time series is not obfuscating the relationship. The example below shows the known block-response used to create a synthetic head time series. The different color bar plots show the computed CCF using different methods. The pastas CCF method clearly produces a very different result from the CCF (original). Also the block-response matches nicely with the CCF-PW computation, whereas it looks nothing like the pastas CCF result.

image

Things to check:

  • difference between pastas and my CCF is not just some scaling issue?
  • ...

This issue replaces #352 and #350. Cross-correlation developments will be programmed as a pastas plugin in the future once we settle on a plugin architecture.

@dbrakenhoff dbrakenhoff added the enhancement Indicates improvement of existing features label Apr 9, 2024
@dbrakenhoff dbrakenhoff self-assigned this Apr 9, 2024
@mbakker7
Copy link
Collaborator

mbakker7 commented Apr 9, 2024

Are there references to the different approaches of computing the CCF?
Would be useful here, but especially in the doc string.
But the new CCF-PW seems like the way to go.

@raoulcollenteur
Copy link
Member

raoulcollenteur commented Apr 9, 2024

Do we have some code and script with a simple example to compute the CCF? perhaps a benchmark where we know the theoretical values like in the ACF benchmark..https://pastas.readthedocs.io/en/master/benchmarks/autocorrelation.html

@martinvonk martinvonk added the priority 1 normal, deal with in the foreseeable future label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Indicates improvement of existing features priority 1 normal, deal with in the foreseeable future
Projects
None yet
Development

No branches or pull requests

4 participants