Class DataAudit.Config
java.lang.Object
edu.cmu.tetrad.data.audit.DataAudit.Config
- Enclosing class:
DataAudit
Thresholds for the audit's checks, with defaults. Instances are immutable; use the with-methods to derive
variants. The defaults are rules of thumb, documented per field; they are deliberately conservative, in the
sense that they flag situations most practitioners would want to know about.
- Version:
- $Id: $Id
- Author:
- josephramsey
-
Constructor Summary
ConstructorsConstructorDescriptionConfig()Constructs a config with default thresholds.Config(int fewContinuousValues, int manyDiscreteLevels, int smallCellCount, double minExpectedPairwiseCell, double highCorrelation, double r2Determinism, double etaSquaredDeterminism, double adAlpha, int minAdSampleSize, double lowSampleRatio, double nearConstantFrequency, double nearConstantVariance) Constructs a config with the given thresholds.Config(int fewContinuousValues, int manyDiscreteLevels, int smallCellCount, double minExpectedPairwiseCell, double highCorrelation, double r2Determinism, double etaSquaredDeterminism, double adAlpha, int minAdSampleSize, double lowSampleRatio, double nearConstantFrequency, double nearConstantVariance, int serialMaxLag, double serialAlpha, double serialMinAbsAutocorrelation, int minSerialSampleSize, String serialGroupVariable) Constructs a config with the given thresholds, including the serial dependence settings. -
Method Summary
Modifier and TypeMethodDescriptionwithAdAlpha(double adAlpha) Returns a config identical to this one but with the given Anderson-Darling alpha.withBoundaryAtomMaxGapFraction(double boundaryAtomMaxGapFraction) Returns a config identical to this one but with the given small-gap fraction (seeboundaryAtomMaxGapFraction).withBoundaryAtomMinMass(double boundaryAtomMinMass) Returns a config identical to this one but with the given minimum mass for BOUNDARY_ATOM.withCellDeterminismMaxCardinality(int cellDeterminismMaxCardinality) Returns a config identical to this one but with the given maximum distinct-value count for members of determining sets in the cell-determinism check.withCellDeterminismMaxSetSize(int cellDeterminismMaxSetSize) Returns a config identical to this one but with the given maximum determining-set size for the cell-determinism check (0 disables the check).withCellDeterminismTolerance(double cellDeterminismTolerance) Returns a config identical to this one but with the given relative tolerance for the cell-determinism check.withHighCorrelation(double highCorrelation) Returns a config identical to this one but with the given high-correlation threshold.withNonlinearDeterminismMaxSetSize(int nonlinearDeterminismMaxSetSize) Returns a config identical to this one but with the given nonlinear near-determinism maximum determining-set size (0 disables the check).withNonlinearR2Determinism(double nonlinearR2Determinism) Returns a config identical to this one but with the given nonlinear near-determinism threshold.withSentinelGapRatio(double sentinelGapRatio) Returns a config identical to this one but with the given minimum gap-to-median-spacing ratio for SENTINEL_VALUE.withSentinelMinCount(int sentinelMinCount) Returns a config identical to this one but with the given minimum cell count for SENTINEL_VALUE.withSentinelMinDistinct(int sentinelMinDistinct) Returns a config identical to this one but with the given minimum distinct-value count for the SENTINEL_VALUE check to run.withSentinelMinMass(double sentinelMinMass) Returns a config identical to this one but with the given minimum observed-value share for SENTINEL_VALUE.withSerialAlpha(double serialAlpha) Sets the serial correlation alpha value.withSerialGroupVariable(String serialGroupVariable) Returns a config identical to this one but with the given serial dependence grouping variable.withSmallCellCount(int smallCellCount) Returns a config identical to this one but with the given small-cell count threshold.
-
Constructor Details
-
Config
public Config()Constructs a config with default thresholds. -
Config
public Config(int fewContinuousValues, int manyDiscreteLevels, int smallCellCount, double minExpectedPairwiseCell, double highCorrelation, double r2Determinism, double etaSquaredDeterminism, double adAlpha, int minAdSampleSize, double lowSampleRatio, double nearConstantFrequency, double nearConstantVariance) Constructs a config with the given thresholds. See the field documentation for meanings.- Parameters:
fewContinuousValues- threshold for CONTINUOUS_FEW_VALUES.manyDiscreteLevels- threshold for DISCRETE_MANY_LEVELS.smallCellCount- threshold for SMALL_MARGINAL_CELL.minExpectedPairwiseCell- threshold for SMALL_PAIRWISE_CELLS.highCorrelation- threshold for HIGH_CORRELATION.r2Determinism- threshold for NEAR_DETERMINISM_LINEAR.etaSquaredDeterminism- threshold for NEAR_DETERMINISM_DISCRETE_CONTINUOUS.adAlpha- alpha for NON_GAUSSIAN.minAdSampleSize- minimum column n for the Anderson-Darling test.lowSampleRatio- threshold for LOW_SAMPLE_RATIO.nearConstantFrequency- modal-frequency threshold for discrete NEAR_CONSTANT.nearConstantVariance- variance threshold for continuous NEAR_CONSTANT.
-
Config
public Config(int fewContinuousValues, int manyDiscreteLevels, int smallCellCount, double minExpectedPairwiseCell, double highCorrelation, double r2Determinism, double etaSquaredDeterminism, double adAlpha, int minAdSampleSize, double lowSampleRatio, double nearConstantFrequency, double nearConstantVariance, int serialMaxLag, double serialAlpha, double serialMinAbsAutocorrelation, int minSerialSampleSize, String serialGroupVariable) Constructs a config with the given thresholds, including the serial dependence settings. See the field documentation for meanings.- Parameters:
fewContinuousValues- threshold for CONTINUOUS_FEW_VALUES.manyDiscreteLevels- threshold for DISCRETE_MANY_LEVELS.smallCellCount- threshold for SMALL_MARGINAL_CELL.minExpectedPairwiseCell- threshold for SMALL_PAIRWISE_CELLS.highCorrelation- threshold for HIGH_CORRELATION.r2Determinism- threshold for NEAR_DETERMINISM_LINEAR.etaSquaredDeterminism- threshold for NEAR_DETERMINISM_DISCRETE_CONTINUOUS.adAlpha- alpha for NON_GAUSSIAN.minAdSampleSize- minimum column n for the Anderson-Darling test.lowSampleRatio- threshold for LOW_SAMPLE_RATIO.nearConstantFrequency- modal-frequency threshold for discrete NEAR_CONSTANT.nearConstantVariance- variance threshold for continuous NEAR_CONSTANT.serialMaxLag- number of lags for SERIAL_DEPENDENCE (0 disables the check).serialAlpha- Ljung-Box alpha for SERIAL_DEPENDENCE.serialMinAbsAutocorrelation- minimum largest absolute autocorrelation for SERIAL_DEPENDENCE.minSerialSampleSize- minimum column n for the serial dependence check.serialGroupVariable- name of a discrete grouping variable for within-group autocorrelations, or null.
-
-
Method Details
-
withHighCorrelation
Returns a config identical to this one but with the given high-correlation threshold.- Parameters:
highCorrelation- the new threshold.- Returns:
- the new config.
-
withSmallCellCount
Returns a config identical to this one but with the given small-cell count threshold.- Parameters:
smallCellCount- the new threshold.- Returns:
- the new config.
-
withAdAlpha
Returns a config identical to this one but with the given Anderson-Darling alpha.- Parameters:
adAlpha- the new alpha.- Returns:
- the new config.
-
withSerialGroupVariable
Returns a config identical to this one but with the given serial dependence grouping variable.- Parameters:
serialGroupVariable- the name of a discrete grouping variable, or null for no grouping.- Returns:
- the new config.
-
withCellDeterminismMaxSetSize
Returns a config identical to this one but with the given maximum determining-set size for the cell-determinism check (0 disables the check).- Parameters:
cellDeterminismMaxSetSize- the new maximum set size.- Returns:
- the new config.
-
withCellDeterminismMaxCardinality
Returns a config identical to this one but with the given maximum distinct-value count for members of determining sets in the cell-determinism check.- Parameters:
cellDeterminismMaxCardinality- the new maximum cardinality.- Returns:
- the new config.
-
withCellDeterminismTolerance
Returns a config identical to this one but with the given relative tolerance for the cell-determinism check.- Parameters:
cellDeterminismTolerance- the new tolerance.- Returns:
- the new config.
-
withNonlinearR2Determinism
Returns a config identical to this one but with the given nonlinear near-determinism threshold.- Parameters:
nonlinearR2Determinism- the new threshold.- Returns:
- the new config.
-
withNonlinearDeterminismMaxSetSize
Returns a config identical to this one but with the given nonlinear near-determinism maximum determining-set size (0 disables the check).- Parameters:
nonlinearDeterminismMaxSetSize- the new maximum set size.- Returns:
- the new config.
-
withSerialAlpha
Sets the serial correlation alpha value.- Parameters:
serialAlpha- the serial correlation alpha value.- Returns:
- a new Config object with the updated serial correlation alpha value.
-
withSentinelMinCount
Returns a config identical to this one but with the given minimum cell count for SENTINEL_VALUE.- Parameters:
sentinelMinCount- the new value.- Returns:
- the new config.
-
withSentinelMinMass
Returns a config identical to this one but with the given minimum observed-value share for SENTINEL_VALUE.- Parameters:
sentinelMinMass- the new value.- Returns:
- the new config.
-
withSentinelGapRatio
Returns a config identical to this one but with the given minimum gap-to-median-spacing ratio for SENTINEL_VALUE.- Parameters:
sentinelGapRatio- the new value.- Returns:
- the new config.
-
withSentinelMinDistinct
Returns a config identical to this one but with the given minimum distinct-value count for the SENTINEL_VALUE check to run.- Parameters:
sentinelMinDistinct- the new value.- Returns:
- the new config.
-
withBoundaryAtomMinMass
Returns a config identical to this one but with the given minimum mass for BOUNDARY_ATOM.- Parameters:
boundaryAtomMinMass- the new threshold.- Returns:
- the new config.
-
withBoundaryAtomMaxGapFraction
Returns a config identical to this one but with the given small-gap fraction (seeboundaryAtomMaxGapFraction).- Parameters:
boundaryAtomMaxGapFraction- the new fraction of the observed range.- Returns:
- the new config.
-