Search in sources :

Example 1 with FisherZ

use of edu.cmu.tetrad.algcomparison.independence.FisherZ in project tetrad by cmu-phil.

the class TimeoutComparisonTest method getAlgorithms.

private static Algorithms getAlgorithms() {
    Algorithms algorithms = new Algorithms();
    algorithms.add(new Gfci(new FisherZ(), new SemBicScore()));
    return algorithms;
}
Also used : Algorithms(edu.cmu.tetrad.algcomparison.algorithm.Algorithms) FisherZ(edu.cmu.tetrad.algcomparison.independence.FisherZ) Gfci(edu.cmu.tetrad.algcomparison.algorithm.oracle.pag.Gfci) SemBicScore(edu.cmu.tetrad.algcomparison.score.SemBicScore)

Example 2 with FisherZ

use of edu.cmu.tetrad.algcomparison.independence.FisherZ in project tetrad by cmu-phil.

the class ExampleCompareSimulation method main.

public static void main(String... args) {
    Parameters parameters = new Parameters();
    https: parameters.set("numRuns", 10);
    parameters.set("numMeasures", 100);
    parameters.set("avgDegree", 4, 6);
    parameters.set("sampleSize", 500);
    parameters.set("alpha", 1e-4, 1e-3, 1e-2);
    Statistics statistics = new Statistics();
    statistics.add(new AdjacencyPrecision());
    statistics.add(new AdjacencyRecall());
    statistics.add(new ArrowheadPrecision());
    statistics.add(new ArrowheadRecall());
    statistics.add(new MathewsCorrAdj());
    statistics.add(new MathewsCorrArrow());
    statistics.add(new F1Adj());
    statistics.add(new F1Arrow());
    statistics.add(new SHD());
    statistics.add(new ElapsedTime());
    statistics.setWeight("AP", 1.0);
    statistics.setWeight("AR", 0.5);
    Algorithms algorithms = new Algorithms();
    algorithms.add(new Pc(new FisherZ()));
    algorithms.add(new Cpc(new FisherZ(), new Fges(new SemBicScore(), false)));
    algorithms.add(new PcStable(new FisherZ()));
    algorithms.add(new CpcStable(new FisherZ()));
    Simulations simulations = new Simulations();
    simulations.add(new SemSimulation(new RandomForward()));
    Comparison comparison = new Comparison();
    comparison.setShowAlgorithmIndices(true);
    comparison.setShowSimulationIndices(true);
    comparison.setSortByUtility(true);
    comparison.setShowUtilities(true);
    comparison.setParallelized(true);
    comparison.compareFromSimulations("comparison", simulations, algorithms, statistics, parameters);
}
Also used : Simulations(edu.cmu.tetrad.algcomparison.simulation.Simulations) Parameters(edu.cmu.tetrad.util.Parameters) SemSimulation(edu.cmu.tetrad.algcomparison.simulation.SemSimulation) RandomForward(edu.cmu.tetrad.algcomparison.graph.RandomForward) Algorithms(edu.cmu.tetrad.algcomparison.algorithm.Algorithms) FisherZ(edu.cmu.tetrad.algcomparison.independence.FisherZ) Comparison(edu.cmu.tetrad.algcomparison.Comparison) SemBicScore(edu.cmu.tetrad.algcomparison.score.SemBicScore)

Example 3 with FisherZ

use of edu.cmu.tetrad.algcomparison.independence.FisherZ in project tetrad by cmu-phil.

the class ExampleCompareFromFiles method main.

public static void main(String... args) {
    Parameters parameters = new Parameters();
    // Can leave the simulation parameters out since
    // we're loading from file here.
    parameters.set("alpha", 1e-4);
    parameters.set("numRuns", 10);
    Statistics statistics = new Statistics();
    statistics.add(new ParameterColumn("avgDegree"));
    statistics.add(new ParameterColumn("sampleSize"));
    statistics.add(new AdjacencyPrecision());
    statistics.add(new AdjacencyRecall());
    statistics.add(new ArrowheadPrecision());
    statistics.add(new ArrowheadRecall());
    statistics.add(new MathewsCorrAdj());
    statistics.add(new MathewsCorrArrow());
    statistics.add(new F1Adj());
    statistics.add(new F1Arrow());
    statistics.add(new SHD());
    statistics.add(new ElapsedTime());
    statistics.setWeight("AP", 1.0);
    statistics.setWeight("AR", 0.5);
    statistics.setWeight("AHP", 1.0);
    statistics.setWeight("AHR", 0.5);
    Algorithms algorithms = new Algorithms();
    algorithms.add(new Pc(new FisherZ()));
    algorithms.add(new Cpc(new FisherZ()));
    algorithms.add(new PcStable(new FisherZ()));
    algorithms.add(new CpcStable(new FisherZ()));
    Comparison comparison = new Comparison();
    comparison.setShowAlgorithmIndices(false);
    comparison.setShowSimulationIndices(false);
    comparison.setSortByUtility(true);
    comparison.setShowUtilities(true);
    comparison.setParallelized(true);
    comparison.compareFromFiles("comparison", algorithms, statistics, parameters);
}
Also used : Parameters(edu.cmu.tetrad.util.Parameters) Algorithms(edu.cmu.tetrad.algcomparison.algorithm.Algorithms) FisherZ(edu.cmu.tetrad.algcomparison.independence.FisherZ) Comparison(edu.cmu.tetrad.algcomparison.Comparison)

