class_docstr: Class for a general Kalman filter working on Lie groups.
  
  Given an adapted model, it provides the tools to carry out non-linear state
  estimation with an error modeled on the Lie algebra. The model must provide
  the functions to propagate and update a state, the observation model, and
  the computation of the Jacobians.
  
  Parameter
  ---------
  model : {class, instance}
      Object representing an observed dynamical system.
docstr: Compute the Kalman gain given the observation model.
  
  Given the observation Jacobian H and covariance N (not necessarily
  equal to that of the sensor), and the current covariance P, the Kalman
  gain is K = P H^T(H P H^T + N)^{-1}.
  
  Parameters
  ----------
  observation : array-like, shape=[dim_obs]
      Obtained measurement.
  
  Returns
  -------
  gain : array-like, shape=[model.dim, model.dim_obs]
      Kalman gain.
docstr_tok: ["Compute","the","Kalman","gain","given","the","observation","model",".","Given","the","observation","Jacobian","H","and","covariance","N","(","not","necessarily","equal","to","that","of","the","sensor",")",",","and","the","current","covariance","P",",","the","Kalman","gain","is","K","=","P","H^T","(","H","P","H^T","+","N",")","^","{","-1","}",".","Parameters","--","--","--","--","--","observation",":","array-like",",","shape=","[","dim_obs","]","Obtained","measurement",".","Returns","--","--","--","-","gain",":","array-like",",","shape=","[","model.dim",",","model.dim_obs","]","Kalman","gain","."]
code: def compute_gain(self, observation):
      """Compute the Kalman gain given the observation model.
  
      Given the observation Jacobian H and covariance N (not necessarily
      equal to that of the sensor), and the current covariance P, the Kalman
      gain is K = P H^T(H P H^T + N)^{-1}.
  
      Parameters
      ----------
      observation : array-like, shape=[dim_obs]
          Obtained measurement.
  
      Returns
      -------
      gain : array-like, shape=[model.dim, model.dim_obs]
          Kalman gain.
      """
      obs_cov = self.model.get_measurement_noise_cov(
          self.state, self.measurement_noise
      )
      obs_jac = self.model.observation_jacobian(self.state, observation)
      expected_cov = Matrices.mul(
          obs_jac, self.covariance, Matrices.transpose(obs_jac)
      )
      innovation_cov = expected_cov + obs_cov
      return Matrices.mul(
          self.covariance,
          Matrices.transpose(obs_jac),
          gs.linalg.inv(innovation_cov),
      )
  
imports: import geomstats.backend
  from geomstats.geometry.euclidean import Euclidean
  from geomstats.geometry.matrices import Matrices
  from geomstats.geometry.special_euclidean import SpecialEuclidean
label_desc: Use image node_id 4 for calling the KalmanFilter obj's underlying member method code with example usage: obj.compute_gain(observation) and returns: Matrices