-
Notifications
You must be signed in to change notification settings - Fork 113
Command Line Tetrad
###Command Line Tetrad
We have a rather rudimentary command line Tetrad facility. At some point it will have to be improved, since a lot of people actually use it, but it works for what it does.
These are the old instructions. Only the jar path is updated. But they should still work.
Step 1: Find the command line jar online. The latest one is:
You can look through the files at http://www.phil.cmu.edu/projects/tetrad_download/maven/edu/cmu/lib-tetrad/ to see if you can find a newer one.
Download this jar. For sanity's sake, rename it to tetradcmd.jar so you don't have to type such a long name.
Step 2: Put this jar in the directory you intend to work in, together with the data file (which I assume here to be munin1.txt).
Step 3: Type this command:
java -jar tetradcmd.jar -data munin1.txt -datatype discrete -algorithm fci -depth 3 -significance 0.5
I'm assuming that tetradcmd.jar and munin1.txt are in the same directory you're typing in. I'm assuming you're on a Unix-type machine and have JDK 1.4.2 or higher installed. I'm assuming munin1.txt is the data file that was sent to me earlier with 189 variables and 5000 cases. I'm assuming that the delimiter for the data file is whitespace, or regex " *[\t ] *".
The flags “-data”, “-datatype”, and “-algorithm” are required.
“-data” must be followed by the path to a tabular data file, if one is using tabular data as input to the algorithm.
"-covariance" followed by the path to a covariance matrix, if one is using a covariance matrix for input to the algorithm.
“-datatype” must be followed by either “continuous” or “discrete”. If using a covariance matrix, this may be omitted, since the data must be continuous.
“-algorithm” must be followed by either “pc”, "cpc", "fci", "cfci", "ccd", "ges", "bayes_est", "randomDag".
“-depth” is by default -1 (unlimited) but may be followed by any integer >= -1. This is effective for PC, CPC, FCI, and CFCI, not GES.
“-significance” is by default 0.05 but may be set to any number in the range [0.0, 1.0]. This is effective for PC, CPC FCI, and CFCI, not GES.
"-samplePrior" is by detault 10 but may be set to any positive number; this is used for GES.
"-structurePrior" is by default 1 but may be set to any positive number; this is used for GES.
"-penaltydiscount" is by default 1 but may be set to any positive number; this is used for GES.
"- graphxml" followed by a filename will write graphical output to that file in XML format.
"-graphtxt" followed by a filename will write graphical output to that file in text format.
"-initialgraphtxt" followed by a file name will read in an initial graph. This is only used for GES.
"-nodsep" for FCI indicates that the D-Sep search should not be run.
"-rfci" for FCI uses the RFCI variant of the algorithm.
"-rrfci" for FCI uses the RRFCI variant of the algorithm.
"-verbose" if verbose information, e.g. about the independencies tested for constraint based algorithms, should be output.
"-knowledge" followed by a path to a knowledge file supplied knowledge to a number of the supported algorithms. The knowledge file should have a form like the following:
/knowledge addtemporal 1 X1 X10 X100 X11 2 X14 X13 X12 X16 X15 3 X2 X20 X21 X18 X17 X195
forbiddirect
requiredirect
The above input should generate the following output to standard out:
-
Path to the data file.
-
Verbose output.
-
The final graph.