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.doublegetDatum(int row, int col) getDatum.Getter for the fieldknowledge.getName()Getter for the fieldname.intgetNumTimePoints.intgetNumVars.getVariable(String name) getVariable.getVariableNames.getVariables.booleanisContinuous.booleanisDiscrete.booleanisMixed()isMixed.static TimeSeriesDataGenerates a simple exemplar of this class to test serialization.voidsetKnowledge(Knowledge knowledge) Sets knowledge to a copy of the given object.voidSets 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
TimeSeriesDataobject
-
getName
-
setName
-
isContinuous
public boolean isContinuous()isContinuous.
- Specified by:
isContinuousin interfaceDataModel- Returns:
- true if the data model is continuous, false otherwise.
-
isDiscrete
public boolean isDiscrete()isDiscrete.
- Specified by:
isDiscretein interfaceDataModel- Returns:
- true if the data model is discrete, false otherwise.
-
isMixed
-
getVariable
getVariable.
- Specified by:
getVariablein interfaceDataModel- Parameters:
name- aStringobject- Returns:
- the variable with the given name, or null if no such variable exists.
-
copy
-
getVariables
getVariables.
- Specified by:
getVariablesin interfaceVariableSource- Returns:
- a
Listobject
-
getKnowledge
Getter for the field
knowledge.- Specified by:
getKnowledgein interfaceKnowledgeTransferable- Returns:
- a
Knowledgeobject
-
setKnowledge
Sets knowledge to a copy of the given object.- Specified by:
setKnowledgein interfaceKnowledgeTransferable- Parameters:
knowledge- the knowledge to set
-
getVariableNames
getVariableNames.
- Specified by:
getVariableNamesin 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
-