Class LagReplicationPolicy

java.lang.Object
edu.cmu.tetrad.graph.LagReplicationPolicy
All Implemented Interfaces:
EdgeReplicationPolicy, TetradSerializable, Serializable

public final class LagReplicationPolicy extends Object implements EdgeReplicationPolicy, TetradSerializable
SVAR-style lag mirroring policy.

Node naming: base at lag 0 is "X"; lagged versions are "X:1", "X:2", ... When edge A@la —?→ B@lb mutates, mirror for all t where A@t and B@(t + (lb - la)) both exist.

See Also:
  • Constructor Details

    • LagReplicationPolicy

      public LagReplicationPolicy()
      Default constructor for the LagReplicationPolicy class. Initializes the policy with default values for minimum lag, maximum lag, and step size. The default values are: - minLag: null - maxLag: null - step: 1
    • LagReplicationPolicy

      public LagReplicationPolicy(Integer minLag, Integer maxLag, int step)
      Constructs a LagReplicationPolicy object with specified minimum lag, maximum lag, and lag step size.
      Parameters:
      minLag - the minimum lag value. Can be null to specify no lower bound.
      maxLag - the maximum lag value. Can be null to specify no upper bound.
      step - the step size to increment lag values. Must be greater than or equal to 1.
      Throws:
      IllegalArgumentException - if the step is less than 1.
  • Method Details

    • mirrorsFor

      public Set<Edge> mirrorsFor(EdgeListGraph g, Edge e)
      Generates a set of mirrored edges for a given edge in the graph, based on the lagging conventions of the node names. The method computes potential edges by taking into account the specified lag shifts between connected nodes and a defined lagging policy (minimum lag, maximum lag, and step size). If lagging conventions are not met, the original edge is returned as the only element in the result.
      Specified by:
      mirrorsFor in interface EdgeReplicationPolicy
      Parameters:
      g - the graph containing the nodes and edges
      e - the edge for which mirrored edges are to be computed
      Returns:
      a set of edges that represent the mirrors of the provided edge based on lag conventions