The following function returns the coefficients of the fit f = a bx. The parameter t is the quality of the fit t = chi**2/d.o.f (d.o.f = np - 2).
linear_regression()
$a = Spectra::linear_regression( "test", "a");
$b = Spectra::linear_regression( "test", "b");
$t = Spectra::linear_regression( "test", "t");
The following function returns the coefficients of the fit f = a + bx + cx**2. The parameter t is the quality of the fit t = chi**2/d.o.f (d.o.f = np - 2).
parabolic_regression()
$a = Spectra::parabolic_regression( "test", "a");
$b = Spectra::parabolic_regression( "test", "b");
$c = Spectra::parabolic_regression( "test", "c");
$t = Spectra::parabolic_regression( "test", "t");