docs: def correlation(P, obs1, obs2=None, times=[1], k=None):
      r"""Time-correlation for equilibrium experiment.
  
      Parameters
      ----------
      P : (M, M) ndarray
          Transition matrix
      obs1 : (M,) ndarray
          Observable, represented as vector on state space
      obs2 : (M,) ndarray (optional)
          Second observable, for cross-correlations
      times : list of int (optional)
          List of times (in tau) at which to compute correlation
      k : int (optional)
          Number of eigenvectors and eigenvalues to use for computation
  
      Returns
      -------
      correlations : ndarray
          Correlation values at given times
  
      """
      M = P.shape[0]
      T = np.asarray(times).max()
      if T < M:
          return correlation_matvec(P, obs1, obs2=obs2, times=times)
      else:
          return correlation_decomp(P, obs1, obs2=obs2, times=times, k=k)