Skip to content

Multiscale analysis #132

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

Merged
merged 33 commits into from
Dec 16, 2022
Merged

Multiscale analysis #132

merged 33 commits into from
Dec 16, 2022

Conversation

kahaaga
Copy link
Member

@kahaaga kahaaga commented Oct 18, 2022

A suggestion for a multiscale API.

Fixes #102.

Multiscale methods are simple: they apply some entropy/complexity measure on successively more coarse-grained/downsampled time series, and return the computed measure per scale/downsampling level.

I propose the following function to compute multi-scale measures.

multiscale(e::Entropy, alg::MultiScaleAlgorithm, x::AbstractVector, est::ProbabilitiesEstimator;

This function is similar to entropy, but adds a second argument alg, which is some MultiScaleAlgorithm indicating how downsampling/coarse-graining is done. This generalises all the "multiscale-XYZ" methods found in the literature, where XYZ is some entropy, complexity measure, or combinations of various measures.

EDIT: the following is outdated. Multiscale complexity will be taken care of in Complexity.jl.

In the current state of the PR, however, only multiscale entropies can be estimated (i.e. using a combination of some Entropy and a ProbabilitiesEstimator). Other complexity measures can't just as easily be added, because we have no common interface complexity that is analogous to entropy. @ikottlarz, @Datseris should decide on how this interface should look before proceeding with this PR.

Issue #133 tracks the discussion regarding a potential complexity interface. Alternatively, I'll have to implement a unique multiscale_X function for each complexity measure X ∈ [statistical_complexity, sample_entropy, reverse_dispersion, missing_disp_patterns, ...] (which I don't particularly like the idea of, when a solution like #133 would be much more elegant)

@kahaaga kahaaga added enhancement New feature or request that is non-breaking new method discussion-design Discussion or design matters labels Oct 18, 2022
@codecov
Copy link

codecov bot commented Oct 18, 2022

Codecov Report

Merging #132 (aa7c7e4) into main (321853b) will increase coverage by 7.82%.
The diff coverage is 89.19%.

❗ Current head aa7c7e4 differs from pull request most recent head 54c1c3e. Consider uploading reports for the commit 54c1c3e to get more accurate results

@@            Coverage Diff             @@
##             main     #132      +/-   ##
==========================================
+ Coverage   76.03%   83.85%   +7.82%     
==========================================
  Files          30       41      +11     
  Lines         776      960     +184     
==========================================
+ Hits          590      805     +215     
+ Misses        186      155      -31     
Impacted Files Coverage Δ
src/deprecations.jl 0.00% <0.00%> (ø)
src/encoding/outcomes.jl 0.00% <0.00%> (ø)
src/encoding/utils.jl 100.00% <ø> (ø)
...t_entropies/nearest_neighbors/nearest_neighbors.jl 100.00% <ø> (ø)
...abilities_estimators/timescales/wavelet_overlap.jl 90.00% <ø> (ø)
src/probabilities_estimators/count_occurences.jl 44.44% <28.57%> (-55.56%) ⬇️
src/multiscale.jl 33.33% <33.33%> (ø)
src/encoding/gaussian_cdf.jl 91.66% <50.00%> (ø)
src/entropy.jl 71.87% <66.66%> (+3.12%) ⬆️
src/probabilities.jl 74.07% <75.00%> (-0.93%) ⬇️
... and 31 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@kahaaga kahaaga mentioned this pull request Oct 18, 2022
3 tasks
@kahaaga kahaaga added the hacktoberfest-accepted Accepted for the Hacktoberfest challenge label Oct 23, 2022
@kahaaga kahaaga added this to the 2.0 milestone Nov 3, 2022
@kahaaga kahaaga marked this pull request as ready for review November 3, 2022 17:03
@Datseris
Copy link
Member

Datseris commented Nov 4, 2022

Oh damn, we really need to prioritize fixing the docbuild so that PRs become easier to review. I will review this later as I need to checkout locally and build docs locally.

@Datseris Datseris self-requested a review November 4, 2022 10:41
@kahaaga
Copy link
Member Author

kahaaga commented Nov 4, 2022

Oh damn, we really need to prioritize fixing the docbuild so that PRs become easier to review. I will review this later as I need to checkout locally and build docs locally.

What do you mean? The preview docs are building just fine. They're here: https://juliadynamics.github.io/Entropies.jl/previews/PR132/

@Datseris
Copy link
Member

Datseris commented Nov 4, 2022

What the heeeeeeeeeelll why aren't they displayed in the CI checks as "deployed"??? There is typically one more entry after the docs CI build. Alright, perfect, thanks. Now I can have an actual review here (not right now, later)

@kahaaga
Copy link
Member Author

kahaaga commented Nov 4, 2022

What the heeeeeeeeeelll why aren't they displayed in the CI checks as "deployed"??? There is typically one more entry after the docs CI build. Alright, perfect, thanks. Now I can have an actual review here (not right now, later)

I have no idea why they're not displayed. They used to before. I'll see if I can decipher what's going on.

@kahaaga
Copy link
Member Author

kahaaga commented Dec 16, 2022

@Datseris We already agreed on our Zoom call that the proposed API here is ok. I will make sure that all methods follow the type-first approach (#184), then merge this.

@kahaaga
Copy link
Member Author

kahaaga commented Dec 16, 2022

Tests that fail are unrelated to this PR. Merging.

@kahaaga kahaaga merged commit 3bb3514 into main Dec 16, 2022
@kahaaga kahaaga deleted the multiscale_entropy branch December 16, 2022 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion-design Discussion or design matters enhancement New feature or request that is non-breaking hacktoberfest-accepted Accepted for the Hacktoberfest challenge new method
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiscale entropy in the source code
2 participants