Batch Least Squares¶
Iterative batch least squares estimator for offline orbit determination.
BatchLeastSquares ¶
BatchLeastSquares(epoch: Any, initial_state: Any, initial_covariance: Any, propagation_config: Any, force_config: Any, measurement_models: Any, config: Any = None, params: Any = None, additional_dynamics: Any = None, control_input: Any = None)
Batch Least Squares estimator for orbit determination.
Processes all observations simultaneously through an iterative Gauss-Newton algorithm. Supports both normal equations and stacked observation matrix solver formulations.
Example
Initialize instance.
consider_covariance method descriptor ¶
consider_covariance() -> ndarray
Consider covariance contribution.
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray or None: Consider covariance matrix, or None if consider parameters are not configured. |
current_covariance method descriptor ¶
current_covariance() -> ndarray
Get current total covariance (formal + consider contribution).
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: Total covariance matrix (n x n). |
current_epoch method descriptor ¶
current_epoch() -> Epoch
Get current epoch (reference epoch for the batch).
Returns:
| Name | Type | Description |
|---|---|---|
Epoch | Epoch | Current epoch. |
current_state method descriptor ¶
current_state() -> ndarray
Get current state estimate at the reference epoch.
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: Current state vector. |
formal_covariance method descriptor ¶
formal_covariance() -> ndarray
Formal covariance (solve-for partition only).
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: Formal covariance matrix. |
iteration_records method descriptor ¶
iteration_records() -> list[BLSIterationRecord]
Per-iteration diagnostic records.
Only populated when config.store_iteration_records is True.
Returns:
| Type | Description |
|---|---|
list[BLSIterationRecord] | list[BLSIterationRecord]: List of iteration records. |
iterations_completed method descriptor ¶
iterations_completed() -> int
Number of Gauss-Newton iterations completed.
Returns:
| Name | Type | Description |
|---|---|---|
int | int | Number of iterations. |
observation_residuals method descriptor ¶
observation_residuals() -> list[list[BLSObservationResidual]]
Per-observation residuals for each iteration.
Only populated when config.store_observation_residuals is True. Outer list is indexed by iteration, inner list by observation.
Returns:
| Type | Description |
|---|---|
list[list[BLSObservationResidual]] | list[list[BLSObservationResidual]]: Nested list of observation residuals. |
solve method descriptor ¶
solve(observations: list[Observation]) -> Any
Solve the batch least squares problem.
Iteratively processes all observations to find the state that minimizes the weighted sum of squared residuals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
observations | list[Observation] | List of observations to process. | required |
BLSConfig ¶
BLSConfig(solver_method: Any = 0, max_iterations: Any = 10, state_correction_threshold: Any = Ellipsis, cost_convergence_threshold: Any = None, consider_params: Any = None, store_iteration_records: Any = True, store_observation_residuals: Any = True)
Configuration for the Batch Least Squares estimator.
Example
Initialize instance.
solver_method property ¶
solver_method: int
Solver method (0 = NormalEquations, 1 = StackedObservationMatrix).
Returns:
| Name | Type | Description |
|---|---|---|
int | int | Solver method identifier. |
state_correction_threshold property ¶
state_correction_threshold: float
State correction convergence threshold.
Returns:
| Type | Description |
|---|---|
float | float or None: Threshold value. |
store_iteration_records property ¶
store_iteration_records: bool
Whether iteration records are stored.
Returns:
| Name | Type | Description |
|---|---|---|
bool | bool | True if records are stored. |
BLSSolverMethod ¶
Solver formulation for Batch Least Squares.
Available methods
BLSSolverMethod.NORMAL_EQUATIONS(0): Accumulate information matrix, solve via Cholesky. Memory-efficient O(n^2).BLSSolverMethod.STACKED_OBSERVATION_MATRIX(1): Build full H matrix, better numerical conditioning. Memory O(m*n).
Example
Initialize instance.
NORMAL_EQUATIONS class-attribute ¶
NORMAL_EQUATIONS: Any = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating-point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
STACKED_OBSERVATION_MATRIX class-attribute ¶
STACKED_OBSERVATION_MATRIX: Any = 1
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating-point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.
int('0b100', base=0) 4
ConsiderParameterConfig ¶
Configuration for consider parameters in batch estimation.
Partitions the state into solve-for (first n_solve elements) and consider (remaining elements) parameters. The consider parameters are not estimated but their uncertainty is accounted for in the covariance.
Example
Initialize instance.
BLSIterationRecord ¶
Record of a single BLS iteration.
Contains the state estimate, covariance, state correction, cost, and residual statistics at each Gauss-Newton iteration.
Initialize instance.
cost property ¶
cost: float
Cost function value J at this iteration.
Returns:
| Name | Type | Description |
|---|---|---|
float | float | Cost function value. |
covariance property ¶
covariance: ndarray
Covariance at this iteration (formal, solve-for only).
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: Covariance matrix. |
rms_postfit_residual property ¶
rms_postfit_residual: float
RMS of all post-fit residuals at this iteration.
Returns:
| Name | Type | Description |
|---|---|---|
float | float | Post-fit RMS. |
rms_prefit_residual property ¶
rms_prefit_residual: float
RMS of all pre-fit residuals at this iteration.
Returns:
| Name | Type | Description |
|---|---|---|
float | float | Pre-fit RMS. |
BLSObservationResidual ¶
Per-observation residual from a BLS iteration.
Contains pre-fit and post-fit residuals for a single observation.
Initialize instance.
See Also¶
- Batch Least Squares (Learn) -- conceptual guide
- Measurement Models -- built-in and custom models