public static GraphWithParameters regress(DataSet dataSet,Graph graph){
  SemPm semPmEstDag=new SemPm(graph);
  SemEstimator estimatorEstDag=new SemEstimator(dataSet,semPmEstDag);
  estimatorEstDag.estimate();
  SemIm semImEstDag=estimatorEstDag.getEstimatedSem();
  GraphWithParameters estimatedGraph=new GraphWithParameters(semImEstDag,graph);
  return estimatedGraph;
}

public static GraphWithParameters regress ( DataSet dataSet , Graph graph ) { SemPm semPmEstDag = new SemPm ( graph ) ; SemEstimator estimatorEstDag = new SemEstimator ( dataSet , semPmEstDag ) ; estimatorEstDag . estimate ( ) ; SemIm semImEstDag = estimatorEstDag . getEstimatedSem ( ) ; GraphWithParameters estimatedGraph = new GraphWithParameters ( semImEstDag , graph ) ; return estimatedGraph ; }
creates a patternwithparameters by running a regression , given a graph and data
