SSspherical | R Documentation |
Self starter for a spherical function with parameters a (intercept), b (see below), xs (break-point)
spherical(x, a, b, xs)
SSspherical(x, a, b, xs)
x |
input vector |
a |
the intercept |
b |
the difference between the intercept and the asymptote, so that a + b = asymptote |
xs |
break-point of transition between nonlinear and plateau |
This equation was found in a publication by Dobermann et al. (2011) \Sexpr[results=rd]{tools:::Rd_expr_doi("doi:10.2134/agronj2010.0179")}
This function is nonlinear when x < xs
and flat (asymptote = a + b
) when x >= xs
.
a numeric vector of the same length as x containing parameter estimates for equation specified
spherical: vector of the same length as x using the spherical function
require(ggplot2)
set.seed(123)
x <- seq(0, 400, length.out = 50)
y <- spherical(x, 2, 5, 200) + rnorm(length(x), sd = 0.5)
dat <- data.frame(x = x, y = y)
fit <- nls(y ~ SSspherical(x, a, b, xs), 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.