Heaviside {fSeries} | R Documentation |
This is a collection of functions which compute the Haeviside and related functions.
The functions are:
1 | H | Computes Heaviside unit step function, |
2 | Sign | Just another signum function |
3 | Delta | Computes delta function, |
4 | Boxcar | Computes boxcar function, |
5 | Ramp | Computes ramp function. |
H(x, a = 0) Sign(x, a = 0) Delta(x, a = 0) Boxcar(x, a = 0.5) Ramp(x, a = 0)
a |
a numeric value, the location of the break. |
x |
a numeric vector. |
The Heaviside step function H
is 1 for x>a
,
1/2
for x=a
, and 0
for x<a
.
The Sign function Sign
is 1
for x>a
,
0
for x=a
, and -1
for x<a
.
The delta function Delta
is defined as:
Delta(x) = d/dx H(x-a)
.
The boxcar function boxcar
is defined as:
Boxcar(x) = H(x+a) - H(x-a)
.
The ramp function is defined as:
Ramp(x)= (x-a)*H(x-a)
.
returns the function values of the selected function.
Diethelm Wuertz for this R-port.
Weisstein W. (2004); http://mathworld.wolfram.com/HeavisideStepFunction.html. Mathworld.
## H - x = sort(round(c(-1, -0.5, 0, 0.5, 1, 5*rnorm(5)), 2)) h = H(x) ## Sign - s = Sign(x) ## Delta - d = Delta(x) ## Boxcar - Pi = Boxcar(x) ## ramp - r = Ramp(x) cbind(x = x, Step = h, Signum = s, Delta = d, Pi = Pi, R = r)