Skip to contents

causalDisco (development version)

causalDisco 1.3.0

CRAN release: 2026-11-17

New features

  • Added max_lag() / set_max_lag() to knowledge(), which forbids edges between variables that are more than a given number of tiers apart. max_lag() is set inside tier(), alongside its formulas: tier(1 ~ V1, 2 ~ V2, max_lag(1)).

  • Tetrad algorithms now expose more of Tetrad’s parameters, all defaulting to Tetrad’s own defaults:

    • grasp() gains use_score, allow_internal_randomness, output_cpdag and seed. Set allow_internal_randomness = FALSE for reproducible results.
    • grasp_fci() gains use_score, use_heuristic, exclude_selection_bias and seed.
    • pc() gains collider_orientation_style, allow_bidirected and fdr_q.
    • fci() gains collider_orientation_style, do_possible_dsep, exclude_selection_bias and fdr_q.
    • rfci() gains exclude_selection_bias and fdr_q.
    • ges() gains num_threads; boss() gains num_threads and seed.
    • boss_fci(), gfci() and sp_fci() gain exclude_selection_bias.
  • plot() gains equal_node_size. By default, all nodes are now drawn the same size, fitted to the longest label. Use equal_node_size = FALSE for the previous behaviour, where each node is sized to its own label.

  • tpc_run() now supports orientation_method = "standard" and "maj_rule".

  • make_tikz() gains:

    • style = "classic": plain-text nodes, gray tier bands, and a time axis.
    • node_labels and tier_labels for LaTeX labels, e.g. c(X1 = "$X_1$").
    • Edges that would pass through another node are bent around it, as in plot(), and bent edges leaving a node together are spread apart. An edge whose bend would pass through a node is bent the other way, or by the nearest angle to bend that clears it. edge_style = list(route = FALSE) turns both adjustments off.
    • bend sets the bend of all edges in degrees (0 = straight, negative = the other way), or of individual edges with a list, e.g. list(default = 20, A = list(B = 0)).
    • The output defines named styles (var, link, tier, tier label) instead of every node/every path, which also styled the tiers.

Lifecycle changes

  • orientation_method = "maj.rule" in tpc_run() and tfci_run() is deprecated in favour of "maj_rule".

  • make_tikz(bend_edges, bend_angle) are deprecated in favour of bend: bend_edges = TRUE, bend_angle = 15 is now bend = 15, and bend_edges = FALSE is bend = 0.

Bug fixes

  • verify_tetrad() no longer reports Tetrad as not installed after a successful install_tetrad() when the TETRAD_DIR environment variable is set. The (undocumented) TETRAD_DIR is no longer used; set options(causalDisco.tetrad_cache = ) to use a custom directory instead.

  • make_tikz() now draws PAG edge marks (o->, o-o, --o) instead of warning.

  • make_tikz() with bent edges now bends edges in both directions (A --> B, B --> A) to opposite sides instead of drawing them on top of each other.

  • install_tetrad(version = ) now saves a non-default Tetrad version in its own cache directory instead of the default version’s, and Java loads only the JAR for the configured version.

  • tpc_run() now orients conservatively by default, as documented; it previously used standard orientation.

  • Removed Tetrad algorithm arguments that Tetrad ignored, so setting them had no effect:

    • pc(): conflict_rule, guarantee_cpdag
    • ges(): parallelized (use num_threads)
    • rfci(): stable_fas, complete_rule_set_used
    • grasp_fci(): stable_fas, covered_depth
    • sp_fci(): depth
    • Also in TetradSearch$set_alg(): cpc and pc_max (conflict_rule, guarantee_cpdag, use_heuristic, max_disc_path_length), fcit (guarantee_pag, max_disc_path_length), restricted_boss (allow_internal_randomness) and ccd (depth).
  • use_heuristic in gfci() and sp_fci() had no effect because it set the wrong Tetrad parameter. It now controls the max-p heuristic as documented.

  • boss_fci()’s num_threads was never passed to Tetrad. It is now, and its default changes from 0 to Tetrad’s default of 1.

  • pc(engine = "pcalg") no longer errors when the estimated graph contains a cycle. Now emits a message and returns the graph with its class downgraded to "UNKNOWN".

causalDisco 1.2.1

CRAN release: 2026-07-20

