SSgmicmen | R Documentation |
Self starter for a Michealis-Menten function with parameters
gmicmen(x, y0, ymax, c, k)
SSgmicmen(x, y0, ymax, c, k)
x |
input vector |
y0 |
the lowest value |
ymax |
the maximum value |
c |
parameter controlling the shape of the function |
k |
parameter controlling the time for maximum value |
# This is a modification of an equation that appears in the paper in the details. # It is not clear how useful it is.
Source: A generalized Michaelis-Menten equation for the analysis of growth. Lopez et al. J. Anim. Sci. 2000. 78:1816-1828.
a numeric vector of the same length as x containing parameter estimates for equation specified
gmicmen: vector of the same length as x using the modified Michaelis-Menten function
require(ggplot2)
set.seed(123)
x <- 1:30
y <- gmicmen(x, 1, 10, 0.7, 10) + rnorm(30, 0, 0.01)
dat <- data.frame(x = x, y = y)
fit <- nls(y ~ SSgmicmen(x, y0, ymax, c, k), data = dat)
## plot
ggplot(data = dat, aes(x = x, y = y)) +
geom_point() +
geom_line(aes(y = fitted(fit)))
## Confidence intervals
confint(fit)
## Different value for c
y <- gmicmen(x, 1, 10, 5, 10) + rnorm(30, 0, 0.01)
dat <- data.frame(x = x, y = y)
fit <- nls(y ~ SSgmicmen(x, y0, ymax, c, k), data = dat)
## plot
ggplot(data = dat, aes(x = x, y = y)) +
geom_point() +
geom_line(aes(y = fitted(fit)))
## Confidence intervals
confint(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.