如何在此日志数据上拟合曲线? [英] How can fit curve on this log data?

查看:15
本文介绍了如何在此日志数据上拟合曲线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对这个数据的拟合曲线有问题:

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 andsigma 是要估计的参数,而

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)

so 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