simulGeneralisedLogistic: Generalised logistic growth (Richards' curve)

View source: R/growth.R

simulGeneralisedLogisticR Documentation

Generalised logistic growth (Richards' curve)

Description

Simulate phenotypes via the following model (Richards (1959)): y(t) = g(t) + epsilon(t) where g(t) = a + (k - a) / ((c + b exp(-r t))^(1/nu)) and epsilon(t) ~ N(0, sigma^2).

Usage

simulGeneralisedLogistic(
  t = seq(-1.5, 3.5, 0.5),
  a = 0,
  k = 1,
  r = 3,
  nu = 0.5,
  b = 0.5,
  c = 1,
  sigma2 = 0
)

Arguments

t

vector of time points

a

lower asymptote

k

upper asymptote (if a=0, k is called the carrying capacity)

r

growth rate

nu

affects near which asymptote maximum growth occurs (> 0)

b

related to the value at t=0

c

typically takes a value of 1

sigma2

variance of the errors

Value

list

Author(s)

Timothee Flutre

Examples

## Not run: set.seed(1859)
model <- simulGeneralisedLogistic(t=seq(-1.5, 3.5, 0.1),
                                  a=0, k=1, r=3, nu=0.5, b=0.5, c=1,
                                  sigma2=0.01)
plot(x=model$t, y=model$g.t, type="l", las=1, xlab="time (t)", ylab="g(t) and y(t)",
     main="Generalised logistic with/without noise", ylim=range(model$y.t))
points(x=model$t, y=model$g.t, pch=1)
points(x=model$t, y=model$y.t, pch=19, col="red", cex=1.2)
## lines(x=model$t, y=model$y.t, col="red")
legend("bottomright", bty="n", col=c("black", "black", "red"), lty=c(1,NA,NA),
       pch=c(NA,1,19), legend=c("dynamics", "state", "obs."))

## End(Not run)

timflutre/rutilstimflutre documentation built on Feb. 7, 2024, 8:17 a.m.