Class Lofs

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

public class Lofs extends Object

Implements a number of methods which take a fixed graph as input and use linear, non-Gaussian methods to orient the edges in the graph. where the acronym stands for linear, non-Gaussian Orientation with a Fixed graph Structure (LOFS). The options for different types of scores are given in the enum Lofs.Score. The options for rules to use to do the orientations are given in the enum, Lofs.Rule. Most of these are taken from the literature and can be googled, though we should certainly give this reference for several of them, to which we are indebted:

Hyvärinen, A., & Smith, S. M. (2013). Pairwise likelihood ratios for estimation of non-Gaussian structural equation models. The Journal of Machine Learning Research, 14(1), 111-152.

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

Author:
josephramsey
See Also:
  • Constructor Details

    • Lofs

      public Lofs(Graph graph, List<DataSet> dataSets) throws IllegalArgumentException
      Constructor.
      Parameters:
      graph - The graph to be oriented. Orientations for the graph will be overwritten.
      dataSets - A list of datasets to use to do the orientation. This may be just one dataset. If more than one dataset are given, the data will be concatenated (pooled).
      Throws:
      IllegalArgumentException
  • Method Details

    • orient

      public Graph orient()
      Orients the graph and returns the oriented graph.
      Returns:
      The oriented graph.
    • setRule

      public void setRule(Lofs.Rule rule)
      Sets the rule to use to do the orientation.
      Parameters:
      rule - This rule.
      See Also:
    • setScore

      public void setScore(Lofs.Score score)
      Sets the (LoFS) score to use.
      Parameters:
      score - This score.
      See Also:
    • setSelfLoopStrength

      public void setSelfLoopStrength(double selfLoopStrength)
      Sets the self-loop strength, if applicable.
      Parameters:
      selfLoopStrength - This strength.
    • setAlpha

      public void setAlpha(double alpha)
      Sets the alpha to use, where applicable.
      Parameters:
      alpha - This alpha.
    • setOrientStrongerDirection

      public void setOrientStrongerDirection(boolean orientStrongerDirection)
      Sets whether orientation should be done in the stronger direction, where applicable.
      Parameters:
      orientStrongerDirection - True, if so.
    • setR2Orient2Cycles

      public void setR2Orient2Cycles(boolean r2Orient2Cycles)
      Sets for R2 whether cycles should be oriented.
      Parameters:
      r2Orient2Cycles - True, if so.
    • scoreRow

      public double scoreRow(int rowIndex, Matrix data, List<List<Integer>> rows, List<List<Double>> parameters)
    • setEpsilon

      public void setEpsilon(double epsilon)
    • setKnowledge

      public void setKnowledge(Knowledge knowledge)
    • getPValue

      public double getPValue(double fisherZ)
      Returns:
      the probability associated with the most recently computed independence test.
    • kernel

      public double kernel(double z)
    • kernel1

      public double kernel1(double z)
    • kernel2

      public double kernel2(double z)
    • kernel3

      public double kernel3(double z)
    • kernel4

      public double kernel4(double z)
    • kernel5

      public double kernel5(double z)
    • kernel6

      public double kernel6(double z)
    • kernel7

      public double kernel7(double z)
    • kernel8

      public double kernel8(double z)