Find a single root of a function of one variable from an initial guess by Newton's method in one dimension.

Share:

Description

Find a single root of a function of one variable within a specified interval.

Usage

1
    newt1d(fn, gr, x0, offset = 1000.0, maxiter = 100, trace=FALSE,...)

Arguments

fn

A real function of a single variable.

gr

A function that computes the gradient of fn.

x0

An initial guess for the value of the root of fn.

offset

An inverse tolerance for the root. When a new estimate of the root xnew is such that (xnew + offset) is equal to (xold+offset), newt1d will terminate.

maxiter

A limit on the number of function evaluations permitted in the attempt to find a root.

trace

If TRUE, provided diagnostic output of the process of rootfinding.

...

Extra data needed to compute the function f.

Details

To be added.

Value

The output is a list consisting of return(list(root=b, froot=NA, rtol=wtol, maxit=maxit)) ## Acceptable approx. is found */

root

The estimate, b, of the position of the root.

froot

The value of the function at this point, f(b).

rtol

The width of the interval in which the root exists.

fcount

The number of function evaluations used.

See Also

optimize

Examples

1
  # examples are in rootoned-package.Rd