Skip to content

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.

julia
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
julia
AbstractTimeseries{T, N, B}

A type alias for an AbstractDimArray with a time index.

source
TimeseriesBase.TimeSeries.UnivariateTimeseries Type
julia
UnivariateTimeseries{T}

A type alias for a time series with one variable (a vector with only a Ti dimension).

source
TimeseriesBase.TimeSeries.MultivariateTimeseries Type
julia
MultivariateTimeseries{T}

A type alias for a multivariate time series (A matrix, with a first Ti dimension and an arbitrary second dimension).

source
TimeseriesBase.TimeSeries.RegularTimeseries Type
julia
RegularTimeseries{T, N, B}

A type alias for a regularly sampled time series.

source

Missing 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
julia
IrregularTimeseries

A type alias for a potentially irregularly sampled time series.

source
TimeseriesBase.TimeSeries.TimeIndex Type
julia
TimeIndex

A type alias for a tuple containing a time dimension and any number of other dimensions.

source
TimeseriesBase.TimeSeries.RegularIndex Type
julia
RegularIndex

A type alias for a regularly sampled dimension, wrapping an AbstractRange.

source
TimeseriesBase.TimeSeries.RegularTimeIndex Type
julia
RegularTimeIndex

A type alias for a tuple of dimensions containing a TimeIndex and any number of other dimensions.

source
TimeseriesBase.TimeSeries.IrregularIndex Type
julia
IrregularIndex

A type alias for an irregularly sampled dimension, wrapping an AbstractVector.

source
TimeseriesBase.TimeSeries.IrregularTimeIndex Type
julia
IrregularTimeIndex

A type alias for a tuple of dimensions containing a TimeIndex and any number of other dimensions.

source
TimeseriesBase.TimeSeries.Timeseries Function
julia
Timeseries(x, t)

Constructs a univariate time series with time t and data x.

Examples

@example
julia> using TimeseriesBase, Unitful;
julia> t = 1:100
julia> x = rand(100)
julia> ts = Timeseries(x, t)
julia> ts isa typeintersect(UnivariateTimeseries, RegularTimeseries)
source
julia
Timeseries(x, t, v)

Constructs a multivariate time series with time t, variable v, and data x.

Examples

@example
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)
source

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.

source

Missing 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.