Learn R Programming

spuRs (version 2.0.2)

newtonraphson_show: A function of the Newton-Raphson algorithm, plotting the path.

Description

Applies the Newton-Raphson algorithm to find x such that ftn(x)[1] == 0, and plots the trace of the estimate.

Usage

newtonraphson_show(ftn, x0, xmin = x0 - 1, xmax = x0 + 1)

Arguments

ftn

the function.

x0

the initial guess of the fixed point.

xmin

lower limit for plotting.

xmax

upper limit for plotting.

Value

Returns the value of x at which ftn(x)[1] == 0. If the function fails to converge within max.iter iterations, returns NULL.

References

Jones, O.D., R. Maillardet, and A.P. Robinson. 2009. An Introduction to Scientific Programming and Simulation, Using R. Chapman And Hall/CRC.

See Also

newtonraphson