SSpquad | R Documentation |
Self starter for plateau-quadratic function with parameters a (plateau), xs (break-point), b (slope), c (quadratic)
pquad(x, a, xs, b, c)
SSpquad(x, a, xs, b, c)
x |
input vector |
a |
the plateau value |
xs |
break-point of transition between plateau and quadratic |
b |
the slope (linear term) |
c |
quadratic term |
Reference for nonlinear regression Archontoulis and Miguez (2015) - (doi:10.2134/agronj2012.0506).
a numeric vector of the same length as x containing parameter estimates for equation specified
pquad: vector of the same length as x using the plateau-quadratic function
require(ggplot2)
set.seed(12345)
x <- 1:40
y <- pquad(x, 5, 20, 1.7, -0.04) + rnorm(40, 0, 0.6)
dat <- data.frame(x = x, y = y)
fit <- nls(y ~ SSpquad(x, a, xs, b, c), data = dat)
## plot
ggplot(data = dat, aes(x = x, y = y)) +
geom_point() +
geom_line(aes(y = fitted(fit)))
confint(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.