lisa_noise.inference.mle¶
Classes¶
Holds the result of an MLE optimisation run. |
Functions¶
|
Single-start MLE via L-BFGS-B. Good for warm-starting from a previous segment. |
|
Multi-round zooming MLE. Keeps top-K converged results per round as new centres, |
Module Contents¶
- class lisa_noise.inference.mle.MLEResult¶
Holds the result of an MLE optimisation run.
- x: numpy.ndarray¶
- log_likelihood: float¶
- converged: bool¶
- nit: int¶
- lisa_noise.inference.mle.find_mle(log_likelihood_fn: Callable, x0: numpy.ndarray, bounds: lisa_noise.types.Bounds, tol: float = 1e-08, maxiter: int = 2000, verbose: bool = False, x_ref: numpy.ndarray | None = None, use_jax: bool = False) MLEResult¶
Single-start MLE via L-BFGS-B. Good for warm-starting from a previous segment.
If x_ref is provided and the primary result has lower log-likelihood than log_likelihood_fn(x_ref), the optimiser re-runs from x_ref automatically.
- Parameters:
log_likelihood_fn (Callable) – A function that takes a parameter vector and returns the log-likelihood.
x0 (np.ndarray) – Initial guess for the optimiser.
bounds (Bounds) – Tuple of (lower_bounds, upper_bounds) for the parameters.
tol (float) – Gradient-norm tolerance for convergence.
maxiter (int) – Maximum number of iterations.
verbose (bool) – If True, print L-BFGS-B progress to stdout.
x_ref (np.ndarray or None) – Optional reference point. If the result is worse than logL(x_ref), the optimiser re-runs from x_ref.
use_jax (bool) – If True, use JAX autodiff for exact gradients. If False (default), let scipy estimate gradients numerically.
- Return type:
- lisa_noise.inference.mle.find_mle_zoom(log_likelihood_fn: Callable, bounds: lisa_noise.types.Bounds, *, n_rounds: int = 3, n_starts: int = 100, zoom_factor: float = 0.5, top_k: int = 3, rng: numpy.random.Generator | None = None, tol: float = 1e-08, polish_tol: float = 1e-14, maxiter: int = 2000, use_jax: bool = False) MLEResult¶
Multi-round zooming MLE. Keeps top-K converged results per round as new centres, shrinks windows by zoom_factor, then fine tunes the global best at tight tolerance.
- Parameters:
log_likelihood_fn (Callable) – A function that takes a parameter vector and returns the log-likelihood.
bounds (Bounds) – Tuple of (lower_bounds, upper_bounds) for the parameters.
n_rounds (int) – Number of zoom rounds to perform.
n_starts (int) – Total number of random initial points to try across all rounds (divided among centres).
zoom_factor (float) – Factor by which to shrink the search windows each round (e.g., 0.5 halves the width).
top_k (int) – Number of top results to keep as centres for the next round.
rng (np.random.Generator | None) – Optional random number generator for reproducibility. If None, a new generator is created.
tol (float) – Tolerance for convergence (gradient norm) in the zoom rounds.
polish_tol (float) – Tolerance for convergence in the final polishing phase.
maxiter (int) – Maximum number of iterations for the optimiser in both the zoom rounds and polishing phase.
use_jax (bool) – If True, use JAX autodiff for exact gradients. If False (default), let scipy estimate gradients numerically.
- Return type: