## PolyFit: A C++ code for polynomial curve fit with calculation of error bars

Ianik Plante05/28/2021

## Abstract

In radiobiology, many dose-response results are modeled using the so-called linear-quadratic (LQ) model, which means that results are modeled as a function of dose D as R(D)=ß_{0}+ß_{1}D+ß_{2}D^{2}. The coefficients ß_{0}, ß_{1} and ß_{2} are obtained from fitting a series of data points (x_{i},y_{i}), which is usually done using a least-square method. The LQ and more generally the polynomial fit capability is implemented in many software that analyzes data. However, there are some instances where the fitting needs to be done programmatically. Furthermore, depending on the software used, some features may not be implemented. In this mini-review, I discuss the basis of polynomial fitting, including the calculation of errors on the coefficients and results, use of weighting and fixing the intercept value (the coefficient ß_{0}). A simple C++ code to perform the polynomial curve fitting is also provided. This code should be useful not only in radiobiology but in other fields of science as well.