Time series
The core type hierarchy. Every concrete time-series type is a subtype of AbstractTimeseries, specialised by regularity (regular vs irregular sampling) and dimensionality (univariate vs multivariate).
AbstractTimeseries
├── UnivariateTimeseries (1-D)
├── MultivariateTimeseries (N-D, time on first dimension)
├── RegularTimeseries (lookup is an AbstractRange)
│ ├── UnivariateRegular
│ └── MultivariateRegular
└── IrregularTimeseries (lookup is any sorted vector)The constructor is Timeseries: the first argument is the data, the second is the time lookup (or 𝑡(...)), and any further arguments are extra dimensions.
using TimeseriesTools
x = Timeseries(rand(100), 0.0:0.01:0.99) # regular, univariate
m = Timeseries(rand(100, 4), 0.0:0.01:0.99, Var(1:4)) # regular, multivariate
i = Timeseries(rand(50), sort(rand(50))) # irregular, univariate
x isa RegularTimeseries, m isa MultivariateRegular, i isa IrregularTimeseries(true, true, true)Time lookups can be plain numbers (Float64), unitful quantities (see Unitful integration), or DateTimes (see Dates).
SpikeTrain is a special irregular type whose values are absent: a spike train is fully specified by its time stamps. See Spike trains.
Reference
TimeseriesBase.TimeSeries.AbstractTimeseries Type
AbstractTimeseries{T, N, B}A type alias for an AbstractDimArray with a time index.
sourceTimeseriesBase.TimeSeries.UnivariateTimeseries Type
UnivariateTimeseries{T}A type alias for a time series with one variable (a vector with only a Ti dimension).
TimeseriesBase.TimeSeries.MultivariateTimeseries Type
MultivariateTimeseries{T}A type alias for a multivariate time series (A matrix, with a first Ti dimension and an arbitrary second dimension).
TimeseriesBase.TimeSeries.RegularTimeseries Type
RegularTimeseries{T, N, B}A type alias for a regularly sampled time series.
sourceMissing docstring.
Missing docstring for UnivariateRegular. Check Documenter's build log for details.
Missing docstring.
Missing docstring for MultivariateRegular. Check Documenter's build log for details.
TimeseriesBase.TimeSeries.IrregularTimeseries Type
IrregularTimeseriesA type alias for a potentially irregularly sampled time series.
sourceTimeseriesBase.TimeSeries.TimeIndex Type
TimeIndexA type alias for a tuple containing a time dimension and any number of other dimensions.
sourceTimeseriesBase.TimeSeries.RegularIndex Type
RegularIndexA type alias for a regularly sampled dimension, wrapping an AbstractRange.
TimeseriesBase.TimeSeries.RegularTimeIndex Type
RegularTimeIndexA type alias for a tuple of dimensions containing a TimeIndex and any number of other dimensions.
TimeseriesBase.TimeSeries.IrregularIndex Type
IrregularIndexA type alias for an irregularly sampled dimension, wrapping an AbstractVector.
TimeseriesBase.TimeSeries.IrregularTimeIndex Type
IrregularTimeIndexA type alias for a tuple of dimensions containing a TimeIndex and any number of other dimensions.
TimeseriesBase.TimeSeries.Timeseries Function
Timeseries(x, t)Constructs a univariate time series with time t and data x.
Examples
julia> using TimeseriesBase, Unitful;
julia> t = 1:100
julia> x = rand(100)
julia> ts = Timeseries(x, t)
julia> ts isa typeintersect(UnivariateTimeseries, RegularTimeseries)Timeseries(x, t, v)Constructs a multivariate time series with time t, variable v, and data x.
Examples
julia> t = 1:100;
julia> v = [:a, :b, :c];
julia> x = rand(100, 3);
julia> mts = Timeseries(x, t, v)
julia> mts isa typeintersect(MultivariateTimeseries, RegularTimeseries)Missing docstring.
Missing docstring for MultidimensionalIndex. Check Documenter's build log for details.
TimeseriesBase.TimeSeries.MultidimensionalTimeseries Type
A multidimensional time series has a regular sampling over a dimension other than time; a one-dimensional time series can be thought of as a field over an even grid in 1 dimension that fluctuates over time.
sourceMissing docstring.
Missing docstring for SpikeTrain. Check Documenter's build log for details.
Missing docstring.
Missing docstring for MultivariateSpikeTrain. Check Documenter's build log for details.
Missing docstring.
Missing docstring for UnivariateSpikeTrain. Check Documenter's build log for details.