Sliding-window (Takens delay) embedding of a time series into a point cloud: the point at time t is the window (x_t, x_{t+delay}, ..., x_{t+(dimension-1) delay}). A periodic signal traces a closed curve in the window space, so Persistence(TakensEmbedding(signal, dimension = 2, delay = quarterPeriod)) shows the period as a long bar of degree 1; a quasi-periodic one traces a torus.
The dimension and delay decide what the embedding shows: too small a delay flattens the curve onto a line, too large a one folds it. delayByAutocorrelation gives a first guess for the delay.
def apply(series: Seq[Double], dimension: Int, delay: Int = ..., stride: Int = ...): PointCloud
The windows of series of dimension samples delay apart, one for every stride-th start; the cloud has (series.length - (dimension - 1) * delay - 1) / stride + 1 points.
The windows of series of dimension samples delay apart, one for every stride-th start; the cloud has (series.length - (dimension - 1) * delay - 1) / stride + 1 points.
The first lag at which the autocorrelation of series is zero or negative (searching lags 1 to maxLag; maxLag itself when there is none): a rule of thumb for the delay. For a sinusoid it is a quarter of the period, the delay that turns a two-dimensional window into a round circle. Fails on a constant series, which has no autocorrelation.
The first lag at which the autocorrelation of series is zero or negative (searching lags 1 to maxLag; maxLag itself when there is none): a rule of thumb for the delay. For a sinusoid it is a quarter of the period, the delay that turns a two-dimensional window into a round circle. Fails on a constant series, which has no autocorrelation.
def multivariate(series: Seq[Seq[Double]], dimension: Int, delay: Int = ..., stride: Int = ...): PointCloud
The same for a series of vectors (one row per time step): each point is the dimension rows of a window, one after the other, so it has dimension * (row length) coordinates.
The same for a series of vectors (one row per time step): each point is the dimension rows of a window, one after the other, so it has dimension * (row length) coordinates.