Description Usage Arguments Details Value Author(s)
View source: R/steepestDescent.R
Evaluate steepest descent on a quadratic function, assuming a positive-definite symmetric matrix.
Evaluate steepest descent on a quadratic function, assuming a positive-definite symmetric matrix.
1 2 3 | steepest_descent(x_0, A, d, c, verbose = FALSE, alpha = 0.01, tol = 1e-06)
steepest_descent(x_0, A, d, c, verbose = FALSE, alpha = 0.01, tol = 1e-06)
|
x_0 |
Initial values for the parameters to be optimized over. |
A |
A symmetric numeric matrix. |
d |
A numeric vector of the same size as |
c |
A numeric real number. |
verbose |
A logical indicating of the estimated location returned from
steepest descent should be reported to the Console for each iteration.
Default is |
alpha |
A numeric step size. |
tol |
A tolerance to which the algorithm should calculate and surpass. |
fn |
A function to be minimized (or maximized), with first argument the vector of parameters over which minimization is to take place. It should return a scalar result. Currently unused. |
The arguments A, d, and c together form the
quadratic function F(\mathbf{x}) =
\frac{1}{2}\mathbf{x}^T\mathbf{A}\mathbf{x} + \mathbf{d}^T\mathbf{x} + c,
where \mathbf{A} is of size 2\times 2, \mathbf{x} and
\mathbf{d} are of size 2 \times 1, and c \in \mathbb{R}.
The steepest descent algorithm calculates, for each iteration k,
values \mathbf{x}_{k+1} = \mathbf{x}_k + α_k \mathbf{g}_k, where
α_k > 0 is the learning rate, and \mathbf{g}_k is the
gradient of the provided quadratic function F(\mathbf{x}).
Typically, α_k is a small positive number. The steepest descent
algorithm continues iterating until the distance between
\mathbf{x}_{k+1} - \mathbf{x}_k, calculated here via the
2-norm, is less than the tolerance tol.
The arguments A, d, and c together form the
quadratic function F(\mathbf{x}) =
\frac{1}{2}\mathbf{x}^T\mathbf{A}\mathbf{x} + \mathbf{d}^T\mathbf{x} + c,
where \mathbf{A} is of size 2\times 2, \mathbf{x} and
\mathbf{d} are of size 2 \times 1, and c \in \mathbb{R}.
The steepest descent algorithm calculates, for each iteration k,
values \mathbf{x}_{k+1} = \mathbf{x}_k + α_k \mathbf{g}_k, where
α_k > 0 is the learning rate, and \mathbf{g}_k is the
gradient of the provided quadratic function F(\mathbf{x}).
Typically, α_k is a small positive number. The steepest descent
algorithm continues iterating until the distance between
\mathbf{x}_{k+1} - \mathbf{x}_k, calculated here via the
2-norm, is less than the tolerance tol.
A list with two elements. The first, numeric vector xStar,
with the steepest-descent-found minimum of the provided quadratic function.
The second, tibble conv, containing the sequential steps evaluated
via steepest descent to find xStar.
A list with two elements. The first, numeric vector xStar,
with the steepest-descent-found minimum of the provided quadratic function.
The second, tibble conv, containing the sequential steps evaluated
via steepest descent to find xStar.
Jason Mitchell
Jason Mitchell
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.