diff --git a/Project.toml b/Project.toml index 47e265e..521b89b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "FractalDimensions" uuid = "4665ce21-e117-4649-aed8-08bbe5ccbead" authors = ["George Datseris ", "Ignacio Del Amo <@PythagoreanCult>", "Anton P Braun"] -version = "1.8.1" +version = "1.8.2" [deps] ComplexityMeasures = "ab4b797d-85ee-42ba-b621-05d793b346a2" @@ -19,7 +19,7 @@ StateSpaceSets = "40b095a5-5852-4c12-98c7-d43bf788e795" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [compat] -ComplexityMeasures = "2.8, 3" +ComplexityMeasures = "3" Distances = "0.10" Distributions = "0.24, 0.25" HypothesisTests = "0.11" @@ -30,6 +30,6 @@ Reexport = "1" Roots = "1, 2" Scratch = "1" SpecialFunctions = "1, 2" -StateSpaceSets = "1" +StateSpaceSets = "2" Statistics = "1" julia = "1.5" diff --git a/docs/make.jl b/docs/make.jl index 3350d94..17a4422 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -21,5 +21,5 @@ bib = CitationBibliography( ) build_docs_with_style(FRACTALDIMENSION_PAGES, FractalDimensions, ComplexityMeasures, StateSpaceSets; - expandfirst = ["index.md"], bib, + expandfirst = ["index.md"], bib, warnonly = [:cross_references, :doctest, :missing_docs], ) diff --git a/docs/src/index.md b/docs/src/index.md index aaed4bf..cd805e4 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -91,8 +91,16 @@ The whole above pipeline we went through is bundled in [`grassberger_proccacia_d ```@docs slopefit LinearRegression +linreg +``` + +```@docs LargestLinearRegion linear_regions +linear_region +``` + +```@docs AllSlopesDistribution estimate_boxsizes minimum_pairwise_distance @@ -100,7 +108,7 @@ minimum_pairwise_distance ## Generalized (entropy) dimension -Based on the definition of the Generalized entropy ([`genentropy`](@ref)), one can calculate an appropriate dimension, called *generalized dimension*: +Based on the definition of the generalized (Renyi) entropy, one can calculate an appropriate dimension, called *generalized dimension*: ```@docs generalized_dim molteno_dim @@ -173,6 +181,7 @@ extremevaltheory_gpdfit_pvalues ### Block-maxima estimator ```@docs BlockMaxima +estimate_gev_parameters ``` ## Theiler window diff --git a/docs/style.jl b/docs/style.jl index 8429fd5..691fffa 100644 --- a/docs/style.jl +++ b/docs/style.jl @@ -1,4 +1,4 @@ -# %% Color theme definitions +# Color theme definitions struct CyclicContainer <: AbstractVector{String} c::Vector{String} n::Int @@ -17,23 +17,22 @@ end Base.iterate(c::CyclicContainer, i = 1) = iterate(c.c, i) COLORSCHEME = [ - "#6D44D0", - "#2CB3BF", - "#1B1B1B", - "#DA5210", - "#03502A", - "#866373", + "#7143E0", + "#191E44", + "#0A9A84", + "#AF9327", + "#791457", + "#6C768C", ] COLORS = CyclicContainer(COLORSCHEME) LINESTYLES = CyclicContainer(["-", ":", "--", "-."]) -# %% Makie styling # other styling elements for Makie set_theme!(; palette = (color = COLORSCHEME,), fontsize = 22, - figure_padding = 4, - resolution = (1000, 500), + figure_padding = 8, + size = (800, 400), linewidth = 3.0, ) diff --git a/src/corrsum_based/correlationsum_boxassisted.jl b/src/corrsum_based/correlationsum_boxassisted.jl index 459bccd..6f01249 100644 --- a/src/corrsum_based/correlationsum_boxassisted.jl +++ b/src/corrsum_based/correlationsum_boxassisted.jl @@ -62,7 +62,7 @@ exact to the original [`correlationsum`](@ref). For any other `P`, some point pairs that should have been included may be skipped due to having smaller distance in the remaining dimensions, but larger distance in the first `P` dimensions. """ -function boxed_correlationsum(X; P = 2, kwargs...) +function boxed_correlationsum(X::AbstractStateSpaceSet; P = 2, kwargs...) P = min(P, dimension(X)) r0, ε0 = estimate_r0_buenoorovio(X, P) εs = 2.0 .^ range(log2(ε0), log2(r0); length = 16) @@ -75,7 +75,7 @@ boxed_correlationsum(X, e::Real, r0 = e; kwargs...) = boxed_correlationsum(X, [e function boxed_correlationsum( X, εs, r0 = maximum(εs); q = 2, P = 2, kwargs... ) - P ≤ size(X, 2) || error("Prism dimension has to be ≤ than `X` dimension.") + P ≤ dimension(X) || error("Prism dimension has to be ≤ than `X` dimension.") issorted(εs) || error("Sorted `εs` required for optimized version.") if r0 < maximum(εs) @warn("Box size `r0` has to be ≥ than `maximum(εs)`.") @@ -358,7 +358,7 @@ using Random: shuffle! Estimate a reasonable size for boxing `X`, proposed by Bueno-Orovio and Pérez-García [BuenoOrovio2007](@cite), before calculating the correlation -dimension as presented by [Theiler1983](@cite). +dimension as presented by [Theiler1987](@cite). Return the size `r0` and the minimum interpoint distance `ε0` in the data. If instead of boxes, prisms diff --git a/src/corrsum_based/correlationsum_vanilla.jl b/src/corrsum_based/correlationsum_vanilla.jl index e600303..a8fb70c 100644 --- a/src/corrsum_based/correlationsum_vanilla.jl +++ b/src/corrsum_based/correlationsum_vanilla.jl @@ -21,7 +21,7 @@ i.e. it calculates [`correlationsum`](@ref) for various radii and then tries to a linear region in the plot of the log of the correlation sum versus log(ε). See [`correlationsum`](@ref) for the available keywords. -See also [`takens_best_estimate`](@ref), [`boxassisted_correlation_dim`](@ref). +See also [`takens_best_estimate_dim`](@ref), [`boxassisted_correlation_dim`](@ref). """ function grassberger_proccacia_dim(X::AbstractStateSpaceSet, εs = estimate_boxsizes(X); kwargs...) cm = correlationsum(X, εs; kwargs...) diff --git a/src/extremes_based/confidence.jl b/src/extremes_based/confidence.jl index 6b59c00..9471eea 100644 --- a/src/extremes_based/confidence.jl +++ b/src/extremes_based/confidence.jl @@ -113,7 +113,7 @@ function gpd_nrmse(E, gpd, nbins) # Compute histogram of E bins = range(0, nextfloat(maximum(E), 2); length = nbins) binning = FixedRectangularBinning(bins) - allprobs = allprobabilities(ValueHistogram(binning), E) + allprobs = allprobabilities_and_outcomes(ValueHistogram(binning), E)[1] width = step(bins) # We will calcuate the GPD pdf at the midpoint of each bin diff --git a/src/extremes_based/gpd.jl b/src/extremes_based/gpd.jl index 983ae74..f713925 100644 --- a/src/extremes_based/gpd.jl +++ b/src/extremes_based/gpd.jl @@ -63,7 +63,7 @@ Estimate and return the parameters `σ, ξ` of a Generalized Pareto Distribution fit to `X` (which typically is the exceedances of the log distance of a state space set), assuming that `minimum(X) ≥ 0` and hence the parameter `μ` is 0 (if not, simply shift `X` by its minimum), according to the methods provided -in [Pons2023](@ref). +in [Pons2023](@cite). The estimator can be: diff --git a/src/linear_fits/estimate_boxsizes.jl b/src/linear_fits/estimate_boxsizes.jl index b50b227..d7a3a64 100644 --- a/src/linear_fits/estimate_boxsizes.jl +++ b/src/linear_fits/estimate_boxsizes.jl @@ -4,7 +4,7 @@ export estimate_boxsizes estimate_boxsizes(X::AbstractStateSpaceSet; kwargs...) → εs Return `k` exponentially spaced values: `εs = base .^ range(lower + w, upper + z; length = k)`, -that are a good estimate for sizes ε that are used in calculating a [Fractal Dimension](@ref). +that are a good estimate for sizes ε that are used in calculating a fractal Dimension. It is strongly recommended to [`standardize`](@ref) input dataset before using this function.