Class MagOrderProjection
Coverage of the space. Every MAG's directed part is acyclic, so every MAG is consistent with some total order; the order space with this projection therefore reaches all of MAG space, up to the projection finding the best member of M(order), the ancestral graphs whose directed edges respect the order.
Procedure. Two phases, both hill climbs on MagRicfBicScorer.score(Graph) (exact Gaussian
BIC; the scorer's district cache makes repeated evaluations cheap):
- Forward pass: for each variable v in order, best-first single moves restricted to v's incoming pairs (add a directed or bidirected edge from a predecessor, delete, or retype), until none improves — a typed grow-shrink.
- Polish: the same best-first single moves over all order-respecting pairs, until none improves. This repairs choices the forward pass made before later structure existed, since a bidirected edge couples the fit of both endpoints' districts and per-node choices are not separable as they are for DAGs.
Deterministic: moves are enumerated in a fixed order (later endpoint, then earlier endpoint, then move type with deletions first and directed before bidirected), and the first move achieving the best strict improvement wins ties.
Honest status. The hill climbs come with no reachability guarantee: there is no theorem that the best-scoring member of M(order) is found, nor (even at the true order, in the population) that the true MAG's equivalence class is reached — that is exactly what the oracle tests probe empirically. The output is an ancestral graph but is not forced to be maximal; in the population, under faithfulness, a non-maximal output would fit strictly worse than its completion wherever the missing inducing-path edge's parameter is needed, so maximality is expected rather than enforced, and the tests check it.
- Author:
- josephramsey
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMagOrderProjection(MagRicfBicScorer scorer) Constructs the projection over the given scorer. -
Method Summary
Modifier and TypeMethodDescriptionintThe number of successful plateau escapes in the last projection.intThe number of candidate moves in the last projection whose scoring threw (singular subproblem) and were treated as non-improving.booleanWhether some plateau-escape attempt in the last projection hit its state cap (if so, an exit from the plateau may have been missed).booleanWhether the last projection hit the polish-phase move cap (it should not; if it did, the result may not be at a local optimum).Projects the order to a high-scoring ancestral graph consistent with it.Projects the order, warm-started from an earlier projection's graph: the warm start's order-consistent edges (directed edges whose tail precedes their head in the new order, and all bidirected edges) seed the state, the forward phases are skipped, and only the polish and plateau-escape phases run.voidsetImprovementEpsilon(double improvementEpsilon) Sets the minimum score improvement for a move to be accepted.voidsetMaxPlateauDepth(int maxPlateauDepth) Sets the cap on the length of a plateau path (chain of neutral retypes) per escape attempt.voidsetMaxPlateauStates(int maxPlateauStates) Sets the cap on distinct plateau states visited per escape attempt.voidsetMaxPolishMoves(int maxPolishMoves) Sets the safety cap on accepted moves in the polish phase.voidsetPlateauEscapesEnabled(boolean plateauEscapesEnabled) Turns the polish phase's plateau escapes on or off; see the field.
-
Constructor Details
-
MagOrderProjection
Constructs the projection over the given scorer.- Parameters:
scorer- the MAG BIC scorer; its covariance matrix fixes the variable set.
-
-
Method Details
-
project
-
project
Projects the order, warm-started from an earlier projection's graph: the warm start's order-consistent edges (directed edges whose tail precedes their head in the new order, and all bidirected edges) seed the state, the forward phases are skipped, and only the polish and plateau-escape phases run. Intended for the outer order search, where successive orders differ by one relocation and most of the previous graph remains both legal and right.- Parameters:
order- a total order of the scorer's variables.warmStart- a graph from an earlier projection over the same variables, or null for a cold projection (the full four phases).- Returns:
- the projected graph, over the given order's nodes.
-
setImprovementEpsilon
public void setImprovementEpsilon(double improvementEpsilon) Sets the minimum score improvement for a move to be accepted.- Parameters:
improvementEpsilon- a positive threshold on score deltas.
-
setMaxPolishMoves
public void setMaxPolishMoves(int maxPolishMoves) Sets the safety cap on accepted moves in the polish phase.- Parameters:
maxPolishMoves- a positive cap.
-
setPlateauEscapesEnabled
public void setPlateauEscapesEnabled(boolean plateauEscapesEnabled) Turns the polish phase's plateau escapes on or off; see the field. Default on.- Parameters:
plateauEscapesEnabled- true to attempt plateau escapes.
-
setMaxPlateauStates
public void setMaxPlateauStates(int maxPlateauStates) Sets the cap on distinct plateau states visited per escape attempt.- Parameters:
maxPlateauStates- a positive cap.
-
setMaxPlateauDepth
public void setMaxPlateauDepth(int maxPlateauDepth) Sets the cap on the length of a plateau path (chain of neutral retypes) per escape attempt.- Parameters:
maxPlateauDepth- a positive cap.
-
isPolishCapHit
public boolean isPolishCapHit()Whether the last projection hit the polish-phase move cap (it should not; if it did, the result may not be at a local optimum).- Returns:
- true iff the cap was hit.
-
isPlateauCapHit
public boolean isPlateauCapHit()Whether some plateau-escape attempt in the last projection hit its state cap (if so, an exit from the plateau may have been missed).- Returns:
- true iff the cap was hit.
-
getPlateauEscapes
public int getPlateauEscapes()The number of successful plateau escapes in the last projection.- Returns:
- the count.
-
getUnscorableMoves
public int getUnscorableMoves()The number of candidate moves in the last projection whose scoring threw (singular subproblem) and were treated as non-improving.- Returns:
- the count.
-