integrated#
This subpackage implements the Kalman filter and RTS smoother for an augmented
state space model which includes an integral state as a
IntegratedStateSpaceSolver. This is intended to be used with
smolgp.kernels.integrated state space models to properly account
for integrated (e.g. exposure-averaged) measurements.
See Integrated Measurements for a tutorial on using the integrated solvers.
Submodules#
Classes#
A solver that uses |
|
A solver that uses |
Package Contents#
- class smolgp.solvers.integrated.IntegratedStateSpaceSolver(kernel: smolgp.kernels.base.StateSpaceModel, X: tinygp.helpers.JAXArray, noise: tinygp.helpers.JAXArray)[source]#
Bases:
smolgp.solvers.base.SolverA solver that uses
jax.lax.scanto implement Kalman filtering and RTS smoothing for integrated measurements- kernel#
- X#
- noise#
- state_coords#
- smoothing_gains(P_filtered, P_predicted) tinygp.helpers.JAXArray[source]#
The RTS smoothing gains G_k; see
smolgp.solvers.solver.StateSpaceSolver.smoothing_gains().Additionally threads the exposure reset bookkeeping, which the integrated smoother applies at every
stateid == 0state.
- condition_batched_mean(y_batch: tinygp.helpers.JAXArray) tinygp.helpers.JAXArray[source]#
Batched-mean-path variant of condition() for M residual/observation arrays sharing this solver’s (kernel, X, noise). See StateSpaceSolver.condition_batched_mean for the general idea; this additionally threads the reset-matrix bookkeeping through integrated_kalman_gains/integrated_kalman_filter_batched_mean.
- Parameters:
y_batch – shape (M, N) or (M, N, D)
- Returns:
shape (M, K, dim)
- Return type:
m_smoothed_batch
- predict(X_test, conditioned_results, y=None) tinygp.helpers.JAXArray[source]#
Algorithm for making predictions at arbitrary coordinates X_test
- Parameters:
X_test – The test coordinates. If a tuple
(t, delta, instid)with anydelta > 0andyis also given, those test points are predicted as exposure-integrated averages (seepredict_exposure()) rather than instantaneous values.conditioned_results – The output of self.condition()
y – The training data used to condition this solver. Only needed for
delta>0test points.
- Returns:
Predicted means of the states at X_test pred_var : Predicted variances of the states at X_test
- Return type:
pred_mean
- There are three cases for each test point:
- Retrodictionsmoothing from the first data point
using the prior as the prediction
- Interpolationfiltering from most recent data point
and smoothing from next future point
Extrapolation : predicting from final filtered point
- class smolgp.solvers.integrated.ParallelIntegratedStateSpaceSolver(kernel: smolgp.kernels.base.StateSpaceModel, X: tinygp.helpers.JAXArray, noise: tinygp.helpers.JAXArray)[source]#
Bases:
smolgp.solvers.integrated.solver.IntegratedStateSpaceSolverA solver that uses
jax.lax.associative_scanto implement parallel Kalman filtering and RTS smoothing for integrated measurements- _instid_per_state: tinygp.helpers.JAXArray#
- log_probability(y) tinygp.helpers.JAXArray[source]#
The marginal log likelihood, reduced from this solver’s own filter.
Overrides
IntegratedStateSpaceSolver.log_probability()deliberately, as that is an optimized sequential scan. The generic path to reuse the Kalman filteredvandSis better here, as those are determined via associative scan, hence the likelihood stays log-depth.