nlraa (version 0.53)

SSpquad: self start for plateau-quadratic function

Description

Self starter for plateau-quadratic function with parameters a (plateau), xs (break-point), b (slope), c (quadratic)

Usage

pquad(x, a, xs, b, c)

SSpquad(x, a, xs, b, c)

Arguments

x

input vector

a

the plateau value

xs

break-point of transition between plateau and quadratic

b

the slope (linear term)

c

quadratic term

Value

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

Details

Reference for nonlinear regression Archontoulis and Miguez (2015) - (doi:10.2134/agronj2012.0506).

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataCamp Workspace