Class MultivariateGenericTimeTimeSeries<T extends Comparable<? super T>>

java.lang.Object
dev.nm.stat.timeseries.datastructure.multivariate.MultivariateGenericTimeTimeSeries<T>
Type Parameters:
T - the timestamp type
All Implemented Interfaces:
MultivariateTimeSeries<T,MultivariateTimeSeries.Entry<T>>, TimeSeries<T,Vector,MultivariateTimeSeries.Entry<T>>, Iterable<MultivariateTimeSeries.Entry<T>>

public class MultivariateGenericTimeTimeSeries<T extends Comparable<? super T>> extends Object implements MultivariateTimeSeries<T,MultivariateTimeSeries.Entry<T>>
This is a multivariate time series indexed by some notion of time. This implementation explicitly remembers all data in memory. It is appropriate for a short time series.
See Also:
  • Constructor Details

    • MultivariateGenericTimeTimeSeries

      public MultivariateGenericTimeTimeSeries(T[] timestamps, Vector[] values)
      Construct a multivariate time series from timestamps and vectors.
      Parameters:
      timestamps - the timestamps
      values - the vector values
    • MultivariateGenericTimeTimeSeries

      public MultivariateGenericTimeTimeSeries(T[] timestamps, double[][] values)
      Construct a multivariate time series from timestamps and vectors.
      Parameters:
      timestamps - the timestamps
      values - the vector values
    • MultivariateGenericTimeTimeSeries

      public MultivariateGenericTimeTimeSeries(T[] timestamps, Matrix values)
      Construct a multivariate time series from timestamps and vectors.
      Parameters:
      timestamps - the timestamps
      values - the vector values
  • Method Details

    • dimension

      public int dimension()
      Description copied from interface: MultivariateTimeSeries
      Get the dimension of the multivariate time series.
      Specified by:
      dimension in interface MultivariateTimeSeries<T extends Comparable<? super T>,MultivariateTimeSeries.Entry<T extends Comparable<? super T>>>
      Returns:
      the multivariate time series dimension
    • size

      public int size()
      Description copied from interface: TimeSeries
      Get the length of the time series.
      Specified by:
      size in interface TimeSeries<T extends Comparable<? super T>,Vector,MultivariateTimeSeries.Entry<T extends Comparable<? super T>>>
      Returns:
      the time series length
    • iterator

      Specified by:
      iterator in interface Iterable<T extends Comparable<? super T>>
    • toMatrix

      public Matrix toMatrix()
      Description copied from interface: MultivariateTimeSeries
      Convert this multivariate time series into an m x n matrix, where m is the dimension, and n the length.
      Specified by:
      toMatrix in interface MultivariateTimeSeries<T extends Comparable<? super T>,MultivariateTimeSeries.Entry<T extends Comparable<? super T>>>
      Returns:
      the matrix representation of this time series
    • toArray

      public Vector[] toArray()
      Convert this multivariate time series into an array of vectors.
      Returns:
      the array representation of this time series
    • get

      public Vector get(int i)
      Get the i-th value.
      Parameters:
      i - the position index
      Returns:
      the i-th value
    • time

      public T time(int i)
      Get the i-th timestamp.
      Parameters:
      i - the position index
      Returns:
      the i-th timestamp
    • timestamps

      public T[] timestamps()
      Get all the timestamps.
      Returns:
      the timestamps
    • drop

      public MultivariateGenericTimeTimeSeries<T> drop(int nItems)
      Construct an instance of MultivariateGenericTimeTimeSeries by dropping the leading nItems entries, those most backward in time entries.
      Parameters:
      nItems - the number of leading entries to be dropped
      Returns:
      an instance of MultivariateGenericTimeTimeSeries
    • diff

      public MultivariateGenericTimeTimeSeries<T> diff(int d)
      Construct an instance of MultivariateGenericTimeTimeSeries by taking the first difference d times.
      Parameters:
      d - the number of differences
      Returns:
      diff(x, lag = 1, differences = d) as in DoubleUtils
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object