The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
The Root Finding & Minimization Algorithms section of the Boost Math library provides methods for finding minima and roots of functions. These methods can be used directly in R without needing any additional compilation.
# Example of finding a root using bisection method
f <- function(x) x^2 - 2
bisect(f, lower = 0, upper = 2)
#> $lower
#> [1] 1.414214
#>
#> $upper
#> [1] 1.414214
#>
#> $iterations
#> [1] 54
# Example of finding a root using bracket and solve method
f <- function(x) x^2 - 2
bracket_and_solve_root(f, guess = 1, factor = 0.1, rising = TRUE)
#> $lower
#> [1] 1.414214
#>
#> $upper
#> [1] 1.414214
#>
#> $iterations
#> [1] 91
# Example of finding a root using TOMS 748 algorithm
f <- function(x) x^2 - 2
toms748_solve(f, lower = 0, upper = 2)
#> $lower
#> [1] 1.414214
#>
#> $upper
#> [1] 1.414214
#>
#> $iterations
#> [1] 9
# Example of finding a root using Newton-Raphson method
f <- function(x) c(x^2 - 2, 2 * x)
newton_raphson_iterate(f, guess = 1, lower = 0, upper = 2)
#> [1] 1.414214
#> attr(,"iterations")
#> [1] 6
# Example of finding a root using Halley's method
f <- function(x) c(x^2 - 2, 2 * x, 2)
halley_iterate(f, guess = 1, lower = 0, upper = 2)
#> [1] 1.414214
#> attr(,"iterations")
#> [1] 4
# Example of finding a root using Schroder's method
f <- function(x) c(x^2 - 2, 2 * x, 2)
schroder_iterate(f, guess = 1, lower = 0, upper = 2)
#> [1] 1.414214
#> attr(,"iterations")
#> [1] 5
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.