Skip to content

Commit

Permalink
Merge e6305d5 into 2ce755a
Browse files Browse the repository at this point in the history
  • Loading branch information
abukaj committed Mar 28, 2019
2 parents 2ce755a + e6305d5 commit 798cd8f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions kcsd/KCSD.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,14 @@ def values(self, estimate='CSD'):
estimation_table = self.k_interp_pot
else:
print('Invalid quantity to be measured, pass either CSD or POT')
k_inv = np.linalg.inv(self.k_pot + self.lambd *
np.identity(self.k_pot.shape[0]))
kernel = self.k_pot + self.lambd * np.identity(self.k_pot.shape[0])
estimation = np.zeros((self.n_estm, self.n_time))
for t in range(self.n_time):
beta = np.dot(k_inv, self.pots[:, t])
for i in range(self.n_ele):
estimation[:, t] += estimation_table[:, i]*beta[i] # C*(x) Eq 18
# C*(x) [Potworowski 2018 Eq 2.18]
# `inv(K) V` calculated by solving `K X = V` for `X`
estimation[:, t] = np.dot(estimation_table,
np.linalg.solve(kernel,
self.pots[:, t]))
return self.process_estimate(estimation)

def process_estimate(self, estimation):
Expand Down

0 comments on commit 798cd8f

Please sign in to comment.