Class ExternalAlgorithmIntersection
- All Implemented Interfaces:
Algorithm
,HasParameters
,TetradSerializable
,Serializable
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") }
- Version:
- $Id: $Id
- Author:
- josephramsey
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionExternalAlgorithmIntersection
(String shortDescription, ExternalAlgorithm... algorithms) Constructor for ExternalAlgorithmIntersection. -
Method Summary
Modifier and TypeMethodDescriptiongetComparisonGraph
(Graph graph) Returns that graph that the result should be compared to.getDataType.getDescription.long
getElapsedTime
(DataModel dataSet, Parameters parameters) getElapsedTime.search
(DataModel dataSet, Parameters parameters) Runs the search.Methods inherited from class edu.cmu.tetrad.algcomparison.algorithm.ExternalAlgorithm
getIndex, getNumDataModels, getParameters, getSimulation, setPath, setSimIndex, setSimulation
-
Constructor Details
-
ExternalAlgorithmIntersection
Constructor for ExternalAlgorithmIntersection.
- Parameters:
shortDescription
- aString
objectalgorithms
- aExternalAlgorithm
object
-
-
Method Details
-
search
Runs the search.Reads 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.
-
getComparisonGraph
Returns that graph that the result should be compared to.Returns the CPDAG of the supplied DAG.
- Parameters:
graph
- The true directed graph, if there is one.- Returns:
- The comparison graph.
-
getDescription
getDescription.
- Returns:
- a
String
object
-
getDataType
getDataType.
- Returns:
- a
DataType
object
-
getElapsedTime
getElapsedTime.
- Specified by:
getElapsedTime
in classExternalAlgorithm
- Parameters:
dataSet
- aDataModel
objectparameters
- aParameters
object- Returns:
- a long
-