Example 4 with FisherZ

use of edu.cmu.tetrad.algcomparison.independence.FisherZ in project tetrad by cmu-phil.

the class ExampleCompareSimulationTimeSeries method main.

public static void main(String... args) {
    Parameters parameters = new Parameters();
    parameters.set("numRuns", 10);
    parameters.set("numMeasures", 10);
    parameters.set("avgDegree", 4);
    parameters.set("sampleSize", 500);
    parameters.set("alpha", 1e-4, 1e-3, 1e-2);
    Statistics statistics = new Statistics();
    statistics.add(new AdjacencyPrecision());
    statistics.add(new AdjacencyRecall());
    statistics.add(new ArrowheadPrecision());
    statistics.add(new ArrowheadRecall());
    statistics.add(new MathewsCorrAdj());
    statistics.add(new MathewsCorrArrow());
    statistics.add(new F1Adj());
    statistics.add(new F1Arrow());
    statistics.add(new SHD());
    statistics.add(new ElapsedTime());
    statistics.setWeight("AP", 1.0);
    statistics.setWeight("AR", 0.5);
    Algorithms algorithms = new Algorithms();
    algorithms.add(new TsFci(new FisherZ()));
    algorithms.add(new TsGfci(new FisherZ(), new SemBicScore()));
    algorithms.add(new TsImages(new SemBicScore()));
    Simulations simulations = new Simulations();
    simulations.add(new TimeSeriesSemSimulation(new RandomForward()));
    Comparison comparison = new Comparison();
    comparison.setSortByUtility(true);
    comparison.setShowUtilities(true);
    comparison.compareFromSimulations("comparison", simulations, algorithms, statistics, parameters);
}
Also used : Simulations(edu.cmu.tetrad.algcomparison.simulation.Simulations) Parameters(edu.cmu.tetrad.util.Parameters) RandomForward(edu.cmu.tetrad.algcomparison.graph.RandomForward) TsGfci(edu.cmu.tetrad.algcomparison.algorithm.oracle.pag.TsGfci) TimeSeriesSemSimulation(edu.cmu.tetrad.algcomparison.simulation.TimeSeriesSemSimulation) Algorithms(edu.cmu.tetrad.algcomparison.algorithm.Algorithms) FisherZ(edu.cmu.tetrad.algcomparison.independence.FisherZ) Comparison(edu.cmu.tetrad.algcomparison.Comparison) TsFci(edu.cmu.tetrad.algcomparison.algorithm.oracle.pag.TsFci) TsImages(edu.cmu.tetrad.algcomparison.algorithm.oracle.pag.TsImages) SemBicScore(edu.cmu.tetrad.algcomparison.score.SemBicScore)

Example 5 with FisherZ

use of edu.cmu.tetrad.algcomparison.independence.FisherZ in project tetrad by cmu-phil.

the class ExampleCompareFromFiles method main.

