def computeMisfit2(self,q):
assert self.r0 is not None, "Must have current estimate of polarizations"
assert self.dunc is not None, "Must have set uncertainties"
assert self.dobs is not None, "Must have observed data"
dunc = mkvc(self.dunc)
dobs = mkvc(self.dobs)
r0 = self.r0
Hp = self.computeHp(r0=r0,update=False)
Brx = self.computeBrx(r0=r0,update=False)
P = self.computeP(Hp,Brx)
N = np.size(dobs)
M = len(self.times)
Px = np.kron(np.diag(np.ones(M)),P)
dpre = np.dot(Px,q)
v = (dpre-dobs)/dunc
Phi = np.dot(v.T,v)
return Phi/N
评论列表
文章目录