code: def _map_update(
              self,
              prior_mean,
              prior_cov,
              global_cov_scaled,
              new_observation):
          
          common = np.linalg.inv(prior_cov + global_cov_scaled)
          observation_mean = np.mean(new_observation, axis=1)
          posterior_mean = prior_cov.dot(common.dot(observation_mean)) +\
              global_cov_scaled.dot(common.dot(prior_mean))
          posterior_cov =\
              prior_cov.dot(common.dot(global_cov_scaled))
          return posterior_mean, posterior_cov
docs: Maximum A Posterior (MAP) update of a parameter
  
          Parameters
          ----------
  
          prior_mean : float or 1D array
              Prior mean of parameters.
  
          prior_cov : float or 1D array
              Prior variance of scalar parameter, or
              prior covariance of multivariate parameter
  
          global_cov_scaled : float or 1D array
              Global prior variance of scalar parameter, or
              global prior covariance of multivariate parameter
  
          new_observation : 1D or 2D array, with shape [n_dim, n_subj]
              New observations on parameters.
  
          Returns
          -------
  
          posterior_mean : float or 1D array
              Posterior mean of parameters.
  
          posterior_cov : float or 1D array
              Posterior variance of scalar parameter, or
              posterior covariance of multivariate parameter