decay {dyntaper} | R Documentation |
Calculates (1 - p*x)_+^{1/p}
, or its limit exp(-x)
when p
tends to 0.
decay(x, p)
x |
Input value(s), possibly a vector. |
p |
Parameter. |
Perhaps overkill, but uses log1p()
function for better
accuracy than the more obvious formula.
Decay function value(s).
decay(2, 0) == exp(-2)
decay(1.5, 0.5)
decay(2.5, 0.5)
decay(2.5, -0.5)
for(p in seq(1, -1, -0.5)) curve(decay(x, p), 0, 3, add=(p != 1))