condition

Contents

condition#

hybrid_aif.inference.condition(g, H, c, noise, y)[source]#

Bayesian update of g on y = H x + c + eps, eps ~ N(0, R).

Returns (posterior, log_marginal), log_marginal = log p(y). noise is the noise: a lower-triangular Cholesky factor R_chol with R = R_chol R_cholᵀ, or a DiagonalNoise.

  • A Cholesky factor takes the update in observation space: log p(y) from the innovation covariance’s Cholesky factor, and the covariance from the Joseph form in Gram factors, so the posterior stays SPD for near-singular gains. O(d_obs³ + d_obs² d).

  • A DiagonalNoise takes it in state space (_condition_diagonal()): the square-root information form, with the log evidence from the matrix determinant lemma and the Woodbury identity. No d_obs by d_obs array is formed; O(d_obs n²) with n = d, or d plus the number of columns of the noise’s low_rank when it has one.