One-dimensional proximal operator
Arguments
- f_prime
Function. Derivative of the function f.
- lambda
Numeric. Inverse penalty.
- x
Numeric. Input variable.
Value
A numeric value
$$\mathrm{prox}_{\lambda f}(x) = \mathrm{argmin}_x f(z) + \frac{1}{2\lambda}(z-x)^2.$$
It solves the equation
$$f'(z) + \frac{1}{\lambda}(z-x) = 0.$$
Examples
f <- function(x) 1/(1+exp(-x))
prox_op(f, 1, 1)
#> [1] 0.4010287