输入代码如下:
RData<-read.delim(file="D:/SI data/STG/7 south.txt",header=TRUE)#打开数据文件
> y<-RData$SI
> stg<-RData$STG
> stgi<-log(stg)
> RS<-nls(y~exp(-a*(stgi-b)^2),data=RData,start=list(a=10,b=0.2))
>summary(RS)
得到结果如下:
Formula: y ~ exp(-a * (stgi - b)^2)
Parameters:
Estimate Std. Error t value Pr(>|t|)
a 1.15335 0.17014 6.779 3.04e-05 ***
b -0.22398 0.06931 -3.232 0.00799 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.08747 on 11 degrees of freedom
Number of iterations to convergence: 8
Achieved convergence tolerance: 1.129e-06