-
Notifications
You must be signed in to change notification settings - Fork 6
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
Bootstrap based nonuniform embedding (BBNUE) estimator #80
Conversation
src/transferentropy/bbnue.jl
Outdated
""" | ||
transferentropy(source, target, [cond], est::BBNUE; q = 0.95, η = 1, | ||
nsurr = 100, uq = 0.95, | ||
include_instantaneous = true, | ||
method_delay = "ac_min", | ||
maxlag::Union{Int, Float64} = 0.05 | ||
) → te, js, τs, idxs_source, idxs_target, idxs_cond | ||
|
||
Estimate transfer entropy using the [`BBNUE`](@ref) estimator, which uses a bootstrap-based |
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.
I vote that all of this docstring is in BBNUE
instead. "Polluting" the transferentropy
docstring with so much details about a specific method isn't ideal for a user. The API is clear that est
is used in transferentropy
, there is no gain in highlighting here what transferentropy
does with this specific method. Instead, better to highlight it at BBNUE
.
@kahaaga I am not familiar with this method and I won't have time to read the paper to get the necessary amount of familiarity. Thus, I cannot review the actual source code but only the documentation. Just letting you know in advance. |
src/transferentropy/bbnue.jl
Outdated
`source(t) → target(t)` are allowed. | ||
|
||
In this implementation, the maximum lag for each embedding variable is determined using `estimate_delay` | ||
from `DelayEmbeddings.jl`. The keywords `method_delay` (default is "ac_min") controls the method |
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 either have DelayEmbeddings
or DelayEmbeddings.jl without code inline.
## Returns | ||
|
||
A 6-tuple is returned, consisting of: | ||
- `te`: The computed transfer entropy value. If no relevant variables were selected, then `te = 0.0`. | ||
- `js`: The indices of the selected variables. `js[i]` is the `i`-th entry in the array `[idxs_source..., idxs_target..., idxs_cond...,]`. | ||
- `τs`: The embedding lags of the selected variables. `τs[i]` corresponds to `js[i]`. | ||
- `idxs_source`: The indices of the source variables. | ||
- `idxs_target`: The indices of the target variables. | ||
- `idxs_cond`: The indices of the conditional variables (empty if `cond` is not given). |
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.
Ah, I see. I guess that's a reason to explain this in the docstring of transfer entropy. Okay, then I think the best thing to do is to create a new function alltogether. I think it is not the best idea to use the same name transferentropy
for such a massively different return signature.
It is probably more intuitive to make a new function and put it in the docs in the same section as BBNAU
.
@Datseris No worries! I don't expect you to learn a new method just for a PR here. You input on the documentation and interface continues to be very valuable.
I agree. I hesitated a bit by re-using There are several other similar methods that optimize the embedding that I'm implementing at the moment. However, I'm not entirely sure if they would all return the same information yet. Thus, I agree, and think I will just make a method-specific function Thanks for the input! |
Codecov Report
@@ Coverage Diff @@
## master #80 +/- ##
==========================================
+ Coverage 72.35% 77.65% +5.30%
==========================================
Files 8 10 +2
Lines 340 461 +121
==========================================
+ Hits 246 358 +112
- Misses 94 103 +9
Continue to review full report at Codecov.
|
yeah |
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.
Don't forget to increment minor version in Project.toml, as this is an additional feature.
A version of the NUE estimator from Montalto, A.; Faes, L.; Marinazzo, D. MuTE: A MATLAB toolbox to compare established and novel estimators of the multivariate transfer entropy. PLoS ONE 2014, 9, e109462.