Learn R Programming

dMod (version 0.1)

constraintExp2: Compute a differentiable box prior

Description

Compute a differentiable box prior

Usage

constraintExp2(p, mu, sigma = 1, k = 0.05, fixed = NULL)

Arguments

p
Named numeric, the parameter value
mu
Named numeric, the prior values, means of boxes
sigma
Named numeric, half box width
k
Named numeric, shape of box; if 0 a quadratic prior is obtained, the higher k the more box shape, gradient at border of the box (-sigma, sigma) is equal to sigma*k
fixed
Named numeric with fixed parameter values (contribute to the prior value but not to gradient and Hessian)

Value

  • list with entries: value (numeric, the weighted residual sum of squares), gradient (numeric, gradient) and hessian (matrix of type numeric).