Skip to contents

Values at or above eps are unchanged. Smaller values are replaced by a strictly positive continuation and receive a non-negative quadratic penalty. See https://github.com/kaskr/adcomp/issues/7.

Usage

posfun(x, eps = 0.001)

Arguments

x

A numeric or RTMB automatic-differentiation vector to constrain.

eps

A finite positive scalar defining the continuation threshold.

Value

A list with new, the continued values, and pen, the element-wise feasibility penalties. The penalty is exactly zero where x >= eps.