SFI.inference.sparse.hillclimb module

SFI.inference.sparse.hillclimb — Stochastic hill-climbing selection

Implements the search strategy described in Gerardos & Ronceray (2025): starting from an initial model, accept random single-parameter additions or removals if they increase the chosen information criterion, until convergence. Multiple independent chains are run in parallel, one per cardinality k ∈ {0, …, max_k} (including the null and full models), each starting from a uniformly random support of size k.

This is complementary to the deterministic strategies (greedy, beam):

  • Greedy / beam explore a systematic path and may get trapped in a single monotonic trajectory through the lattice.

  • Hill-climbing performs a stochastic local search at every complexity level, which can escape greedy traps and explore broader neighbourhoods of the combinatorial lattice.

References

  • Gerardos, A. & Ronceray, P. (2025). “Principled model selection for stochastic dynamics.” (describes the algorithm in the main text.)

class SFI.inference.sparse.hillclimb.HillClimbStrategy(*, ic='PASTIS', p_param=0.001, tau=None, gamma=0.5, patience=200, seed=None, report_time=False)[source]

Bases: SparsityStrategy

Stochastic hill-climbing model selection.

For each cardinality k ∈ {0, …, max_k}, a chain starts from a random support of size k and accepts random add/remove moves that improve the chosen information criterion, stopping after patience consecutive failures. The best-per-k results form the Pareto front returned as a SparsityResult.

This is the search algorithm described in Gerardos & Ronceray (2025), §”Model selection”, which recommends parallel searches from null, full, and random starting points.

Parameters:
  • ic (str, default "PASTIS") – Information criterion used as the acceptance objective. One of "AIC", "BIC", "EBIC", "PASTIS", "SIC".

  • p_param (float, default 1e-3) – PASTIS significance level \(p_0\).

  • tau (float or None) – Total trajectory time (required for BIC / EBIC).

  • gamma (float, default 0.5) – EBIC tuning parameter (\(\gamma \in [0,1]\)).

  • patience (int, default 200) – Stop a chain after this many consecutive rejected moves.

  • seed (int or None) – Random seed for reproducibility.

  • report_time (bool, default False) – Log elapsed wall-clock time when done.

name: str = 'hillclimb'

Short identifier used in SparsityResult.method.

run(scorer, *, max_k, **_kwargs)[source]

Execute the search and return a SparsityResult.

Parameters:
  • scorer (SparseScorer) – Provides info_and_coeffs / vmap_info for evaluating candidate supports.

  • max_k (int) – Maximum model size to explore.

Return type:

SparsityResult