Package edu.cmu.tetrad.data
Class TimeSeriesData
java.lang.Object
edu.cmu.tetrad.data.TimeSeriesData
- All Implemented Interfaces:
DataModel
,KnowledgeTransferable
,VariableSource
,TetradSerializable
,Serializable
Stores time series data as a list of continuous columns.
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTimeSeriesData
(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. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
copy.getData()
getData.double
getDatum
(int row, int col) getDatum.Getter for the fieldknowledge
.getName()
Getter for the fieldname
.int
getNumTimePoints.int
getNumVars.getVariable
(String name) getVariable.getVariableNames.getVariables.boolean
isContinuous.boolean
isDiscrete.boolean
isMixed()
isMixed.static TimeSeriesData
Generates a simple exemplar of this class to test serialization.void
setKnowledge
(Knowledge knowledge) Sets knowledge to a copy of the given object.void
Sets the name of the data model (may be null).
-
Constructor Details
-
TimeSeriesData
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
Generates a simple exemplar of this class to test serialization.- Returns:
- a
TimeSeriesData
object
-
getName
-
setName
-
isContinuous
public boolean isContinuous()isContinuous.
- Specified by:
isContinuous
in interfaceDataModel
- Returns:
- true if the data model is continuous, false otherwise.
-
isDiscrete
public boolean isDiscrete()isDiscrete.
- Specified by:
isDiscrete
in interfaceDataModel
- Returns:
- true if the data model is discrete, false otherwise.
-
isMixed
-
getVariable
getVariable.
- Specified by:
getVariable
in interfaceDataModel
- Parameters:
name
- aString
object- Returns:
- the variable with the given name, or null if no such variable exists.
-
copy
-
getVariables
getVariables.
- Specified by:
getVariables
in interfaceVariableSource
- Returns:
- a
List
object
-
getKnowledge
Getter for the field
knowledge
.- Specified by:
getKnowledge
in interfaceKnowledgeTransferable
- Returns:
- a
Knowledge
object
-
setKnowledge
Sets knowledge to a copy of the given object.- Specified by:
setKnowledge
in interfaceKnowledgeTransferable
- Parameters:
knowledge
- the knowledge to set
-
getVariableNames
getVariableNames.
- Specified by:
getVariableNames
in interfaceVariableSource
- Returns:
- (a copy of) the List of Variables for the data set, in the order of their columns.
-
getData
-
getNumTimePoints
public int getNumTimePoints()getNumTimePoints.
- Returns:
- an int
-
getNumVars
public int getNumVars()getNumVars.
- Returns:
- an int
-
getDatum
public double getDatum(int row, int col) getDatum.
- Parameters:
row
- an intcol
- an int- Returns:
- a double
-