Learn R Programming

retistruct (version 0.6.3)

f: Piecewise smooth function used in area penalty

Description

Piecewise, smooth function that increases linearly with negative arguments. $$ f(x) = \left\{ \begin{array}{ll} -(x - x_0/2) & x < 0 \\ \frac{1}{2x_0}(x - x_0)^2 & 0 < x <x_0 \\ 0 & x \ge x_0 \end{array} \right. $$

Usage

f(x, x0)

Arguments

x

Main argument

x0

The cut-off parameter. Above this value the function is zero.

Value

The value of the function.