-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Summary
The current implementation of PolynomialSurface::fit() uses normal equations to solve the least squares problem:
Eigen::VectorXd coeffs = (A.transpose() * A).ldlt().solve(A.transpose() * b);While this works for well-conditioned data, it can be numerically unstable for poorly distributed or nearly collinear input points.
Suggested Fix
Replace the normal equations with QR decomposition for better numerical stability:
Eigen::VectorXd coeffs = A.colPivHouseholderQr().solve(b);This change improves robustness without significantly impacting performance.
Impact
-
More accurate results for edge cases
-
Better behavior with noisy or ill-conditioned data
-
This should not require major API changes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed