Description Usage Arguments Value Examples
Gradient descent method to find the coefficients of linear regression equation
1 2 3 4 5 6 7 8 9 10 11 12 | gradient.descent(
x,
y,
epsilon = 1e-14,
maxit = 1000,
stepsize = 0.001,
alpha = 0.25,
b = 0.8,
stepmethod = "backtracking",
verbose = TRUE,
plotLoss = TRUE
)
|
x |
a m*n data matrix |
y |
observations size of m*1 |
epsilon |
termination condition, difference between the coefs of two consecutive iters |
maxit |
the maximum number of iterations, default is 1000 |
stepsize |
just stepsize, must smaller than 1e-3, default is 1e-3 |
alpha |
parameter in the backtracking method, should in (0,0.5), default is 0.25 |
b |
parameter in the backtracking method, should in (0,1), default is 0.8 |
stepmethod |
optional "backtracking" or "fixed", default is "backtracking" |
verbose |
whether to print out iterations, default is "TRUE" |
plotLoss |
whether to plot loss, default is "TRUE" |
a list contains coefficients,RSE and number of iterations
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.