Skip to content

Commit ab2a1ef

Browse files
authored
Rename all "traditional" references to "separated" (#125)
* rename traditional to separated folder * rename `optimal_traditional_de` to separated * separate bundle function to dedicated block * use separated in docstring * bump version * correct usage of `end` in embedding tests * delete old file * rename to separated in tests as well * improve/clarify embedding tests * update docs to Juliadynamics style * correct length in embedding * update github actions * fix tests! * actually fix tests * remove failing test
1 parent 56c2537 commit ab2a1ef

File tree

18 files changed

+97
-335
lines changed

18 files changed

+97
-335
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ jobs:
2424
# Cancel ongoing CI test runs if pushing to branch again before the previous tests
2525
# have finished
2626
- name: Cancel ongoing test runs for previous commits
27-
uses: styfle/cancel-workflow-action@0.11.0
27+
uses: styfle/cancel-workflow-action@0.6.0
2828
with:
2929
access_token: ${{ github.token }}
3030

3131
# Do tests
32-
- uses: actions/checkout@v3
32+
- uses: actions/checkout@v2
3333
- uses: julia-actions/setup-julia@v1
3434
with:
3535
version: ${{ matrix.version }}
3636
arch: ${{ matrix.arch }}
37-
- uses: actions/cache@v3
37+
- uses: actions/cache@v1
3838
env:
3939
cache-name: cache-artifacts
4040
with:
@@ -45,8 +45,9 @@ jobs:
4545
${{ runner.os }}-test-
4646
${{ runner.os }}-
4747
- uses: julia-actions/julia-buildpkg@v1
48+
4849
- uses: julia-actions/julia-runtest@v1
4950
- uses: julia-actions/julia-processcoverage@v1
50-
- uses: codecov/codecov-action@v3
51+
- uses: codecov/codecov-action@v1
5152
with:
5253
file: lcov.info

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,17 @@ Now DelayEmbeddings.jl really is only about delay coordinate embedding methods.
6767
* `reconstruct` is deprecated in favor of `embed`.
6868

6969
# v1.12.0
70-
* Possible delay times in `optimal_traditional_de` are now `1:100` for increased accuracy.
70+
* Possible delay times in `optimal_separated_de` are now `1:100` for increased accuracy.
7171
* New method for univariate non-unified delay embedding by Hegger, Kantz
7272
* It is now possible to `embed` in one dimension (which just returns the vector as a StateSpaceSet)
73-
* New function `optimal_traditional_de` for automated delay embeddings
73+
* New function `optimal_separated_de` for automated delay embeddings
7474
* `delay_afnn, delay_ifnn, delay_fnn, delay_f1nn` are part of public API now.
7575
* The argument `γs` and the function `reconstruct` is starting to be phased out in
7676
favor of `ds` and `embed`.
7777
* Multi-timeseries via `reconstruct` or `embed` is deprecated in favor of using `genembed`.
7878

7979
## Deprecations
80-
* Using `estimate_dimension` is deprecated in favor of either calling `afnn, fnn, ...` directly or using the function `optimal_traditional_de`
80+
* Using `estimate_dimension` is deprecated in favor of either calling `afnn, fnn, ...` directly or using the function `optimal_separated_de`
8181

8282
# v1.11.0
8383
* Dropped RecipesBase

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DelayEmbeddings"
22
uuid = "5732040d-69e3-5649-938a-b6b4f237613f"
33
repo = "https://github.com/JuliaDynamics/DelayEmbeddings.jl.git"
4-
version = "2.7.1"
4+
version = "2.7.2"
55

66
[deps]
77
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"

docs/make.jl

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,22 @@
11
cd(@__DIR__)
22

3+
using DelayEmbeddings
4+
35
import Downloads
46
Downloads.download(
5-
"https://raw.githubusercontent.com/JuliaDynamics/doctheme/master/apply_style.jl",
6-
joinpath(@__DIR__, "apply_style.jl")
7+
"https://raw.githubusercontent.com/JuliaDynamics/doctheme/master/build_docs_with_style.jl",
8+
joinpath(@__DIR__, "build_docs_with_style.jl")
79
)
8-
include("apply_style.jl")
10+
include("build_docs_with_style.jl")
911

10-
using DelayEmbeddings
11-
12-
DelayEmbeddings_PAGES = [
12+
pages = [
1313
"index.md",
1414
"embed.md",
1515
"separated.md",
1616
"unified.md",
1717
]
1818

19-
makedocs(
20-
modules = [DelayEmbeddings, StateSpaceSets],
21-
format = Documenter.HTML(
22-
prettyurls = CI,
23-
assets = [
24-
asset("https://fonts.googleapis.com/css?family=Montserrat|Source+Code+Pro&display=swap", class=:css),
25-
],
26-
collapselevel = 3,
27-
),
28-
sitename = "DelayEmbeddings.jl",
29-
authors = "George Datseris",
30-
pages = DelayEmbeddings_PAGES,
31-
doctest = false,
32-
draft = false,
19+
build_docs_with_style(pages, DelayEmbeddings, StateSpaceSets;
20+
authors = "George Datseris <datseris.george@gmail.com>, Hauke Kraemer",
21+
expandfirst = ["index.md"], # this is the first script that loads colorscheme
3322
)
34-
35-
if CI
36-
deploydocs(
37-
repo = "github.com/JuliaDynamics/DelayEmbeddings.jl.git",
38-
target = "build",
39-
push_preview = true
40-
)
41-
end

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ There are two approaches for estimating optimal parameters to do delay embedding
1616
1. **Separated**, where one tries to find the best value for a delay time `τ` and then an optimal embedding dimension `d`.
1717
2. **Unified**, where at the same time an optimal combination of `τ, d` is found.
1818

19-
The separated approach is something "old school", while recent scientific research has shifted almost exclusively to unified approaches. This page describes algorithms belonging to the separated approach, which is mainly done by the function [`optimal_traditional_de`](@ref).
19+
The separated approach is something "old school", while recent scientific research has shifted almost exclusively to unified approaches. This page describes algorithms belonging to the separated approach, which is mainly done by the function [`optimal_separated_de`](@ref).
2020

2121
The unified approach is discussed in the [Unified optimal embedding](@ref) page.

docs/src/separated.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
# Separated optimal embedding
22
This page discusses and provides algorithms for estimating optimal parameters to do Delay Coordinates Embedding (DCE) with using the separated approach.
33

4+
## Automated function
5+
6+
```@docs
7+
optimal_separated_de
8+
```
9+
410
## Optimal delay time
11+
512
```@docs
613
estimate_delay
714
exponential_decay_fit
815
```
16+
917
### Self Mutual Information
1018

1119
```@docs
@@ -16,8 +24,8 @@ Notice that mutual information between two *different* timeseries x, y exists in
1624
It is also trivial to define it yourself using `entropy` from `ComplexityMeasures`.
1725

1826
## Optimal embedding dimension
27+
1928
```@docs
20-
optimal_traditional_de
2129
delay_afnn
2230
delay_ifnn
2331
delay_fnn
@@ -26,6 +34,7 @@ DelayEmbeddings.stochastic_indicator
2634
```
2735

2836
## Example
37+
2938
```@example MAIN
3039
using DelayEmbeddings, CairoMakie
3140
using DynamicalSystemsBase
@@ -50,7 +59,7 @@ ax = Axis(fig[1,1]; xlabel = "embedding dimension", ylabel = "estimator")
5059
for (i, method) in enumerate(["afnn", "fnn", "f1nn", "ifnn"])
5160
# Plot statistic used to estimate optimal embedding
5261
# as well as the automated output embedding
53-
𝒟, τ, E = optimal_traditional_de(x, method; dmax)
62+
𝒟, τ, E = optimal_separated_de(x, method; dmax)
5463
lines!(ax, 1:dmax, E; label = method, marker = :circle, color = Cycled(i))
5564
optimal_d = size(𝒟, 2)
5665
## Scatter the optimal embedding dimension as a lager marker

src/DelayEmbeddings.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ using Reexport
1313
include("embeddings/embed.jl")
1414
include("embeddings/genembed.jl")
1515
include("utils.jl")
16-
include("traditional_de/estimate_delay.jl")
17-
include("traditional_de/estimate_dimension.jl")
18-
include("traditional_de/automated.jl")
16+
include("separated_de/estimate_delay.jl")
17+
include("separated_de/estimate_dimension.jl")
18+
include("separated_de/automated.jl")
1919

2020
include("unified_de/pecora.jl")
2121
include("unified_de/uzal_cost.jl")

src/deprecate.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@deprecate optimal_traditional_de optimal_separated_de

src/embeddings/genembed.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export GeneralizedEmbedding, genembed
55

66
"""
77
GeneralizedEmbedding(τs, js = ones(length(τs)), ws = nothing) -> `embedding`
8+
89
Return a delay coordinates embedding structure to be used as a function.
910
Given a timeseries *or* trajectory (i.e. `StateSpaceSet`) `s` and calling
1011
```julia
@@ -82,7 +83,8 @@ max(1, (-minimum(ge.τs) + 1)):min(length(s), length(s) - maximum(ge.τs))
8283

8384

8485
"""
85-
genembed(s, τs, js = ones(...); ws = nothing) → dataset
86+
genembed(s, τs, js = ones(...); ws = nothing) → ssset
87+
8688
Create a generalized embedding of `s` which can be a timeseries or arbitrary `StateSpaceSet`,
8789
and return the result as a new `StateSpaceSet`.
8890
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
export optimal_traditional_de
1+
export optimal_separated_de
22

33
"""
4-
optimal_traditional_de(s, method = "afnn", dmethod = "mi_min"; kwargs...) → 𝒟, τ, E
4+
optimal_separated_de(s, method = "afnn", dmethod = "mi_min"; kwargs...) → 𝒟, τ, E
55
66
Produce an optimal delay embedding `𝒟` of the given timeseries `s` by
7-
using the traditional approach of first finding an optimal (and constant) delay
7+
using the *separated* approach of first finding an optimal (and constant) delay
88
time using [`estimate_delay`](@ref) with the given `dmethod`, and then an optimal
99
embedding dimension, by calculating an appropriate statistic for each dimension `d ∈ 1:dmax`.
1010
Return the embedding `𝒟`, the optimal delay time `τ`
@@ -34,7 +34,8 @@ For more details, see individual methods: [`delay_afnn`](@ref), [`delay_ifnn`](@
3434
you should directly calculate the statistic and plot its values versus the
3535
dimensions.
3636
37-
## Keyword Arguments
37+
## Keyword arguments
38+
3839
The keywords
3940
```julia
4041
τs = 1:100, dmax = 10
@@ -51,6 +52,7 @@ w, rtol, atol, τs, metric, r
5152
```
5253
5354
## Description
55+
5456
We estimate the optimal embedding dimension based on the given delay time gained
5557
from `dmethod` as follows: For Cao's method the optimal dimension is reached,
5658
when the slope of the `E₁`-statistic (output from `"afnn"`) falls below the
@@ -74,7 +76,7 @@ See also the file `test/compare_different_dimension_estimations.jl` for a compar
7476
7577
[^Hegger1999]: Hegger & Kantz, [Improved false nearest neighbor method to detect determinism in time series data. Physical Review E 60, 4970](https://doi.org/10.1103/PhysRevE.60.4970).
7678
"""
77-
function optimal_traditional_de(s::AbstractVector, dimensionmethod::String = "afnn",
79+
function optimal_separated_de(s::AbstractVector, dimensionmethod::String = "afnn",
7880
delaymethod::String= "mi_min";
7981
fnn_thres::Real = 0.05, slope_thres::Real = .05, dmax::Int = 10, w::Int=1,
8082
rtol=10.0, atol=2.0, τs = 1:100, metric = Euclidean(), r::Real=2.0,
@@ -84,7 +86,6 @@ function optimal_traditional_de(s::AbstractVector, dimensionmethod::String = "af
8486
@assert dimensionmethod ("afnn", "fnn", "ifnn", "f1nn")
8587
τ = estimate_delay(s, delaymethod, τs)
8688
ds = 1:dmax
87-
γs = ds .- 1 # TODO: This must be updated to dimension in 2.0
8889

8990
if dimensionmethod=="afnn"
9091
dimension_statistic = delay_afnn(s, τ, ds; metric, w)

0 commit comments

Comments
 (0)