abs_smooth: Smooth approximation to the absolute value function

View source: R/aaa_utils.R

abs_smoothR Documentation

Smooth approximation to the absolute value function

Description

Smooth approximation to the absolute value function

Usage

abs_smooth(x, epsilon = 1e-06)

Arguments

x

vector of evaluation points

epsilon

smoothing constant

Details

We approximate the absolute value here as

\vert x \vert \approx \sqrt{x^2 + \epsilon}

Value

Smooth absolute value of x.

Examples

abs(0)
abs_smooth(0, 1e-4)

RTMBdist documentation built on April 1, 2026, 5:07 p.m.