Description Usage Arguments Details Value References See Also Examples
Applies the bisection algorithm to find x such that ftn(x) == x.
1 | bisection(ftn, x.l, x.r, tol = 1e-09)
|
ftn |
the function. |
x.l |
is the lower starting point. |
x.r |
is the upper starting point. |
tol |
distance of successive iterations at which algorithm terminates. |
We assume that ftn is a function of a single variable.
Returns the value of x at which ftn(x) == x. If the function fails to converge within max.iter iterations, returns NULL.
Jones, O.D., R. Maillardet, and A.P. Robinson. 2009. An Introduction to Scientific Programming and Simulation, Using R. Chapman And Hall/CRC.
1 2 |
Loading required package: MASS
Loading required package: lattice
at iteration 1 the root lies between 1 and 1.5
at iteration 2 the root lies between 1.25 and 1.5
at iteration 3 the root lies between 1.25 and 1.375
at iteration 4 the root lies between 1.25 and 1.3125
at iteration 5 the root lies between 1.28125 and 1.3125
at iteration 6 the root lies between 1.296875 and 1.3125
at iteration 7 the root lies between 1.304688 and 1.3125
at iteration 8 the root lies between 1.308594 and 1.3125
at iteration 9 the root lies between 1.308594 and 1.310547
at iteration 10 the root lies between 1.30957 and 1.310547
at iteration 11 the root lies between 1.30957 and 1.310059
at iteration 12 the root lies between 1.30957 and 1.309814
at iteration 13 the root lies between 1.309692 and 1.309814
at iteration 14 the root lies between 1.309753 and 1.309814
at iteration 15 the root lies between 1.309784 and 1.309814
at iteration 16 the root lies between 1.309799 and 1.309814
at iteration 17 the root lies between 1.309799 and 1.309807
at iteration 18 the root lies between 1.309799 and 1.309803
at iteration 19 the root lies between 1.309799 and 1.309801
at iteration 20 the root lies between 1.309799 and 1.3098
[1] 1.3098
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.