Jump to content

Ramp function

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Nbarth (talk | contribs) at 03:25, 21 July 2017 (Applications: fill in examples). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
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".

This function has numerous applications in mathematics and engineering, and goes by various names, depending on the context.

Definitions

The ramp function (R(x) : ℝ → ℝ) may be defined analytically in several ways. Possible definitions are:

  • A system of equations:
  • The max function:
  • The mean of an independent variable and its absolute value (a straight line with unity gradient and its modulus):
this can be derived by noting the following definition of max(a,b),
for which a = x and b = 0
  • The Heaviside step function multiplied by a straight line with unity gradient:
  • The convolution of the Heaviside step function with itself:
  • The integral of the Heaviside step function:[1]
  • Macaulay brackets:

Applications

The ramp function has numerous applications in engineering, e.g., in the theory of DSP.

Half-wave rectifier

In electrical engineering, half-wave rectification – converting alternating current to direct current by passing positive voltages and blocking negative voltages – corresponds to the ramp function.

Plot of the rectifier (blue) and softplus (green) functions near x = 0

In artificial neural networks, when the ramp function is used as an activation function, it is known as a rectifier, by analogy with the electrical rectifier.

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 the shape being similar to an ice hockey stick.

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.

and

  • Proof: by the mean of definition 2, it is non-negative in the first quarter, and zero in the second; so everywhere it is non-negative.

Derivative

Its derivative is the Heaviside function:

Second derivative

The ramp function satisfies the differential equation:

where δ(x) is the Dirac delta. This means that R(x) is a Green's function for the second derivative operator. Thus, any function, f(x), with an integrable second derivative, f″(x), will satisfy the equation:

where δ(x) is the Dirac delta (in this formula, its derivative appears).

The single-sided Laplace transform of R(x) is given as follows,

Algebraic properties

Iteration invariance

Every iterated function of the ramp mapping is itself, as

  • Proof:

This applies the non-negative property.

References

  1. ^ Weisstein, Eric W. "Ramp Function". MathWorld.