code: def estimation(kalman, initial_state, inputs, observations, obs_freq):
      """Carry out the state estimation for a specific system.
  
      Parameters
      ----------
      kalman : KalmanFilter
          Filter used to estimate the state.
      initial_state : array-like, shape=[dim]
          Guess of the true initial state.
      inputs : list(array-like, shape=[dim_input])
          Inputs received by the propagation sensor.
      observations : array-like, shape=[len(inputs) + 1/obs_freq, dim_obs]
          Measurements of the system.
      obs_freq : int
          Number of time steps between observations.
  
      Returns
      -------
      traj : array-like, shape=[len(inputs) + 1, dim]
          Estimated trajectory.
      three_sigmas : array-like, shape=[len(inputs) + 1, dim]
          3-sigma envelope of the estimated state covariance.
      """
      kalman.state = 1 * initial_state
  
      traj = [1 * kalman.state]
      uncertainty = [1 * gs.diagonal(kalman.covariance)]
      for i, _ in enumerate(inputs):
          kalman.propagate(inputs[i])
          if i > 0 and i % obs_freq == obs_freq - 1:
              kalman.update(observations[(i // obs_freq)])
          traj.append(1 * kalman.state)
          uncertainty.append(1 * gs.diagonal(kalman.covariance))
      traj = gs.array(traj)
      uncertainty = gs.array(uncertainty)
      three_sigmas = 3 * gs.sqrt(uncertainty)
  
      return traj, three_sigmas
  
imports: import matplotlib.pyplot
  import numpy
  import geomstats.backend
  from geomstats import algebra_utils
  from geomstats.learning.kalman_filter import KalmanFilter, Localization, LocalizationLinear
label_desc: Use image node_id 2 for calling a global function with example usage: estimation(kalman, initial_state, inputs, observations, obs_freq) and returns: traj,  three_sigmas