New features

  • Added support for the RFCI algorithm via rfci(), interfacing with implementations from pcalg and Tetrad.

  • The infix edge operators %-->% and %!-->% in knowledge() now accept + on both sides to specify multiple variables, e.g. A + B %-->% C + D is equivalent to c(A, B) %-->% c(C, D).

  • The infix edge operators %-->% and %!-->% in knowledge() now support tidyselect set operations such as !, &, and | on either side, e.g. child_x1 %!-->% !starts_with("child").

  • You can now plug a fully custom, user-written search algorithm into the causalDisco engine and run it through disco() (via CausalDiscoSearch$set_alg() and make_method()). See the “Extending causalDisco with new algorithms” article for a worked example.

  • Added register_engine(), which lets you plug in an entirely new engine backend (i.e. one not built on bnlearn, causalDisco, pcalg, or Tetrad) so. See the “Extending causalDisco with new algorithms” article for a worked example.

Deprecated

  • The summary() methods for Knowledge and Disco objects are deprecated; use print() instead.

  • The directed_as_undirected argument of tpc_run(), tfci_run(), and CausalDiscoSearch$set_knowledge() is deprecated and ignored; see the related bug-fix entry below for the new handling of directed forbidden edges.

  • The internal-only directed_as_undirected_knowledge argument of make_runner() has been removed, and the directed_as_undirected argument of PcalgSearch$set_knowledge() and as_pcalg_constraints() is deprecated and ignored.

  • as_pcalg_constraints() no longer returns a fixed_edges matrix. pcalg’s fixedEdges argument only protects an undirected adjacency in the skeleton, so a directed required edge (A %-->% B) cannot be honored through it.

Bug fixes

  • Fixed tpc() and tfci() silently treating directed forbidden edges as undirected: forbidding i %!-->% j also forbidden j !--> i. Forbidden edges now follow the same rule as the pcalg engine: both directions must be supplied explicitly, otherwise an error is raised. The exception is if the Knowledge forbidden knowledge is equivalent to tiered knowledge.

  • Fixed knowledge() dropping variables from tier() formulas when infix edge operators (%-->%, %!-->%) appeared before the tier() call and had already registered some (but not all) of the tier’s variables. This only affected the no-data-frame form of knowledge().

Improvements

  • The print() methods for Knowledge and Disco objects now give a more concise and readable summary.

  • Disco objects now store an attribute graph_class of the actual learned graph class.

  • Knowledge objects generated from knowledge() now verifies the knowledge for requires edges doesn’t contain a directed cycle.

  • Improved the documentation.

  • Reduced the number of package dependencies.

Other changes

  • Converted most vignettes to articles to reduce package size.

causalDisco 1.1.0

CRAN release: 2026-04-13

New features

  • Exports list_registered_tetrad_algorithms() to view the custom registered Tetrad algorithms.

  • Allows the user to specify custom conditional independence tests for use with the engines bnlearn, causalDisco, and pcalg. The custom test should have the signature function(x, y, conditioning_set, suff_stat) (optionally with an additional args argument for additional parameters), and return a p-value. See the documentation and the associated vignette for details.

  • Added support for micd tests such as micd::gaussCItestMI() for pcalg and causalDisco engine. See all the new available tests in ?PcalgSearch and ?CausalDiscoSearch under the test field.

  • Simplified the interface for extending causalDisco with new algorithms. Exports make_method() and make_runner() to do this. Please see the documentation and the associated vignette for details.

Improvements

  • Improved speed of tfci(), tges(), and tpc() algorithms by at least 3x, and often much more.

  • Updated knowledge_to_caugi() to include information about required and forbidden edges in the output.

  • Improve documentation for many functions.

causalDisco 1.0.1

CRAN release: 2026-02-24

  • This release should be considered essentially a new package with many new features, and some breaking changes (mainly renaming functions, arguments, and object classes) to be consistent.

  • Please see the vignettes and documentation for details on using the new features.

causalDisco 0.9.5

CRAN release: 2026-01-20

  • Fixed warnings and notes from R CMD check regarding documentation.

causalDisco 0.9.3

  • Changed structure of tpdag and tskeleton objects so they include tamat objects rather than amat and order slots. This is a major change, not backwards compatible!
  • tpc now passes … argument to skeleton() function call
  • Added functionality in tpc to handle missing information when using built-in tests. Three options are now available: complete case analysis, test wise deletion, or no handling (i.e., and error is thrown if there are NAs, this is the default and it is backwards compatible).

causalDisco 0.9.2

  • Fixed bug in maketikz() function so it now works with tpdag and tamat objects, and added examples to the documentation.

causalDisco 0.9.1

CRAN release: 2022-05-12

  • Added three new functions: simDAG, simGausFromDAG, nDAGs.
  • Changed structure of tamat objects so they inherit directly from matrix.

causalDisco 0.9.0

  • Added a NEWS.md file to track changes to the package.
  • First CRAN submission.