Given a set of covariance matrices pcov
of shape (n,m,m) and a set of parameter estimates popt
of shape (n,m), the mean parameter estimates are:
weight = np.linalg.inv(pcov)
pcov_mean = np.linalg.inv(np.sum(weight, axis=0))
popt_wgt = np.einsum('ijk,ik->ij', weight, popt)
popt_mean = np.dot(pcov_mean, np.sum(popt_wgt, axis=0))