简体   繁体   中英

exponential function in R

I have basic knowledge in R, I would like to know how to write a code of an exponential function in R

F(X)=B(1-e^-AX)

where A=lambda parameter, B is a parameter represents the Y data, X represents the X data below.

I need the exponential model to generate the curve to fit the data; for example:

X <- c(22, 44, 69, 94, 119, 145, 172, 199, 227, 255) 

PS: this x-axis in numbers (in millions).

Y <- c(1, 7, 8, 12, 12, 14, 14, 18, 19, 22)

This y-axis

any idea of how to write the code and fit this model in the data...?

R中,您可以使用exp()编写指数函数:

F <- Y*(1-exp(-A*X))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM