如何在该日志数据上拟合曲线? [英] How can fit curve on this log data?
问题描述
此数据的拟合曲线有问题:
I have a problem with a fit curve on this data:
在x轴上,我们有关于风强度的数据(m/s),在y轴上,我们有测井数据(渔获).我只在没有对数的数据上拟合了一条曲线(nls模型,高斯曲线),但是当我尝试对数据进行拟合时,R告诉我:
On x axes we have a data about wind intensity (m/s), on y axes we have log data (fish catch). I fitted a curve (nls model, Gaussian curve) only on data without logaritm, but when i tried on log data, R tell me:
Error in nls(mean.w ~ k * exp(-1/2 * (x.wind - mu)^2/sigma^2), :
singolar gradient
模型为:mean.w ~ k * exp(-1/2 * (x.wind - mu)^2/sigma^2)
,其中k,mu and sigma
是要估计的参数,并且
The model is: mean.w ~ k * exp(-1/2 * (x.wind - mu)^2/sigma^2)
, where k,mu and sigma
are the parameters to estimate, and
mean.w # is y axes (log fish catch)
x.wind # is x axes wind intensity
非日志数据的拟合曲线为:
the fit curve on not log data is:
#红色均值
我在日志数据方面的方面结果是一条相似的拟合曲线,具有不同的参数值,问题是,我必须使用哪种模型?
My aspected result on log data is a similar fit curve, with different values of parameters, the problem is, wath kind of model i must to use?
数据为:
1.1 1.4 1.6 1.7 1.8 1.9 2 2.1 2.2 2.3 2.4 2.5
-3.0951726 NaN -2.5337439 -3.6184583 -3.2161971 -2.4405031 -1.4349350 -1.5676554 -1.0594076 -0.3290359 -1.2241878 -0.6336298
2.6 2.7 2.8 2.9 3 3.1 3.2 3.3 3.4 3.5 3.6 3.7
-1.3863366 -1.4221593 -1.4961145 -1.2632693 -2.5509134 -4.7270333 -2.4795247 -2.0024069 -4.5975918 -2.9954250 -3.2390678 -2.6339971
3.8 3.9 4 4.1 4.2 4.3 4.4 4.5 4.6 5
-3.3419309 -3.5258236 -4.4962217 0.7027033 -3.6392906 -4.0426306 -1.0798462 NaN -3.0574602 -3.0498198
x值从1.1到5,且低于日志数据.
With x values from 1.1 to 5, and below log data.
推荐答案
问题在于模型本身.该模型的RHS可以写为:
The problem is the model itself. The RHS of the model can be written:
k * exp(-1/2 * x.wind / sigma^2) * exp(1/2 * mu /sigma^2)
所以k
和最右边的因素起相同的作用.参数不是唯一确定的.
so k
and the rightmost factor play the same role. The parameters are not uniquely determined.
要解决此问题,请忽略k
或模型中的最后一个因素.
To fix this omit k
or the last factor from the model.
这篇关于如何在该日志数据上拟合曲线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!