Open sbulcsu opened 6 months ago
Maybe we should resort to something simple like this:
function timeseries_to_grid(timeseries::TimeSeries{T,1}, partition::Function) where T <: Real
L = length(timeseries)
symbolic_timeseries = Vector{Int64}(undef, L)
for i in 1:L
symbolic_timeseries[i] = partition(timeseries[i][1])
end
return symbolic_timeseries
end
allowing the total control over the partitioning scheme.
And then one can go
using StateTransitionNetworks,DynamicalSystems
function f(u, p, n)
r = p[1]
x = u[1]
if x<=r
return SVector(x/r)
else
return SVector((1-x)/(1-r))
end
end
r = 0.99
ds = DeterministicIteratedMap(f, [0.4], [r])
orbit,t = trajectory(ds,10^4;Ttr=1000)
tent_generating_partition(x::Float64,r::Float64) = x <= r ? 1 : 2
sts = timeseries_to_grid(orbit,x -> tent_generating_partition(x,r))
timeseries_to_grid
methods that dispatch to partition::Function
were pushed. We should think about implementing all previous gridding through this kind of method.
The
timeseries_to_grid
function should be able to generate a symbolic time series for predefined cell edges as well (e.g. generating partitions or Voronoi cells).We could do something like this (assuming an ordered
cell_edges
list):This is extremely slow, but we need to find the right cell for the actual state of the system.