saferoot: Improved One Dimensional Root (Zero) Finding

Description Usage Arguments Author(s)

View source: R/utilities.R

Description

a "safe" version of uniroot() searches for a root (that is, zero) of the function f with respect to its first argument. "safe" means searching for the correct interval = c(lower,upper) if sign(f(x)) does not satisfy the requirements at the interval end points This function was adapted from the copula package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
saferoot(
  f,
  interval,
  ...,
  lower = min(interval),
  upper = max(interval),
  f.lower = f(lower, ...),
  f.upper = f(upper, ...),
  Sig = NULL,
  check.conv = FALSE,
  tol = 0.001,
  maxiter = 2500,
  trace = 0
)

Arguments

f

the function for which the root is sought.

interval

a vector containing the end-points of the interval to be searched for the root.

...

additional named or unnamed arguments to be passed to f

lower

the lower end point of the interval to be searched

upper

the upper end point of the interval to be searched

f.lower

the same as f(lower)

f.upper

the same as f(upper)

Sig

desired sign of f(upper), or NULL

check.conv

logical indicating whether a convergence warning of the underlying uniroot should be caught as an error and if non-convergence in maxiter iterations should be an error instead of a warning.

tol

the desired accuracy (convergence tolerance). defaults to 1e-3.

maxiter

the maximum number of iterations. defaults to 2500.

trace

integer number; if positive, tracing information is produced. Higher values giving more details.

Author(s)

Martin Maechler


abnormally-distributed/cvreg documentation built on May 3, 2020, 3:45 p.m.