ostk.astrodynamics.solver.LeastSquaresSolver¶
- class LeastSquaresSolver(
- self: ostk.astrodynamics.solver.LeastSquaresSolver,
- maximum_iteration_count: int,
- rms_update_threshold: ostk.core.type.Real,
- finite_difference_solver: ostk.astrodynamics.solver.FiniteDifferenceSolver = FiniteDifferenceSolver.default(),
- maximum_iteration_count: int,
Bases:
pybind11_object
Class to solve non-linear least squares problems.
Constructor.
- Parameters:
maximum_iteration_count (int) -- Maximum number of iterations.
rms_update_threshold (float) -- Minimum RMS threshold.
finite_difference_solver (FiniteDifferenceSolver) -- Finite difference solver. Defaults to FiniteDifferenceSolver.Default().
Methods
Calculate the empirical covariance matrix from an array of state residuals.
Create a default instance of LeastSquaresSolver.
Get the finite difference solver.
Get the maximum iteration count.
Get the RMS update threshold.
Solve the non-linear least squares problem.
- class Analysis(self: ostk.astrodynamics.solver.LeastSquaresSolver.Analysis, termination_criteria: ostk.core.type.String, estimated_state: ostk::astrodynamics::trajectory::State, estimated_covariance: numpy.ndarray[numpy.float64[m, n]], estimated_frisbee_covariance: numpy.ndarray[numpy.float64[m, n]], computed_observations: list[ostk::astrodynamics::trajectory::State], steps: list[ostk.astrodynamics.solver.LeastSquaresSolver.Step])¶
Bases:
pybind11_object
Class representing the analysis of the least squares solver.
Constructor.
- Parameters:
termination_criteria (str) -- The termination criteria.
estimated_state (State) -- The estimated state.
estimated_covariance (np.ndarray) -- The estimated covariance matrix.
estimated_frisbee_covariance (np.ndarray) -- The estimated Frisbee covariance matrix.
computed_observations (list[State]) -- The computed observations of the final iteration.
steps (list[LeastSquaresSolver.Step]) -- The steps.
- compute_residual_states(self: ostk.astrodynamics.solver.LeastSquaresSolver.Analysis, observations: list[ostk::astrodynamics::trajectory::State]) list[ostk::astrodynamics::trajectory::State] ¶
Compute the residual states.
- property computed_observations¶
The computed observations of the final iteration.
- Type:
np.ndarray
- property estimated_covariance¶
The estimated covariance matrix.
- Type:
np.ndarray
- property estimated_frisbee_covariance¶
The estimated Frisbee covariance matrix.
- Type:
np.ndarray
- property steps¶
The steps.
- Type:
- class Step(
- self: ostk.astrodynamics.solver.LeastSquaresSolver.Step,
- rms_error: ostk.core.type.Real,
- x_hat: numpy.ndarray[numpy.float64[m, 1]],
- rms_error: ostk.core.type.Real,
Bases:
pybind11_object
Class representing a step in the least squares solver.
Constructor.
- Parameters:
rms_error (float) -- The RMS error.
x_hat (np.ndarray) -- The X hat vector.
- property x_hat¶
The X hat vector.
- Type:
np.ndarray
- static calculate_empirical_covariance(residuals: list[ostk::astrodynamics::trajectory::State]) numpy.ndarray[numpy.float64[m, n]] ¶
Calculate the empirical covariance matrix from an array of state residuals.
- Parameters:
- Returns:
The empirical covariance matrix.
- Return type:
np.ndarray
- Throws:
ostk::core::error::runtime::Undefined: If the residual array is empty.
- static default() ostk.astrodynamics.solver.LeastSquaresSolver ¶
Create a default instance of LeastSquaresSolver.
- Returns:
A default instance of LeastSquaresSolver.
- Return type:
- get_finite_difference_solver( ) ostk.astrodynamics.solver.FiniteDifferenceSolver ¶
Get the finite difference solver.
- Returns:
The finite difference solver.
- Return type:
- get_max_iteration_count( ) int ¶
Get the maximum iteration count.
- Returns:
The maximum iteration count.
- Return type:
- get_rms_update_threshold( ) ostk.core.type.Real ¶
Get the RMS update threshold.
- Returns:
The RMS update threshold.
- Return type:
- solve(self: ostk.astrodynamics.solver.LeastSquaresSolver, initial_guess: ostk::astrodynamics::trajectory::State, observations: list[ostk::astrodynamics::trajectory::State], state_generator: Callable[[ostk::astrodynamics::trajectory::State, list[ostk.physics.time.Instant]], list[ostk::astrodynamics::trajectory::State]], initial_guess_sigmas: dict[ostk::astrodynamics::trajectory::state::CoordinateSubset, numpy.ndarray[numpy.float64[m, 1]]] = {}, observation_sigmas: dict[ostk::astrodynamics::trajectory::state::CoordinateSubset, numpy.ndarray[numpy.float64[m, 1]]] = {}) ostk.astrodynamics.solver.LeastSquaresSolver.Analysis ¶
Solve the non-linear least squares problem.
- Parameters:
initial_guess (State) -- Initial guess state (the Estimated State is of the same domain as this state).
state_generator (callable[list[State],[State, list[Instant]]]) -- Function to generate states.
initial_guess_sigmas (dict[CoordinateSubset, np.ndarray], optional) -- Dictionary of sigmas for initial guess.
observation_sigmas (dict[CoordinateSubset, np.ndarray], optional) -- Dictionary of sigmas for observations.
- Returns:
The analysis of the estimate.
- Return type:
LeastSquaresSolver::Analysis