Description Usage Arguments Value Author(s) See Also Examples
View source: R/quadratic.fit.R
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.
1 | quadratic.fit(x, y)
|
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. |
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.
Qiansheng Zhu
1 2 | # Three points: (0, 1), (1, 0), (3, 4).
quadratic.fit(c(0, 1, 3), c(1, 0, 4))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.