简体   繁体   English

R中的指数函数

[英]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 我有R的基本知识,我想知道如何在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. 其中A = lambda参数,B是代表Y数据的参数,X代表下面的X数据。

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). PS:此x轴的数字(以百万为单位)。

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

This y-axis 这个y轴

any idea of how to write the code and fit this model in the data...? 关于如何编写代码并使该模型适合数据的任何想法...?

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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