self start for plateau-linear function
Self starter for plateau-linear function with parameters a (plateau), xs (break-point), b (slope)
plin(x, a, xs, b) SSplin(x, a, xs, b)
x |
input vector |
a |
the initial plateau |
xs |
break-point of transition between plateau and linear |
b |
the slope |
Initial plateau with a second linear phase. When x < xs: y = a and when x >= xs: y = a + b * (x - xs).
a numeric vector of the same length as x containing parameter estimates for equation specified
plin: vector of the same length as x using the plateau-linear function
require(ggplot2) set.seed(123) x <- 1:30 y <- plin(x, 10, 20, 1) + rnorm(30, 0, 0.5) dat <- data.frame(x = x, y = y) fit <- nls(y ~ SSplin(x, a, xs, b), data = dat) ## plot ggplot(data = dat, aes(x = x, y = y)) + geom_point() + geom_line(aes(y = fitted(fit))) ## Confidence intervals confint(fit)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.