tetradrunner | R Documentation |
tetradrunner
is the wrapper of Tetrad algorithms.
ccd(algoId, dataType, df = NULL, dfs = NULL, testId = NULL, scoreId = NULL,
priorKnowledge = NULL, numCategoriesToDiscretize = 4,java.parameters = NULL,...)
algoId |
Tetrad Algorithm Id. To check what algorithms supported, use |
dataType |
Dataset type either 'continuous','discrete', or 'mixed'. |
df |
Data frame of dataset.If running multi-dataset algorithms, set it NULL. By default, |
dfs |
A list of data frames of datasets.If running singular dataset algorithms, set it NULL. By default, |
testId |
Test id indicating the independent test being used by the causal algorithm. To check if the designated algorithm needs an independent test or not, use |
scoreId |
Score id indicating the evaluation score being used by the causal algorithm. To check if the designated algorithm needs a score or not, use |
priorKnowledge |
object indicating a prior knowledge of the graph. By default,
|
numCategoriesToDiscretize |
A number of categories of the continuous variable to be discretized. By default,
|
java.parameters |
string indicating an optional parameters for JVM.
For example, java.parameters = "-Xmx1024M". By default,
|
... |
parameters specific to the designed algorithm. To check which parameters the algorithm accepts, use |
The Tetrad Runner is a R wrapper implemented for running the search algorithms from the Tetrad library.
More detail about Tetrad implementation, please visit the Tetrad project.
A list containing the result's graph, the result's nodes, and the result's edges.
data("charity")
tetradrunner.getAlgorithmDescription(algoId = 'fges')
tetradrunner.getAlgorithmParameters(algoId = 'fges',scoreId = 'sem-bic')
tetradrunner <- tetradrunner(algoId = 'fges',df = charity,scoreId = 'sem-bic',dataType = 'continuous')
tetradrunner$edges
tetradrunner <- tetradrunner(algoId = 'fges',df = charity,scoreId = 'sem-bic',dataType = 'continuous',
faithfulnessAssumed=TRUE,maxDegree=-1,verbose=TRUE)
tetradrunner$edges
# Using the default score
tetradrunner <- tetradrunner(algoId = 'fges',df = charity,dataType = 'continuous')
tetradrunner$edges
# Bootstrapping
tetradrunner <- tetradrunner(algoId = 'fges',df = charity,dataType = 'continuous',
faithfulnessAssumed=TRUE,maxDegree=-1,verbose=TRUE,
numberResampling = 10,resamplingEnsemble = 0,addOriginalDataset = TRUE)
tetradrunner$edges #Show the result's edges
tetradrunner$nodes #Show the result's nodes
# Get BIC scores
graph <- tetradrunner$graph
graph$getAttribute('BIC')
nodes <- graph$getNodes()
for(i in 0:as.integer(nodes$size()-1)){
node <- nodes$get(i)
cat(node$getName(),": ",node$getAttribute('BIC'),"\n")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.