Comments (5)
We could potentially also add a specific method for
StateSpaceSet{1}
Yep, seems reasonable. The method could look like something like this:
function codify(est::OrdinalOutcomeSpace{m}, x::StateSpaceSet{1})
throw(ArgumentError("A `StateSpaceSet` input is assumed to be already embedded. Convert your univariate time series to a subtype of `AbstractVector` to codify with ordinal patterns!"))
end
from complexitymeasures.jl.
We should probably also add a comment that ordinal pattern outcome spaces are only defined for m >= 2
Added this to the PR #359
from complexitymeasures.jl.
Thanks for opening this, @rusandris. The problem is here:
function codify(est::OrdinalOutcomeSpace{m}, x) where m
if x isa AbstractVector
dataset = embed(x, m, est.τ)
else
dataset = x
end
m != dimension(dataset) && throw(ArgumentError(
"Order of ordinal patterns and dimension of `StateSpaceSet` must match!"
))
πs = zeros(Int, length(dataset))
@inbounds for (i, χ) in enumerate(dataset)
πs[i] = encode(est.encoding, χ)
end
return πs
end
As per the docstring of OrdinalPatterns
, we have:
- If the input is an
AbstractVector
, then it is assumed that embedding should be done. - If the input
x
is aStateSpaceSet
, thencodify
treats it as is: assuming that the user has pre-embedded their data. This is essentially what you've done here by generating data usingtrajectory
, which always returns aStateSpaceSet
(although in the case of 1D systems, it is just the identity embedding).
This behavior will not change.
However, we could perhaps add an extra error message for when the input is a state-space set whose dimension doesn't match m
. Perhaps we could add a method like:
function codify(est::OrdinalOutcomeSpace{m}, x::StateSpaceSet{D}) where {m, D}
if (m != D)
throw(ArgumentError("A `D`-dimensional `StateSpaceSet` was given as input, but the outcome space has ordinal pattern length `m = $m`. These must match."))
end
end
What do you think, @rusandris? The precise wording of the error message can be discussed, of course. We could potentially also add a specific method for StateSpaceSet{1}
with a gentle reminder to the user that they have to convert their 1D state space set to a vector, if they've forgotten (EDIT: if they want the data to be embedded).
from complexitymeasures.jl.
Yep, seems reasonable. The method could look like something like this:
Looks good to me. Feel like doing the PR, @rusandris?
from complexitymeasures.jl.
We should probably also add a comment that ordinal pattern outcome spaces are only defined for m >= 2
, so they will never work with one-dimensional state space sets anyways (or something along those lines). I'm not sure if this is immediately obvious to a user that tries what you did and gets this warning.
from complexitymeasures.jl.
Related Issues (20)
- Dep compatibility issue between ComplexityMeasures (3.0.0) and DynamicalSystems (3.2.3). HOT 10
- ```genentropy``` is broken HOT 1
- Docstring and implementation for Statistical Complexity is wrong HOT 1
- `eachindex` for `Probabilities` is ambiguous HOT 3
- Signature for `Counts` and `Probabilities` docstrings has the wrong type parameter order HOT 3
- Missing deprecation for `OrdinalPatterns{m}(; τ)` HOT 10
- Some documentation issues for CI HOT 2
- The function `lt` in `OrdinalPatternEncoding` isn't actually used HOT 1
- Reproducibility for `OrdinalPatternEncoding` HOT 3
- It shouldn't be possible to construct an empty `CombinationEncoding` HOT 3
- Feature: "distribution entropy" HOT 3
- Feature: bubble entropy (description is WIP) HOT 4
- Feature: "increment entropy" HOT 1
- Feature: "attention entropy"
- `missing_probabilities` HOT 1
- `counts_and_outcomes` for `BubbleSortSwaps` should also accept state space sets
- Syntax with type parameter `{m}` in `OrdinalPatterns` is not harmonious with the rest of the library HOT 9
- Encoding using `Dispersion` is slower than necessary due to manual integration for normal cdf
- Encoding complex-valued data HOT 2
- [Q] How to calculate MI between two vectors? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from complexitymeasures.jl.