Learn R Programming

LaMa (version 2.0.6)

minmax0_smooth: Smooth approximations to max(x, 0) and min(x, 0)

Description

Smooth approximations to max(x, 0) and min(x, 0)

Usage

max0_smooth(x, rho = 20)

min0_smooth(x, rho = 20)

Value

the approximate maximum or minimum of x and 0

Arguments

x

a vector of values

rho

smoothing parameter, larger values lead to closer approximation

Examples

Run this code
x <- seq(-1, 1, by = 0.1)
min0_smooth(x)
max0_smooth(x)

Run the code above in your browser using DataLab