Compute a linear fit for the given data, return
the slope and the constant term.
dgels
from LAPACK solves the linear least squares problem.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in), | dimension(:) | :: | x | Values to be fitted. |
|
real(kind=dp), | intent(in), | dimension(:) | :: | y | Values to be fitted. |
|
real(kind=dp), | intent(inout) | :: | slope | \(a\) in \(y=ax+b\). |
||
real(kind=dp), | intent(inout) | :: | const | \(b\) in \(y=ax+b\). |