Ramp function

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Template:Short description Template:Refimprove

File:Ramp function.svg
Graph of the ramp function

The ramp function is a unary real function, whose graph is shaped like a ramp. It can be expressed by numerous definitions, for example "0 for negative inputs, output equals input for non-negative inputs". The term "ramp" can also be used for other functions obtained by scaling and shifting, and the function in this article is the unit ramp function (slope 1, starting at 0).

In mathematics, the ramp function is also known as the positive part.

In machine learning, it is commonly known as a ReLU activation function[1][2] or a rectifier in analogy to half-wave rectification in electrical engineering. In statistics (when used as a likelihood function) it is known as a tobit model.

This function has numerous applications in mathematics and engineering, and goes by various names, depending on the context. There are differentiable variants of the ramp function.

Definitions

The ramp function (R(x) : RR0+Script error: No such module "Check for unknown parameters".) may be defined analytically in several ways. Possible definitions are:

  • A piecewise function: R(x):={x,x0;0,x<0
  • Using the Iverson bracket notation: R(x):=x[x0] or R(x):=x[x>0]
  • The max function: R(x):=max(x,0)
  • The mean of an independent variable and its absolute value (a straight line with unity gradient and its modulus): R(x):=x+|x|2 this can be derived by noting the following definition of max(a, b)Script error: No such module "Check for unknown parameters"., max(a,b)=a+b+|ab|2 for which a = xScript error: No such module "Check for unknown parameters". and b = 0Script error: No such module "Check for unknown parameters".
  • The Heaviside step function multiplied by a straight line with unity gradient: R(x):=xH(x)
  • The convolution of the Heaviside step function with itself: R(x):=H(x)*H(x)
  • The integral of the Heaviside step function:[3] R(x):=xH(ξ)dξ
  • Macaulay brackets: R(x):=x
  • The positive part of the identity function: R:=id+
  • As a limit function: R(x):=lima{1a,x=0x1eax,x0

It could approximated as close as desired by choosing an increasing positive value a>0.

Applications

The ramp function has numerous applications in engineering, such as in the theory of digital signal processing.

File:Long call option.svg
Payoff and profits from buying a call option.

In finance, the payoff of a call option is a ramp (shifted by strike price). Horizontally flipping a ramp yields a put option, while vertically flipping (taking the negative) corresponds to selling or being "short" an option. In finance, the shape is widely called a "hockey stick", due to the shape being similar to an ice hockey stick.

File:Friedmans mars hinge functions.png
A mirrored pair of hinge functions with a knot at x=3.1

In statistics, hinge functions of multivariate adaptive regression splines (MARS) are ramps, and are used to build regression models.

Analytic properties

Non-negativity

In the whole domain the function is non-negative, so its absolute value is itself, i.e. x:R(x)0 and |R(x)|=R(x) Template:Math proof

Derivative

Its derivative is the Heaviside step function: R(x)=H(x)for x0.

Second derivative

The ramp function satisfies the differential equation: d2dx2R(xx0)=δ(xx0), where δ(x)Script error: No such module "Check for unknown parameters". is the Dirac delta. This means that R(x)Script error: No such module "Check for unknown parameters". is a Green's function for the second derivative operator. Thus, any function, f(x)Script error: No such module "Check for unknown parameters"., with an integrable second derivative, f″(x)Script error: No such module "Check for unknown parameters"., will satisfy the equation: f(x)=f(a)+(xa)f(a)+abR(xs)f(s)dsfor a<x<b.

Fourier transform

{R(x)}(f)=R(x)e2πifxdx=iδ(f)4π14π2f2, where δ(x)Script error: No such module "Check for unknown parameters". is the Dirac delta (in this formula, its derivative appears).

Laplace transform

The single-sided Laplace transform of R(x)Script error: No such module "Check for unknown parameters". is given as follows,[4] {R(x)}(s)=0esxR(x)dx=1s2.

Algebraic properties

Iteration invariance

Every iterated function of the ramp mapping is itself, as R(R(x))=R(x). Template:Math proof

See also

References

<templatestyles src="Reflist/styles.css" />

  1. Script error: No such module "citation/CS1".
  2. Script error: No such module "citation/CS1".
  3. Script error: No such module "Template wrapper".
  4. Script error: No such module "citation/CS1".

Script error: No such module "Check for unknown parameters".