Closed kahaaga closed 9 months ago
Or maybe warn_precise
should be an optional keyword argument to the TransferOperator
constructor?
Attention: 5 lines
in your changes are missing coverage. Please review.
Comparison is base (
70da737
) 88.03% compared to head (039f66f
) 88.17%. Report is 8 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
...come_spaces/transfer_operator/transfer_operator.jl | 55.55% | 4 Missing :warning: |
src/outcome_spaces/ordinal_patterns.jl | 92.85% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Or maybe
warn_precise
should be an optional keyword argument to theTransferOperator
constructor?
This is the way to go I feel. Make this true by default.
Or maybe
warn_precise
should be an optional keyword argument to theTransferOperator
constructor?
This is the way to go I feel. Make this true by default.
This behaviour might be also related to this issue:
using DynamicalSystems
henon_rule(x, p, n) = SVector{2}(1.0 - p[1]*x[1]^2 + x[2], p[2]*x[1])
henon = DeterministicIteratedMap(henon_rule, zeros(2), [1.4, 0.3])
orbit, t = trajectory(henon, 20_0000; Ttr = 500)
using ComplexityMeasures
grid_size = 20
binning = RectangularBinning(grid_size)
probabilities(TransferOperator(binning),orbit)
This raises a weird error: ERROR: LoadError: ArgumentError: Cannot decode integer -1: out of bounds of underlying binning.
I think this is also causing #338
EDIT: as pointed out in the comment above
I was getting weird errors in CausalityTools when using the
TransferOperator
for estimating transfer entropy. It turns out the reason is a feature I forgot we introduced: the option to turn on/off theprecise
option forRectangularBinning
/FixedRectangularBinning
. The default isprecise == false
when constructing instances of either, because that is more performant. However, in some cases forTransferOperator
, this causes some points to be encoded as-1
even though they are inside the binning. In turns, this causes some hard-to-debug bugs.After this PR, when any relevant function calls the internal
transferoperator
function withprecise == false
, a warning will be thrown. There may be cases where-1
-encodings are not critical (i.e. entropy estimation here), but in CausalityTools.jl I explicitly need to decode the encoded bins again to get their bin indices, which is not possible when the index is-1
.