nlraa (version 1.9.7)

SSexpf: self start for an exponential function

Description

Self starter for a simple exponential function

Usage

expf(x, a, c)

SSexpf(x, a, c)

Value

a numeric vector of the same length as x containing parameter estimates for equation specified

expf: vector of the same length as x using the profd function

Arguments

x

input vector (x)

a

represents the value at x = 0

c

represents the exponential rate

Details

This is the exponential function $$y = a * exp(c * x)$$

For more details see: Archontoulis and Miguez (2015) - (doi:10.2134/agronj2012.0506).

Examples

Run this code
# \donttest{
require(ggplot2)
set.seed(1234)
x <- 1:15
y <- expf(x, 10, -0.3) + rnorm(15, 0, 0.2)
dat <- data.frame(x = x, y = y)
fit <- nls(y ~ SSexpf(x, a, c), data = dat)
## plot
ggplot(data = dat, aes(x = x, y = y)) + 
  geom_point() + 
  geom_line(aes(y = fitted(fit)))
# }

Run the code above in your browser using DataLab