Created
March 16, 2016 21:18
-
-
Save davidchall/f58781741e74006c63e9 to your computer and use it in GitHub Desktop.
Revisions
-
davidchall created this gist
Mar 16, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ 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))