Class TimeSeriesData

java.lang.Object
edu.cmu.tetrad.data.TimeSeriesData
All Implemented Interfaces:
DataModel, KnowledgeTransferable, VariableSource, TetradSerializable, Serializable

public final class TimeSeriesData extends Object implements DataModel
Stores time series data as a list of continuous columns.
Author:
josephramsey
See Also:
  • Constructor Details

    • TimeSeriesData

      public TimeSeriesData(Matrix matrix, List<String> varNames)
      Constructs a new time series data contains for the given row-major data array and the given list of variables. Each row of the data, data[i], contains a measured for each variable (in order) for a particular time. The series of times is in increasing order.
  • Method Details

    • serializableInstance

      public static TimeSeriesData serializableInstance()
      Generates a simple exemplar of this class to test serialization.
    • getName

      public String getName()
      Specified by:
      getName in interface DataModel
      Returns:
      the name of the data model (may be null).
    • setName

      public void setName(String name)
      Description copied from interface: DataModel
      Sets the name of the data model (may be null).
      Specified by:
      setName in interface DataModel
    • isContinuous

      public boolean isContinuous()
      Specified by:
      isContinuous in interface DataModel
    • isDiscrete

      public boolean isDiscrete()
      Specified by:
      isDiscrete in interface DataModel
    • isMixed

      public boolean isMixed()
      Specified by:
      isMixed in interface DataModel
    • getVariable

      public Node getVariable(String name)
      Specified by:
      getVariable in interface DataModel
    • copy

      public DataModel copy()
      Specified by:
      copy in interface DataModel
    • getVariables

      public List<Node> getVariables()
      Description copied from interface: VariableSource
      Returns the list of variables associated with this object.
      Specified by:
      getVariables in interface VariableSource
      Returns:
      the list of variables associated with this object.
    • getKnowledge

      public Knowledge getKnowledge()
      Specified by:
      getKnowledge in interface KnowledgeTransferable
      Returns:
      a copy of the knowledge for this class.
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
      Description copied from interface: KnowledgeTransferable
      Sets knowledge to a copy of the given object.
      Specified by:
      setKnowledge in interface KnowledgeTransferable
    • getVariableNames

      public List<String> getVariableNames()
      Description copied from interface: VariableSource
      Returns the variable names associated with this getVariableNames.
      Specified by:
      getVariableNames in interface VariableSource
      Returns:
      (a copy of) the List of Variables for the data set, in the order of their columns.
    • getData

      public Matrix getData()
    • getNumTimePoints

      public int getNumTimePoints()
    • getNumVars

      public int getNumVars()
    • getDatum

      public double getDatum(int row, int col)