public TimeSeriesData(TetradMatrix matrix,List<String> varNames){
  if (matrix == null) {
    throw new NullPointerException("Data must not be null.");
  }
  if (varNames == null) {
    throw new NullPointerException("Variables must not be null.");
  }
  for (int i=0; i < varNames.size(); i++) {
    if (varNames.get(i) == null) {
      throw new NullPointerException("Variable at index " + i + "is null.");
    }
  }
  this.data2=matrix;
  if (varNames.size() != matrix.columns()) {
    throw new IllegalArgumentException("Number of columns in the data " + "must match the number of variables.");
  }
  this.varNames=varNames;
  this.name="Time Series Data";
}

public TimeSeriesData ( TetradMatrix matrix , List < String > varNames ) { if ( matrix == null ) { throw new NullPointerException ( "Data must not be null." ) ; } if ( varNames == null ) { throw new NullPointerException ( "Variables must not be null." ) ; } for ( int i = 0 ; i < varNames . size ( ) ; i ++ ) { if ( varNames . get ( i ) == null ) { throw new NullPointerException ( "Variable at index " + i + "is null." ) ; } } this . data2 = matrix ; if ( varNames . size ( ) != matrix . columns ( ) ) { throw new IllegalArgumentException ( "Number of columns in the data " + "must match the number of variables." ) ; } this . varNames = varNames ; this . name = "Time Series Data" ; }
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 .
