Fits a quadratic curve that passes all three points on the two-dimensional Euclidean space \(R^2\).
If the design matrix \(X\) of the quadratic fit has a condition number which is greater than \(10^8\), a linear regression line is fitted to the three points instead.
Usage
quadratic.fit(x, y)
Arguments
x
A vector of length three, which represents the \(x\)-values of the three points.
y
A vector of length three, which represents the \(y\)-values of the three points.
Value
quadratic.fit returns a vector of length three. The first, second, and third elements of the returned vector are the second degree, first degree, and zero-th degree coefficients, respectively, of the fitted quadratic curve, or of the fitted linear regression line.