Skip to content

Commit

Permalink
fix PolySpec regularization dimension mismatch (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
bd-j committed Dec 11, 2023
1 parent dd50479 commit 6583fd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prospect/models/sedmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ def spec_calibration(self, theta=None, obs=None, spec=None, **kwargs):
ATA = np.dot(A.T, A / yvar[:, None])
reg = self.params.get('poly_regularization', 0.)
if np.any(reg > 0):
ATA += reg**2 * np.eye(order)
ATA += reg**2 * np.eye(order+1)
ATAinv = np.linalg.inv(ATA)
c = np.dot(ATAinv, np.dot(A.T, y / yvar))
Afull = chebvander(x, order)
Expand Down

0 comments on commit 6583fd0

Please sign in to comment.