非线性回归模型的置信区间
Confidence Interval for Non Linear Regression Model
我的数据包含两列:时间和累计数,如下所示:
time <- c(1:14)
cum.num <- c(20, 45, 99, 195, 301, 407, 501, 582, 679, 753, 790, 861, 1011, 1441)
我的非线性函数是:
c1*cos(0.6731984259*time)+c2*sin(0.6731984259*time)+c3*(time)^2+c4*time+c5
我的 objective 是使用 R 中的 nls()
使用非线性回归对该函数建模,并计算置信区间。我拥有以下物品:
m1.fit<-nls(cum.vul~c1*cos(0.6731984259*time)+c2*sin(0.6731984259*time)+c3*(time)^2+c4*time+c5,start=list(c1=-50,c2=-60,c3=5,c4=8,c5=100))
我在计算置信区间时出错,我尝试了以下方法:
confint(m1.fit)
发出此命令后出现以下错误:
Waiting for profiling to be done...
Error in prof$getProfile() :
step factor 0.000488281 reduced below 'minFactor' of 0.000976562
谁能在这方面帮助我?
试用软件包 nlstools:
> nlstools::confint2(m1.fit)
2.5 % 97.5 %
c1 -48.556270 54.959689
c2 -175.654079 -45.216965
c3 3.285062 9.529072
c4 -49.254627 46.007629
c5 -34.135835 272.864743`
我的数据包含两列:时间和累计数,如下所示:
time <- c(1:14)
cum.num <- c(20, 45, 99, 195, 301, 407, 501, 582, 679, 753, 790, 861, 1011, 1441)
我的非线性函数是:
c1*cos(0.6731984259*time)+c2*sin(0.6731984259*time)+c3*(time)^2+c4*time+c5
我的 objective 是使用 R 中的 nls()
使用非线性回归对该函数建模,并计算置信区间。我拥有以下物品:
m1.fit<-nls(cum.vul~c1*cos(0.6731984259*time)+c2*sin(0.6731984259*time)+c3*(time)^2+c4*time+c5,start=list(c1=-50,c2=-60,c3=5,c4=8,c5=100))
我在计算置信区间时出错,我尝试了以下方法:
confint(m1.fit)
发出此命令后出现以下错误:
Waiting for profiling to be done... Error in prof$getProfile() : step factor 0.000488281 reduced below 'minFactor' of 0.000976562
谁能在这方面帮助我?
试用软件包 nlstools:
> nlstools::confint2(m1.fit)
2.5 % 97.5 %
c1 -48.556270 54.959689
c2 -175.654079 -45.216965
c3 3.285062 9.529072
c4 -49.254627 46.007629
c5 -34.135835 272.864743`