Class ExternalAlgorithmPcalgPc
java.lang.Object
edu.cmu.tetrad.algcomparison.algorithm.ExternalAlgorithm
edu.cmu.tetrad.algcomparison.algorithm.external.ExternalAlgorithmPcalgPc
- All Implemented Interfaces:
- Algorithm,- HasParameters,- TetradSerializable,- Serializable
An API to allow results from external algorithms to be included in a report through the algrorithm
 comparison tool. This one is for matrix generated by PC in pcalg. See below. This script can generate
 the files in R.
 
library("MASS"); library("pcalg");
path<-"/Users/user/tetrad/comparison-final"; simulation<-1;
subdir<-"pc.solve.confl.TRUE"; dir.create(paste(path, "/save/", simulation, "/", subdir, sep=""));
for (i in 1:10) { data<-read.table(paste(path, "/save/", simulation, "/data/data.", i, ".txt", sep=""), header=TRUE) n<-nrow(data) C<-cor(data) v<-names(data) suffStat<-list(C = C, n=n) pc.fit<-pc(suffStat=suffStat, indepTest=gaussCItest, alpha=0.001, labels=v, solve.conf=TRUE) A<-as(pc.fit, "amat") name<-paste(path, "/save/", simulation, "/", subdir, "/graph.", i, ".txt", sep="") print(name) write.matrix(A, file=name, sep="\t") }
- Author:
- jdramsey
- See Also:
- 
Field SummaryFields inherited from class edu.cmu.tetrad.algcomparison.algorithm.ExternalAlgorithmpath, simIndex, simulation, usedParameters
- 
Constructor SummaryConstructorsConstructorDescriptionExternalAlgorithmPcalgPc(String extDir) ExternalAlgorithmPcalgPc(String extDir, String shortDecription) 
- 
Method SummaryModifier and TypeMethodDescriptiongetComparisonGraph(Graph graph) Returns the CPDAG of the supplied DAG.Returns the data type that the search requires, whether continuous, discrete, or mixed.Returns a short, one-line description of this algorithm.longgetElapsedTime(DataModel dataSet, Parameters parameters) static GraphloadGraphPcAlgMatrix(DataSet dataSet) search(DataModel dataSet, Parameters parameters) Reads in the relevant graph from the file (see above) and returns it.Methods inherited from class edu.cmu.tetrad.algcomparison.algorithm.ExternalAlgorithmgetIndex, getNumDataModels, getParameters, getSimulation, setPath, setSimIndex, setSimulation
- 
Constructor Details- 
ExternalAlgorithmPcalgPc
- 
ExternalAlgorithmPcalgPc
 
- 
- 
Method Details- 
searchReads in the relevant graph from the file (see above) and returns it.- Parameters:
- dataSet- The data set to run to the search on.
- parameters- The paramters of the search.
- Returns:
- The result graph.
 
- 
getComparisonGraphReturns the CPDAG of the supplied DAG.- Parameters:
- graph- The true directed graph, if there is one.
- Returns:
- The comparison graph.
 
- 
getDescriptionDescription copied from interface:AlgorithmReturns a short, one-line description of this algorithm. This will be printed in the report.- Returns:
- This description.
 
- 
getDataTypeDescription copied from interface:AlgorithmReturns the data type that the search requires, whether continuous, discrete, or mixed.- Returns:
- This type.
 
- 
getElapsedTime- Specified by:
- getElapsedTimein class- ExternalAlgorithm
 
- 
loadGraphPcAlgMatrix
 
-