## Name

plq_ncpa — Piecewise linear quadratic (plq), nonconvex proximal average

## Calling Sequence

    pa = plq_ncpa(p0, p1, lambda, r)

## Parameters

p0, p1

  matrices. PLQ functions.

lambda

  constant in [0,1]. lambda1 = 1 - lambda. lambda2 = lambda.

r

  positive constant. Parameter to the Moreau envelope.

## Description

Computes the nonconvex proximal average of two (potentially nonconvex) PLQ functions p0 and p1, via the formula

        PA[r,lambda1,lambda2](p0, p1) = -M[1/(r+lambda1*lambda2)] ( -lambda1 M[1/r](f) - lambda2 M[1/r](g) ),

where M[k] is the Moreau envelope with smoothing parameter k.

This algorithm runs in O(n + m) time, where n and m are the number of pieces in p0 and p1, respectively.

## Examples

    p0 = [0,0,0.5,-1; %inf,0,-0.5,-1];
    p1 = [%inf,0.25,0,0];
    pa = plq_ncpa(p0,p1,0.5,1),
    scf(); plq_plotMultiple(-5, 5, p0, p1, pa);
    legend(["p0", "p1", "pa"]);

## See Also

plq_function

## Authors

`Bryan Gardiner`, University of British Columbia, BC, Canada

## Bibliography

- W. L. Hare. The Proximal Average of Nonconvex Functions: A Proximal Point Perspective. SIAM Journal on Optimization, 20(2), pp.650-666, 2009.