public static void main(String... args) {
    Parameters parameters = new Parameters();
    parameters.set("numRuns", 1);
    // parameters.set("numMeasures", 20,100,1000);
    parameters.set("numMeasures", 1000);
    parameters.set("numLatents", 200);
    parameters.set("avgDegree", 2);
    parameters.set("sampleSize", 1000);
    parameters.set("penaltyDisount", 2);
    parameters.set("alpha", 1e-4);
    Statistics statistics = new Statistics();
    statistics.add(new ParameterColumn("avgDegree"));
    statistics.add(new ParameterColumn("sampleSize"));
    statistics.add(new AdjacencyPrecision());
    statistics.add(new AdjacencyRecall());
    statistics.add(new ArrowheadPrecision());
    statistics.add(new ArrowheadRecall());
    statistics.add(new MathewsCorrArrow());
    statistics.add(new F1Adj());
    statistics.add(new F1Arrow());
    statistics.add(new SHD());
    statistics.add(new ElapsedTime());
    statistics.setWeight("AP", 1.0);
    statistics.setWeight("AR", 0.5);
    statistics.setWeight("AHP", 1.0);
    statistics.setWeight("AHR", 0.5);
    // statistics.setWeight("TP", 1.0);
    // statistics.setWeight("TR", 0.5);
    Algorithms algorithms = new Algorithms();
    // algorithms.add(new Gfci(new ChiSquare(), new BdeuScore()));
    // algorithms.add(new Fci(new FisherZ()));
    // algorithms.add(new Fci(new ChiSquare()));
    // algorithms.add(new Rfci(new ChiSquare()));
    // algorithms.add(new Rfci(new FisherZ()));
    algorithms.add(new Gfci(new FisherZ(), new SemBicScore()));
    // algorithms.add(new Fges(new BdeuScore(),true));
    // algorithms.add(new Fges(new DiscreteBicScore(),true));
    // algorithms.add(new Fges(new SemBicScore()));
    // algorithms.add(new Gfci(new ChiSquare(), new DiscreteBicScore())));
    // algorithms.add(new Fges(new BdeuScore()));
    // algorithms.add(new Fges(new DiscreteBicScore()));
    // algorithms.add(new PcMax(new FisherZ(), false));
    // algorithms.add(new PcMax(new ChiSquare(),true));
    // algorithms.add(new PcMax(new FisherZ(), false));
    // algorithms.add(new Pc(new FisherZ()));
    Comparison comparison = new Comparison();
    comparison.setShowAlgorithmIndices(true);
    comparison.setShowSimulationIndices(false);
    comparison.setSortByUtility(true);
    comparison.setShowUtilities(true);
    comparison.setParallelized(false);
    comparison.setSaveGraphs(true);
    // DagToPag p = new DagToPag(graph);
    comparison.compareFromFiles("comparison", algorithms, statistics, parameters);
}
Also used : Parameters(edu.cmu.tetrad.util.Parameters) Gfci(edu.cmu.tetrad.algcomparison.algorithm.oracle.pag.Gfci) Algorithms(edu.cmu.tetrad.algcomparison.algorithm.Algorithms) FisherZ(edu.cmu.tetrad.algcomparison.independence.FisherZ) Comparison(edu.cmu.tetrad.algcomparison.Comparison) SemBicScore(edu.cmu.tetrad.algcomparison.score.SemBicScore)

Aggregations

FisherZ (edu.cmu.tetrad.algcomparison.independence.FisherZ)9 Parameters (edu.cmu.tetrad.util.Parameters)7 Algorithms (edu.cmu.tetrad.algcomparison.algorithm.Algorithms)6 Comparison (edu.cmu.tetrad.algcomparison.Comparison)5 SemBicScore (edu.cmu.tetrad.algcomparison.score.SemBicScore)5 RandomForward (edu.cmu.tetrad.algcomparison.graph.RandomForward)4 Gfci (edu.cmu.tetrad.algcomparison.algorithm.oracle.pag.Gfci)3 IndependenceWrapper (edu.cmu.tetrad.algcomparison.independence.IndependenceWrapper)3 SemSimulation (edu.cmu.tetrad.algcomparison.simulation.SemSimulation)3 Simulations (edu.cmu.tetrad.algcomparison.simulation.Simulations)3 Test (org.junit.Test)3 Algorithm (edu.cmu.tetrad.algcomparison.algorithm.Algorithm)2 ScoreWrapper (edu.cmu.tetrad.algcomparison.score.ScoreWrapper)2 DataSet (edu.cmu.tetrad.data.DataSet)2 Graph (edu.cmu.tetrad.graph.Graph)2 DagToPag (edu.cmu.tetrad.search.DagToPag)2 LargeScaleSimulation (edu.cmu.tetrad.sem.LargeScaleSimulation)2 GeneralBootstrapTest (edu.pitt.dbmi.algo.bootstrap.GeneralBootstrapTest)2 Fci (edu.cmu.tetrad.algcomparison.algorithm.oracle.pag.Fci)1 TsFci (edu.cmu.tetrad.algcomparison.algorithm.oracle.pag.TsFci)1