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.
- 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()
getData()
double
getDatum
(int row, int col) getName()
int
int
getVariable
(String name) Returns the variable names associated with this getVariableNames.Returns the list of variables associated with this object.boolean
boolean
boolean
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. -
getName
-
setName
Description copied from interface:DataModel
Sets the name of the data model (may be null). -
isContinuous
public boolean isContinuous()- Specified by:
isContinuous
in interfaceDataModel
-
isDiscrete
public boolean isDiscrete()- Specified by:
isDiscrete
in interfaceDataModel
-
isMixed
public boolean isMixed() -
getVariable
- Specified by:
getVariable
in interfaceDataModel
-
copy
-
getVariables
Description copied from interface:VariableSource
Returns the list of variables associated with this object.- Specified by:
getVariables
in interfaceVariableSource
- Returns:
- the list of variables associated with this object.
-
getKnowledge
- Specified by:
getKnowledge
in interfaceKnowledgeTransferable
- Returns:
- a copy of the knowledge for this class.
-
setKnowledge
Description copied from interface:KnowledgeTransferable
Sets knowledge to a copy of the given object.- Specified by:
setKnowledge
in interfaceKnowledgeTransferable
-
getVariableNames
Description copied from interface:VariableSource
Returns the variable names associated with this 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() -
getNumVars
public int getNumVars() -
getDatum
public double getDatum(int row, int col)
-