diff --git a/README b/README index 9dbb319cac..84a9e38641 100644 --- a/README +++ b/README @@ -8,7 +8,7 @@ https://s01.oss.sonatype.org/content/repositories/releases/io/github/cmu-phil/ The jar to launch the Tetrad GUI is here (please download this one and delete any old ones): -https://s01.oss.sonatype.org/content/repositories/releases/io/github/cmu-phil/tetrad-gui/7.2.0/tetrad-gui-7.2.0-launch.jar +https://s01.oss.sonatype.org/content/repositories/releases/io/github/cmu-phil/tetrad-gui/7.2.1/tetrad-gui-7.2.1-launch.jar The application will work on all major platforms once a recent version of the Java JRE is installed. (Corretto 18 is fine, for instance.) You may be able to launch it by double clicking the jar file name, though on a Mac, this presents some security challenges-- diff --git a/data-reader/pom.xml b/data-reader/pom.xml index 26c3d72495..b7800db80f 100644 --- a/data-reader/pom.xml +++ b/data-reader/pom.xml @@ -5,7 +5,7 @@ io.github.cmu-phil tetrad - 7.2.1 + 7.2.2 data-reader diff --git a/pom.xml b/pom.xml index 8b5c0feb0f..d66e1d887f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 io.github.cmu-phil tetrad - 7.2.1 + 7.2.2 pom Tetrad Project @@ -132,6 +132,7 @@ org.apache.maven.plugins maven-site-plugin + 3.12.0 org.apache.velocity diff --git a/tetrad-gui/pom.xml b/tetrad-gui/pom.xml index 884ff8910f..3bb8e5a0f1 100644 --- a/tetrad-gui/pom.xml +++ b/tetrad-gui/pom.xml @@ -6,7 +6,7 @@ io.github.cmu-phil tetrad - 7.2.1 + 7.2.2 tetrad-gui diff --git a/tetrad-lib/pom.xml b/tetrad-lib/pom.xml index 7b3611392f..4a329fa458 100644 --- a/tetrad-lib/pom.xml +++ b/tetrad-lib/pom.xml @@ -6,7 +6,7 @@ io.github.cmu-phil tetrad - 7.2.1 + 7.2.2 tetrad-lib diff --git a/tetrad-lib/src/main/java/edu/cmu/tetrad/algcomparison/algorithm/mixed/Mgm.java b/tetrad-lib/src/main/java/edu/cmu/tetrad/algcomparison/algorithm/mixed/Mgm.java index cd457b6c6b..c8b59cb3b6 100644 --- a/tetrad-lib/src/main/java/edu/cmu/tetrad/algcomparison/algorithm/mixed/Mgm.java +++ b/tetrad-lib/src/main/java/edu/cmu/tetrad/algcomparison/algorithm/mixed/Mgm.java @@ -33,6 +33,10 @@ public Mgm() { @Override public Graph search(DataModel ds, Parameters parameters) { + if (!(ds instanceof DataSet)) { + throw new IllegalArgumentException("Expecting tabular data for MGM."); + } + DataSet _data = (DataSet) ds; for (int j = 0; j < _data.getNumColumns(); j++) { diff --git a/tetrad-lib/src/main/java/edu/cmu/tetrad/algcomparison/algorithm/oracle/pag/CCD.java b/tetrad-lib/src/main/java/edu/cmu/tetrad/algcomparison/algorithm/oracle/pag/CCD.java index e60fa7ef68..c31da6d72f 100644 --- a/tetrad-lib/src/main/java/edu/cmu/tetrad/algcomparison/algorithm/oracle/pag/CCD.java +++ b/tetrad-lib/src/main/java/edu/cmu/tetrad/algcomparison/algorithm/oracle/pag/CCD.java @@ -5,6 +5,7 @@ import edu.cmu.tetrad.algcomparison.utils.TakesIndependenceWrapper; import edu.cmu.tetrad.annotation.AlgType; import edu.cmu.tetrad.annotation.Bootstrapping; +import edu.cmu.tetrad.annotation.Experimental; import edu.cmu.tetrad.data.DataModel; import edu.cmu.tetrad.data.DataSet; import edu.cmu.tetrad.data.DataType; @@ -27,6 +28,7 @@ algoType = AlgType.forbid_latent_common_causes ) @Bootstrapping +@Experimental public class CCD implements Algorithm, TakesIndependenceWrapper { static final long serialVersionUID = 23L; private IndependenceWrapper test; diff --git a/tetrad-lib/src/main/java/edu/cmu/tetrad/algcomparison/algorithm/oracle/pag/PagSamplingRfci.java b/tetrad-lib/src/main/java/edu/cmu/tetrad/algcomparison/algorithm/oracle/pag/PagSamplingRfci.java index 076dbdb647..8d927198fb 100644 --- a/tetrad-lib/src/main/java/edu/cmu/tetrad/algcomparison/algorithm/oracle/pag/PagSamplingRfci.java +++ b/tetrad-lib/src/main/java/edu/cmu/tetrad/algcomparison/algorithm/oracle/pag/PagSamplingRfci.java @@ -29,7 +29,7 @@ command = "pag-sampling-rfci", algoType = AlgType.allow_latent_common_causes ) -@Experimental +//@Experimental public class PagSamplingRfci implements Algorithm, HasKnowledge { public static final List PAG_SAMPLING_RFCI_PARAMETERS = new LinkedList<>(); diff --git a/tetrad-lib/src/main/java/edu/cmu/tetrad/algcomparison/algorithm/oracle/pattern/CStaR.java b/tetrad-lib/src/main/java/edu/cmu/tetrad/algcomparison/algorithm/oracle/pattern/CStaR.java index 8772b9f464..5306829bf1 100644 --- a/tetrad-lib/src/main/java/edu/cmu/tetrad/algcomparison/algorithm/oracle/pattern/CStaR.java +++ b/tetrad-lib/src/main/java/edu/cmu/tetrad/algcomparison/algorithm/oracle/pattern/CStaR.java @@ -53,18 +53,18 @@ public Graph search(DataModel dataSet, Parameters parameters) { List possibleEffects = new ArrayList<>(); - String targetName = parameters.getString(Params.TARGETS); + String targetNames = parameters.getString(Params.TARGETS); - if (targetName.trim().equalsIgnoreCase("")) { + if (targetNames.trim().equalsIgnoreCase("")) { throw new IllegalStateException("Please specify target name(s)."); } - if (targetName.trim().equalsIgnoreCase("all")) { + if (targetNames.trim().equalsIgnoreCase("all")) { for (String name : dataSet.getVariableNames()) { possibleEffects.add(dataSet.getVariable(name)); } } else { - String[] names = targetName.split(","); + String[] names = targetNames.split(","); for (String name : names) { possibleEffects.add(dataSet.getVariable(name.trim())); @@ -72,6 +72,11 @@ public Graph search(DataModel dataSet, Parameters parameters) { } List possibleCauses = new ArrayList<>(dataSet.getVariables()); +// possibleCauses.removeAll(possibleEffects); + + if (!(dataSet instanceof DataSet)) { + throw new IllegalArgumentException("Expecting tabular data for CStaR."); + } LinkedList> allRecords = cStaR.getRecords((DataSet) dataSet, possibleCauses, possibleEffects, test.getTest(dataSet, parameters)); diff --git a/tetrad-lib/src/main/java/edu/cmu/tetrad/search/BuildPureClusters.java b/tetrad-lib/src/main/java/edu/cmu/tetrad/search/BuildPureClusters.java index 022366bd0f..9146c434fc 100644 --- a/tetrad-lib/src/main/java/edu/cmu/tetrad/search/BuildPureClusters.java +++ b/tetrad-lib/src/main/java/edu/cmu/tetrad/search/BuildPureClusters.java @@ -857,7 +857,7 @@ private List> filterAndOrderClusterings(List> baseListOf ClusterSignificance clusterSignificance = new ClusterSignificance(variables, covarianceMatrix); clusterSignificance.setCheckType(checkType); List cluster = ClusterSignificance.getInts(currentCluster); - if (clusterSignificance.significant(cluster, alpha)) { + if (!clusterSignificance.significant(cluster, alpha)) { continue; } diff --git a/tetrad-lib/src/main/java/edu/cmu/tetrad/search/Cstar.java b/tetrad-lib/src/main/java/edu/cmu/tetrad/search/Cstar.java index 703383ccac..dd257f73ea 100644 --- a/tetrad-lib/src/main/java/edu/cmu/tetrad/search/Cstar.java +++ b/tetrad-lib/src/main/java/edu/cmu/tetrad/search/Cstar.java @@ -178,10 +178,8 @@ public LinkedList> getRecords(DataSet dataSet, List pos this.test = test; } else if (test instanceof ChiSquare) { this.test = test; - } else if (test instanceof IndTestScore && ((IndTestScore) test).getWrappedScore() instanceof ConditionalGaussianScore) { - this.test = test; } else { - throw new IllegalArgumentException("Expecting Fisher Z, Chi Square, Sem BIC, or Conditional Gaussian Score."); + throw new IllegalArgumentException("Expecting Fisher Z, Chi Square, or Sem BIC."); } List>> minimalEffects = new ArrayList<>(); @@ -244,6 +242,8 @@ public double[][] call() { pattern = getPatternFges(sample); } else if (Cstar.this.patternAlgorithm == PatternAlgorithm.PC_STABLE) { pattern = getPatternPcStable(sample); + } else if (Cstar.this.patternAlgorithm == PatternAlgorithm.GRaSP) { + pattern = getPatternPcStable(sample); } else { throw new IllegalArgumentException("That type of of pattern algorithm is not configured: " + Cstar.this.patternAlgorithm); } @@ -600,6 +600,14 @@ private Graph getPatternPcStable(DataSet sample) { return pc.search(); } + private Graph getPatternGRaSP(DataSet sample) { + test.setVerbose(false); + Grasp alg = new Grasp(new SemBicScore(sample)); + alg.setVerbose(false); + alg.bestOrder(sample.getVariables()); + return alg.getGraph(true); + } + //=============================PRIVATE==============================// private Graph getPatternFges(DataSet sample) { @@ -687,7 +695,7 @@ private List runCallablesDoubleArray(List> task return results; } - public enum PatternAlgorithm {FGES, PC_STABLE} + public enum PatternAlgorithm {FGES, PC_STABLE, GRaSP} public enum SampleStyle {BOOTSTRAP, SPLIT} diff --git a/tetrad-lib/src/main/java/edu/cmu/tetrad/util/ConcurrencyUtils.java b/tetrad-lib/src/main/java/edu/cmu/tetrad/util/ConcurrencyUtils.java index ee49907489..7e32517c65 100644 --- a/tetrad-lib/src/main/java/edu/cmu/tetrad/util/ConcurrencyUtils.java +++ b/tetrad-lib/src/main/java/edu/cmu/tetrad/util/ConcurrencyUtils.java @@ -8,7 +8,7 @@ public class ConcurrencyUtils { public static void runCallables(List> tasks, boolean parallelized) { if (tasks.isEmpty()) return; - if (parallelized) { + if (!parallelized) { for (Callable task : tasks) { try { task.call();