From 6583fd042fd8c391d5edabfc98832faa26e880a5 Mon Sep 17 00:00:00 2001 From: Benjamin Johnson Date: Mon, 11 Dec 2023 13:54:24 -0500 Subject: [PATCH] fix PolySpec regularization dimension mismatch (#296) --- prospect/models/sedmodel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prospect/models/sedmodel.py b/prospect/models/sedmodel.py index 64f1cb38..c41649c9 100644 --- a/prospect/models/sedmodel.py +++ b/prospect/models/sedmodel.py @@ -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)