How to calculate 95% prediction interval from nls
问题 Borrowing the example data from this question, if I have the following data and I fit the following non linear model to it, how can I calculate the 95% prediction interval for my curve? library(broom) library(tidyverse) x <- seq(0, 4, 0.1) y1 <- (x * 2 / (0.2 + x)) y <- y1 + rnorm(length(y1), 0, 0.2) d <- data.frame(x, y) mymodel <- nls(y ~ v * x / (k + x), start = list(v = 1.9, k = 0.19), data = d) mymodel_aug <- augment(mymodel) ggplot(mymodel_aug, aes(x, y)) + geom_point() + geom_line(aes