SSricker: self start for Ricker Function

SSrickerR Documentation

self start for Ricker Function

Description

Self starter for Ricker function with parameters a and b

Usage

ricker(time, a, b)

SSricker(time, a, b)

Arguments

time

input vector (x) which is normally ‘time’, the smallest value should be close to zero.

a

which is related to the initial growth slope

b

which is related to the slowing down or decline

Details

This function is described in Archontoulis and Miguez (2015) - (doi:10.2134/agronj2012.0506) and originally in Ricker, W. E. (1954) Stock and Recruitment Journal of the Fisheries Research Board of Canada, 11(5): 559–623. (doi:10.1139/f54-039). The equation is: a * time * exp(-b * time).

Value

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

ricker: vector of the same length as x (time) using the ricker function

Examples


require(ggplot2)
set.seed(123)
x <- 1:30
y <- 30 * x * exp(-0.3 * x) + rnorm(30, 0, 0.25)
dat <- data.frame(x = x, y = y)
fit <- nls(y ~ SSricker(x, a, b), data = dat)
## plot
ggplot(data = dat, aes(x = x, y = y)) + 
  geom_point() + 
  geom_line(aes(y = fitted(fit)))


nlraa documentation built on May 29, 2024, 2:01 a.m.