tetradrunner: Tetrad Algorithm Runner

Description Usage Arguments Details Value Examples

View source: R/tetradrunner.R

Description

tetradrunner is the wrapper of Tetrad algorithms.

Usage

1
2
ccd(algoId, dataType, df = NULL, dfs = NULL, testId = NULL, scoreId = NULL, 
	priorKnowledge = NULL, numCategoriesToDiscretize = 4,java.parameters = NULL,...)

Arguments

algoId

Tetrad Algorithm Id. To check what algorithms supported, use tetradrunner.listAlgorithms.

dataType

Dataset type either 'continuous','discrete', or 'mixed'.

df

Data frame of dataset.If running multi-dataset algorithms, set it NULL. By default, df=NULL.

dfs

A list of data frames of datasets.If running singular dataset algorithms, set it NULL. By default, dfs=NULL.

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 tetradrunner.getAlgorithmDescription. To check what tests supported, use tetradrunner.listIndTests.

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 tetradrunner.getAlgorithmDescription. To check what tests supported, use tetradrunner.listScores.

priorKnowledge

object indicating a prior knowledge of the graph. By default, priorKnowledge=NULL.

numCategoriesToDiscretize

A number of categories of the continuous variable to be discretized. By default, numCategoriesToDiscretize=4.

java.parameters

string indicating an optional parameters for JVM. For example, java.parameters = "-Xmx1024M". By default, java.parameters=NULL.

...

parameters specific to the designed algorithm. To check which parameters the algorithm accepts, use tetradrunner.getAlgorithmParameters.

Details

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.

Value

A list containing the result's graph, the result's nodes, and the result's edges.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
data("charity")
tetradrunner.getAlgorithmDescription(algoId = 'fges')
tetradrunner.getAlgorithmParameters(algoId = 'fges',scoreId = 'fisher-z')

tetradrunner <- tetradrunner(algoId = 'fges',df = charity,scoreId = 'fisher-z',dataType = 'continuous')
tetradrunner$edges

tetradrunner <- tetradrunner(algoId = 'fges',df = charity,scoreId = 'fisher-z',dataType = 'continuous',
alpha=0.1,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',
alpha=0.1,faithfulnessAssumed=TRUE,maxDegree=-1,verbose=TRUE,
bootstrapSampleSize = 10,bootstrapEnsemble=0)
tetradrunner$edges #Show the result's edges
tetradrunner$nodes #Show the result's nodes

bd2kccd/r-causal documentation built on Aug. 15, 2018, 7:15 p.m.