nuniroot: Sove An Single Equation

Description Usage Arguments Value Examples

View source: R/webpower.R

Description

The function searches in an interval for a root (i.e., zero) of the function f with respect to its first argument. The argument interval is for the input of x, the corresponding outcome interval will be used as the interval to be searched in.

Usage

1
nuniroot(f, interval, maxlength = 100)

Arguments

f

Function for which the root is sought.

interval

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

maxlength

The number of vaulue points in the interval to be searched. It is 100 by default.

Value

A list with at least four components: root and f.root give the location of the root and the value of the function evaluated at that point. iter and estim.prec give the number of iterations used and an approximate estimated precision for root. (If the root occurs at one of the endpoints, the estimated precision is NA.)

Examples

1
2
3
f <- function(x) 1+x-0.5*x^2
interval <- c(-3,-2,1,2,6)
nuniroot(f,interval)

WebPower documentation built on May 1, 2019, 8:19 p.m.