SciML/RecursiveArrayTools.jl

Provide generic Time Series datatype

bertini97 opened this issue · 8 comments

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

I need an object that stores a vector of arrays and the corresponding times, in a way that it can be indexed as a matrix. This package, and in general DiffEqArray is perfect. However, it's missing interpolation, and it seems tied to the DiffEq packages.

Describe the solution you’d like

Having a type AbstractTimeSeries, for example, that:

  • Represents all object of this kind
  • Implements methods such us interpolation (e.g. ats(t), ats(out, t), etc). these methods can be further specialized for ODEs, or when the derivative is known
  • Can be indexed as a matrix, etc.
  • Has a concrete type TimeSeries that can be constructed just from u, t

I think SciML has such abstract type, but up to my knowledge it's not interpolable nor constructable.

Additional context

Packages like ReservoirComputing.jl could make use of a type like this to store a solution, which is not necessary an ODE.

If what I need is already in place, please inform me and I'll close this right away.

If DiffEqArray is an AbstractTimeSeries, then it can't be an AbstractVectorOfArray, unless AbstractTimeSeries <: AbstractVectorOfArray. Would that be acceptable in general? If so, then defining this interface would be a good idea.

If DiffEqArray is an AbstractTimeSeries, then it can't be an AbstractVectorOfArray, unless AbstractTimeSeries <: AbstractVectorOfArray. Would that be acceptable in general? If so, then defining this interface would be a good idea.

Yes, this is what I was thinking.

Then I'd be happy to accept a PR that defines this interface.

Implements methods such us interpolation (e.g. ats(t), ats(out, t), etc). these methods can be further specialized for ODEs, or when the derivative is known

Does the DiffEqArray? I'm not sure it has a linear interpolation or whatnot by default, but it could be added.

Then I'd be happy to accept a PR that defines this interface.

I'll try to write something. Ideally it would be something that will supertype AbstractODESolution, but that uses it's own InterpolationData structure. Do you have any suggestions design wise? I'm somewhat new to Julia and SciML.

Does the DiffEqArray? I'm not sure it has a linear interpolation or whatnot by default, but it could be added.

It doesn't as far as I know, but I only tried with u(t). You can still interpolate manually with the infrastructure already in place, I think in interpolation.jl in SciMLBase.

I'll try to write something. Ideally it would be something that will supertype AbstractODESolution, but that uses it's own InterpolationData structure. Do you have any suggestions design wise?

I'd make the interpolation optional based on having the call defined, and leave it open to interpretation how to implement it, and have a function to query if something can interpolate.

Note to self or whoever tries this. Another great addition would be plotting recipes. Something like basic plotting of the TimeSeries' u vs t, and when the series is an ODESolution it can be further specialized with dense, etc.