Skip to contents

Solved as a linear system rather than by forming the inverse. Reports whether the Hessian was positive definite, since away from a minimum the Newton direction need not be a descent direction.

Usage

morie_boyd_newton(grad, hess, ridge = 0)

Arguments

grad

Gradient, length n.

hess

Hessian, n-by-n and symmetric.

ridge

Optional shift added to the diagonal.

Value

List with step, decrement, is_descent, pd.

References

Boyd, S., & Vandenberghe, L. (2004). Convex Optimization. Cambridge University Press, Sec 9.5.

Examples

A <- matrix(c(4, 1, 1, 3), 2)
x <- c(5, -2)
round(x + morie_boyd_newton(A %*% x, A)$step, 12)
#> [1] 0 0