SSpquad: self start for plateau-quadratic function

SSpquadR Documentation

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

Details

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

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

Examples


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)


nlraa documentation built on May 29, 2024, 2:01 a.m.