Software — free catalog
PolyFit: A C++ Code for Polynomial Curve Fit with Calculation of Error Bars
A NASA software catalog entry available for reuse or request.
About this technology
Overview
This C++ code calculates the coefficients of a polynomial of a degree k that is the best fit for a series of n points (xi,yi) using the least-squares method. The code offers two options: (1) to fix, or not, the intercept (the first coefficient) to a given value; and, (2) to use weights on points proportional to their errors, or inversely proportional to the square of the errors. PolyFit calculates the error and confidence intervals of the coefficients, the total and residual sum of squares, the coefficient R2, and the covariance and correlation matrices. It also reports the results of an ANOVA test for the fit, and writes the prediction and confidence bands into a file. The source code is provided as a single file using basic C++, so that it can be re-used easily.
Release notes
Software can be requested at the gitHub link