Learn R Programming

soilphysics (version 2.1)

maxcurv: Maximum Curvature Point

Description

Function to determine the maximum curvature point of an univariate nonlinear function of x.

Usage

maxcurv(x.range, fun, graph = TRUE, ...)

Arguments

x.range
a numeric vector of length two, the range of x.
fun
a function of x; it must be a one-line-written function, with no curly braces '{}'.
graph
logical; if TRUE (default) a curve of fun is plotted.
...
further graphical arguments.

Value

  • A list of
  • funthe function of x.
  • x0the x critical value.
  • y0the y critical value.

Warning

Numerical values into fun with three or more digits may cause miscalculation.

See Also

function, curve

Examples

Run this code
# an exponential model
f <- function(x) exp(-x)
maxcurv(x.range = c(-2, 5), fun = f)

# Gompertz Growth Model
Asym <- 8.5
b2 <- 2.3
b3 <- 0.6
g <- function(x) Asym * exp(-b2 * b3 ^ x)
maxcurv(x.range = c(-5, 20), fun = g)

# Lessman & Atkins (1963) model for optimum plot size
a = 40.1
b = 0.72
cv <- function(x) a * x^-b
maxcurv(x.range = c(1, 50), fun = cv)

# End (not run)

Run the code above in your browser using DataLab