Enum Class Fask.TwoCycleRule
- All Implemented Interfaces:
Serializable, Comparable<Fask.TwoCycleRule>, Constable
- Enclosing class:
Fask
Both rules share the same acceptance logic; they differ only in what is compared, and that difference decides whether the test has an error rate at all.
- Author:
- Joseph Ramsey
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCompare CORRELATIONS, as in the original FASK (Sanchez-Romero et al.Compare partial regression SLOPES rather than correlations. -
Method Summary
Modifier and TypeMethodDescriptionstatic Fask.TwoCycleRuleReturns the enum constant of this class with the specified name.static Fask.TwoCycleRule[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
CORRELATION_SHIFT
Compare CORRELATIONS, as in the original FASK (Sanchez-Romero et al. 2019, Algorithm 3). This is the published behaviour and the default.Be aware of its scope. Selecting on a variable changes that variable's variance, so the correlation of X and Y on the X > 0 half differs from the correlation on the whole sample even when X -> Y is a plain one-directional linear edge. The shift the test looks for is therefore a nonzero population quantity under acyclicity, while the standard errors shrink like 1/sqrt(n), so the false-positive rate rises toward 1 with sample size instead of sitting at alpha. Measured on a single acyclic edge at alpha = 0.01 (see
FaskTwoCycleFprHarness), the rate reaches 1.000 by n = 20000 for Gumbel, Beta, uniform, Laplace and Gaussian noise. Exponential noise is the exception, holding at about 0.01 at every n, because there the correlation happens to be invariant to the truncation; that strongly right-skewed regime is the one the rule was developed on. -
SLOPE_SHIFT
Compare partial regression SLOPES rather than correlations.Under an acyclic X -> Y the slope of Y on X is invariant to selecting on X, for every noise distribution, so an acyclic edge shifts on one side only and the test rejects; a two-cycle shifts on both sides and the test accepts. This gives the null a basis in acyclicity that the correlation comparison lacks, and it extends the test to symmetric non-Gaussian noise, where the correlation rule has no validity. On Gaussian data neither side shifts, so no two-cycle is reported - which is correct, a two-cycle in a Gaussian linear model being unidentifiable from observational data.
The standard error treats the truncated half and the full sample as independent, which they are not; because the two estimates are positively correlated the combined standard error is too large, so the test errs toward conservatism rather than toward false positives. Two limitations follow, both measured by
FaskTwoCycleRuleHarnessat alpha = 0.01 and worth knowing before relying on this rule. First, the conservatism costs power at moderate sample sizes: a same-sign two-cycle under exponential noise is detected at 0.358 at n = 1000, against the correlation rule's 1.000, and needs n = 5000 to reach 0.998; a mixed-sign two-cycle is detected much earlier, 0.995 at n = 1000. Second, size is not uniformly controlled: it is 0.000 for exponential, Gumbel, Beta and Gaussian noise at every sample size tested, but runs to roughly 0.2 for uniform and Laplace noise, where the normal-theory standard error does not describe the sampling distribution of the slope contrast. That is a plateau rather than the correlation rule's climb to 1, but it is still an order of magnitude above nominal, so a bootstrap or robust standard error is the natural next improvement here.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-