# NOT RUN {
# Example 1: an exponential model
f <- function(x) exp(-x)
maxcurv(x.range = c(-2, 5), fun = f)
# Example 2: 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)
# using "pd" method
maxcurv(x.range = c(-5, 20), fun = g, method = "pd")
# using "LRP" method
maxcurv(x.range = c(-5, 20), fun = g, method = "LRP", x0ini = 6.5)
# Example 3: 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)
# using "spline" method
maxcurv(x.range = c(1, 50), fun = cv, method = "spline", x0ini = 6)
# End (not run)
# }
Run the code above in your browser using DataLab