SSexp2P: Self-Starting Nls 'exp2P' Regression Model

SSexp2PR Documentation

Self-Starting Nls 'exp2P' Regression Model

Description

This selfStart model evaluates the power regression function (formula as: y=a*exp(b*x)). It has an initial attribute that will evaluate initial estimates of the parameters 'a' and 'b' for a given set of data.

Usage

SSexp2P(predictor, a, b)

Arguments

predictor

a numeric vector of values at which to evaluate the model.

a, b

The numeric parameters responding to the exp2P model.

Value

No return value (called for side effects).

See Also

ggtrendline, SSexp3P, SSpower3P, nls, selfStart

Examples

library(ggtrendline)
x<-1:5
y<-c(2,4,8,20,25)
xy<-data.frame(x,y)
getInitial(y ~ SSexp2P(x,a,b), data = xy)
## Initial values are in fact the converged values

fitexp2P <- nls(y~SSexp2P(x,a,b), data=xy)
summary(fitexp2P)

prediction <- predFit(fitexp2P , data.frame(x=x), se.fit = TRUE,
                          level = 0.95, interval = "confidence")
yfitexp2P <- prediction$fit
yfitexp2P  # output a matrix of predictions and bounds with column names fit, lwr, and upr.


ggtrendline documentation built on April 27, 2022, 9:06 a.m.