# NOT RUN {
library(ggtrendline)
x<-1:5
y<-c(2,4,8,16,28)
xy<-data.frame(x,y)
getInitial(y ~ SSexp3P(x,a,b,c), data = xy)
## Initial values are in fact the converged values
fitexp3P <- nls(y~SSexp3P(x,a,b,c), data=xy)
summary(fitexp3P)
prediction <- predFit(fitexp3P , data.frame(x=x), se.fit = TRUE,
level = 0.95, interval = "confidence")
yfitexp3P <- prediction$fit
yfitexp3P # output a matrix of predictions and bounds with column names fit, lwr, and upr.
# }
Run the code above in your browser using DataLab