simggro: Simulate growth curves

Description Usage Arguments Value Examples

View source: R/simggro.R

Description

A sandbox to simulate a growth process, beginning with a low initial lag period, through an exponential growth phase, to a higher final maximal asymptote. The function is based upon the Gompertz growth model. Random values for y are created using the equation: 'y = ylo + d*exp(-exp(((k*exp(1))/d)*(lambda-x)+1)) + rnorm(length(x), 0, sd)'. The regression formula is: 'y ~ ylo + d*exp(-exp(((k*exp(1))/d)*(lambda-x) + 1))'.

Usage

1
simggro(x, k, ylo, d, lambda, sd, reps)

Arguments

x

A vector of linear scale values, such as time.

k

The maximal growth rate, approximately the slope of the l ine in the growth phase.

ylo

The lowest value of y, or a starting value.

d

The difference between ylo and the highest value of y.

lambda

The lag period, in units of the x scale

sd

The standard deviation of the replicates.

reps

The number of replicates per value of x.

Value

ggplot, data

Examples

1
2
3
4
5
6
7
8
# simulates l.plantarium growth, see Fig 3 in Applied Environ Micro 56:1875, 1990

plantarium <- simggro(x=c(1:8, 12, 13, 24),
  k=2, ylo=0, d=9, lambda=2.5, sd=0.5, reps=1)

plantarium

plantarium$data

TJMurphy/nlfitr documentation built on March 18, 2021, 12:33 p.m.