Description Usage Arguments Details Value Examples
Fits a polynomial of specified degree to the data with a regularization term
1 | reg.lm(y, x, degree = 1, lambda = 1)
|
y |
Dependent variable |
x |
Independent variable(s) in array form |
degree |
Degree of polynomial to fit |
lambda |
Weight of regularization term (may be selected using crossval) |
Finds the polynomial of specified degree that minimizes
({y}-p({x}))^2+lambda*sum(coeff^2)
Where p
is the polynomial and coeff
is its coefficients.
This function is useful when concerns about overfitting are present. lambda
may be chosen by the crossval
function.
List with the coefficients for each term in the polynomial and the error.
1 | reg.lm((1:10)^3, 1:10, degree = 3, lambda = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.