Skip to content
Snippets Groups Projects
Commit 8ef9b9b0 authored by Askarpour, Zahra's avatar Askarpour, Zahra
Browse files

fitting is working now

parent 84b04f68
No related branches found
No related tags found
No related merge requests found
Pipeline #2061 passed
...@@ -65,8 +65,8 @@ class DiffFitting(AbstractFitting): ...@@ -65,8 +65,8 @@ class DiffFitting(AbstractFitting):
raise ValueError("DiffFit does not work for one vector") raise ValueError("DiffFit does not work for one vector")
target=target-vectors[-1] target=target-vectors[-1]
VECTORS=[] VECTORS=[]
for i in range(0, len(vectors)+1): for i in range(1, len(vectors)):
VECTORS.append(vectors[i]-vectors[-1]) VECTORS.append(vectors[i-1]-vectors[-1])
matrix = np.array(VECTORS).T matrix = np.array(VECTORS).T
a = matrix.T @ matrix a = matrix.T @ matrix
b = matrix.T @ target b = matrix.T @ target
...@@ -84,8 +84,8 @@ class DiffFitting(AbstractFitting): ...@@ -84,8 +84,8 @@ class DiffFitting(AbstractFitting):
raise ValueError("DiffFit does not work for one vector") raise ValueError("DiffFit does not work for one vector")
result = np.zeros(vectors[0].shape, dtype=np.float64) result = np.zeros(vectors[0].shape, dtype=np.float64)
VECTORS_DiffFitting=[] VECTORS_DiffFitting=[]
for i in range(0,len(vectors)+1): for i in range(1,len(vectors)):
VECTORS_DiffFitting.append(vectors[i]-vectors[-1]) VECTORS_DiffFitting.append(vectors[i-1]-vectors[-1])
for coeff, vector in zip(coefficients, VECTORS_DiffFitting): for coeff, vector in zip(coefficients, VECTORS_DiffFitting):
result += vector*coeff result += vector*coeff
result=result+vectors[-1] result=result+vectors[-1]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment