Class Mimbuild

java.lang.Object
edu.cmu.tetrad.search.Mimbuild

public class Mimbuild extends Object
Provides an implementation of Mimbuild, an algorithm that takes a clustering of variables, each of which is explained by a single latent, then forms the implied covariance matrix over the latent variables, then runs a CPDAG search to in the structure over the latent themselves.

Specifically, the search will first infer the covariance matrix over the latents and then will use the BOSS algorithm (see) to infer the structure graph over the latents, using the SEM Bic score with the given penalty discount (default 2).

One may wish to obtain the implied correlation matrix over the latents and run one's own choice of CPDAG algorithm on it with one's own test or score; a method is available to return this covariance matrix.

A suitable clustering for Mimbuild may be obtained using the BPC or FOFC algorithm (see).

This algorithm is described in Spirtes et al., Causation, Prediction, and Search.

This class is configured to respect the knowledge of forbidden and required edges, including knowledge of temporal tiers.

Version:
$Id: $Id
Author:
josephramsey
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new Mimbuild search.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the clustering of measured variables, each of which is explained by a single latent.
    getFullGraph(List<Node> includeNodes)
    The full graph inferred, including the edges from latents to measures.
    Returns the inferred covariance matrix over the latent variables.
    double
    Getter for the field minimum.
    double
    Returns the p-value associated with the resulting statistical test or computation.
    search(int[][] clustering, String[] measureNames, String[] latentNames, double[][] measuresCov)
    Conducts a search to infer a graph over latent variables based on the provided clustering, measure names, latent variable names, and measures covariance.
    search(List<List<Node>> clustering, List<String> latentNames, ICovarianceMatrix measurescov)
    Does a Mimbuild search.
    void
    setPenaltyDiscount(double penaltyDiscount)
    Sets the penalty discount of the score used to infer the structure graph.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Mimbuild

      public Mimbuild()
      Constructs a new Mimbuild search.
  • Method Details

    • search

      public Graph search(int[][] clustering, String[] measureNames, String[] latentNames, double[][] measuresCov) throws InterruptedException
      Conducts a search to infer a graph over latent variables based on the provided clustering, measure names, latent variable names, and measures covariance.
      Parameters:
      clustering - An array where each subarray represents a cluster of measured variables, with each index corresponding to the position of a measure in the measureNames array. Each cluster is assumed to be explained by a single latent variable. The clusters must be disjoint.
      measureNames - An array of names corresponding to the measured variables.
      latentNames - An array of names for the latent variables, where each name corresponds to a cluster in the clustering parameter.
      measuresCov - A two-dimensional double array representing the covariance matrix over the measured variables.
      Returns:
      A graph inferred over the latent variables, depicting relationships among measured and latent variables.
      Throws:
      InterruptedException - If the search process is interrupted.
      IllegalArgumentException - If the clustering contains invalid indices or overlapping clusters.
      NullPointerException - If any of the arguments are null.
    • search

      public Graph search(List<List<Node>> clustering, List<String> latentNames, ICovarianceMatrix measurescov) throws InterruptedException
      Does a Mimbuild search.
      Parameters:
      clustering - The clustering to use--this clusters the measured variables in such a way that each cluster is explained by a single latent variables. The clusters must be disjoint.
      latentNames - The names of the latent variables corresponding in order ot each cluster in the clustering. These must be unique.
      measurescov - The covariance matrix over the measured variables.
      Returns:
      The inferred structure graph over the latent variables.
      Throws:
      InterruptedException - If the search is interrupted.
    • getClustering

      public List<List<Node>> getClustering()
      Returns the clustering of measured variables, each of which is explained by a single latent.
      Returns:
      This clustering.
    • getLatentsCov

      public ICovarianceMatrix getLatentsCov()
      Returns the inferred covariance matrix over the latent variables.
      Returns:
      This covariance matrix.
    • getMinimum

      public double getMinimum()

      Getter for the field minimum.

      Returns:
      The minimum function (Fgsl) value achieved.
    • getPValue

      public double getPValue()
      Returns the p-value associated with the resulting statistical test or computation. The p-value helps to determine the statistical significance of the result.
      Returns:
      The p-value as a double.
    • getFullGraph

      public Graph getFullGraph(List<Node> includeNodes)
      The full graph inferred, including the edges from latents to measures. And all fo the edges inferred among latents.
      Parameters:
      includeNodes - The nodes to include.
      Returns:
      This full graph.
    • setPenaltyDiscount

      public void setPenaltyDiscount(double penaltyDiscount)
      Sets the penalty discount of the score used to infer the structure graph.
      Parameters:
      penaltyDiscount - The penalty discount.