JuliaDynamics / TimeseriesSurrogates.jl

A Julia package for generating timeseries surrogates
https://juliadynamics.github.io/TimeseriesSurrogates.jl/stable/
Other
46 stars 8 forks source link

Multidimensional version of `RandomShuffle` and `BlockShuffle`. #136

Open kahaaga opened 1 year ago

kahaaga commented 1 year ago

Is your feature request related to a problem? Please describe.

It would be nice to have more surrogate methods that operate on multidimensional input data. This becomes necessary in conditional independence testing for multivariate data, for example in the context of conditional mutual information with high-dimensional marginal spaces.

Currently, we only have the ShuffleDimensions multivariate surrogate, but shuffling the dimensions is not the desired behaviour when, for example, one wants to break temporal associations.

Describe the solution you'd like

The RandomShuffle and BlockShuffle surrogate methods can be straight-forwardly extended to multivariate Datasets (from the StateSpaceSets package) Since these methods just permute the indices of the datasets, they can also be used to shuffle the SVectors of a Dataset.

Implementation strategy

This should be pretty easy to implement. It is just a matter of allocating the proper re-useable storage container in the SurrogateGenerator struct. Instead of enforcing surrogenerator(x::AbstractVector, rf::RandomShuffle, args...), the first argument should be allowed to be any iterable surrogenerator(x, rf::RandomShuffle, args...) and similar(x)/copy(x) should be used to allocate the re-usable container.

kahaaga commented 1 year ago

Further info: AbstractDataset/Dataset is found in the StateSpaceSets.jl package. However, these types are going to change names in the StateSpaceSets.jl, so whoever implements need to use the correct name for the datasets.