Class EssLikePython

java.lang.Object
edu.cmu.tetrad.util.EssLikePython

public final class EssLikePython extends Object
The EssLikePython class provides methods for estimating the Effective Sample Size (ESS) of a dataset using procedures that closely mimic functionality found my Python script. This includes column standardization, row sampling, and computation of correlations to derive the ESS value.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Encapsulates the results of an estimation process, including average row correlation, effective sample size (ESS), and the number of rows used in the computation.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor for the EssLikePython class.
  • Method Summary

    Modifier and Type
    Method
    Description
    estimateLikePython(org.ejml.simple.SimpleMatrix X, int sampleSize, boolean clampNonnegative, Random rng)
    Estimates the effective sample size (ESS) and average row correlation (avgRowCorr) from a given dataset, by column-standardizing, sampling rows, and computing row-wise correlations.

    Methods inherited from class java.lang.Object

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

    • EssLikePython

      public EssLikePython()
      Default constructor for the EssLikePython class. Initializes a new instance of the EssLikePython class.
  • Method Details

    • estimateLikePython

      public static EssLikePython.Result estimateLikePython(org.ejml.simple.SimpleMatrix X, int sampleSize, boolean clampNonnegative, Random rng)
      Estimates the effective sample size (ESS) and average row correlation (avgRowCorr) from a given dataset, by column-standardizing, sampling rows, and computing row-wise correlations. Optionally clamps the correlation to ensure non-negativity.
      Parameters:
      X - the input data matrix where rows represent observations and columns represent variables
      sampleSize - the number of rows to sample without replacement during the estimation process
      clampNonnegative - a flag indicating whether to clamp avgRowCorr to nonnegative values
      rng - a Random object to control the random sampling of rows (if null, a default seed is used)
      Returns:
      a Result object containing the estimated avgRowCorr, computed ESS, and the number of rows used