Skip to content
DeepForgeby svx
All problems
MediumOptimizationop-329

Proximal Operator of Quadratic

Problem

The proximal operator of t * 0.5 * a * (x - c)^2 is (v + t a c) / (1 + t a).

Given v, c, the step t, and the curvature a > 0, return the prox value.

Hint

Solve the scalar problem min_x 0.5 (x - v)^2 + t * 0.5 * a (x - c)^2.

Test cases

case 1
in: [1,0,0.5,2]
expected: 0.5
case 2
in: [3,1,1,1]
expected: 2
case 3
in: [0,5,2,0.5]
expected: 2.5
Starter codePython
def proximal_operator_quadratic(v, c, t, a):
    # Your code here
    pass

3 test cases · run your code against them in the editor