Class ConditionalGaussianLikelihood

java.lang.Object
edu.cmu.tetrad.search.score.ConditionalGaussianLikelihood

public class ConditionalGaussianLikelihood extends Object
Implements a conditional Gaussian likelihood. Please note that this likelihood will be maximal only if the continuous variables are jointly Gaussian conditional on the discrete variables; in all other cases, it will be less than maximal. The reference is here:

Andrews, B., Ramsey, J., & Cooper, G. F. (2018). Scoring Bayesian networks of mixed variables. International journal of data science and analytics, 6, 3-18.

As for all scores in Tetrad, higher scores mean more dependence, and negative scores indicate independence.

Version:
$Id: $Id
Author:
bryanandrews, josephramsey
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Gives return value for a conditional Gaussian likelihood, returning a likelihood value and the degrees of freedom for it.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs the score using a covariance matrix.
  • Method Summary

    Modifier and Type
    Method
    Description
    getLikelihood(int i, int[] parents)
    Returns the likelihood of variable i conditional on the given parents, assuming the continuous mixedVariables index by i or by the parents are jointly Gaussian conditional on the discrete comparison.
    void
    setDiscretize(boolean discretize)
    Sets whether to discretize child variables to avoid integration.
    void
    setNumCategoriesToDiscretize(int numCategoriesToDiscretize)
    Sets the number of categories to use to discretize child variables to avoid integration
    void
    Sets the rows to use for the likelihood calculation.

    Methods inherited from class java.lang.Object

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

    • ConditionalGaussianLikelihood

      public ConditionalGaussianLikelihood(DataSet dataSet)
      Constructs the score using a covariance matrix.
      Parameters:
      dataSet - The continuous dataset to analyze.
  • Method Details

    • setRows

      public void setRows(List<Integer> rows)
      Sets the rows to use for the likelihood calculation. If not set, all rows will be used.
      Parameters:
      rows - The rows to use.
    • getLikelihood

      public ConditionalGaussianLikelihood.Ret getLikelihood(int i, int[] parents)
      Returns the likelihood of variable i conditional on the given parents, assuming the continuous mixedVariables index by i or by the parents are jointly Gaussian conditional on the discrete comparison.
      Parameters:
      i - The index of the conditioned variable.
      parents - The indices of the conditioning mixedVariables.
      Returns:
      The likelihood.
    • setDiscretize

      public void setDiscretize(boolean discretize)
      Sets whether to discretize child variables to avoid integration. An optimization.
      Parameters:
      discretize - True, if so.
      See Also:
    • setNumCategoriesToDiscretize

      public void setNumCategoriesToDiscretize(int numCategoriesToDiscretize)
      Sets the number of categories to use to discretize child variables to avoid integration
      Parameters:
      numCategoriesToDiscretize - This number.
      See Also: