Matlab自定义曲线拟合失败

时间:2013-01-20 18:24:28

标签: matlab curve-fitting

我正在使用cftool来定制Mössbauer光谱数据。有两个系数,Gamma和N0。

N = f(v)
  = (299792458000^2*Gamma^2*N0)/(299792458000^2*Gamma^2+4*v^2*(4.29383292e-15)^2)

使用默认设置(信任区域,强健关闭等)我得到以下条件:

Fit computation did not converge:
Fitting stopped because the number of iterations or function evaluations exceeded the specified maximum.

Fit found when optimization terminated:

General model:
     f(v) = (299792458000^2*Gamma^2*N0)/(299792458000^2*Gamma^2+4*v^2*(4.29383292e-
                    15)^2)
Coefficients (with 95% confidence bounds):
       Gamma =      0.9137  (-Inf, Inf)
       N0 =   2.454e+04  (2.059e+04, 2.849e+04)

Goodness of fit:
  SSE: 6.41e+11
  R-square: -2068
  Adjusted R-square: -2073
  RMSE: 4.013e+04

Warning: A negative R-square is possible if the model does not contain a constant term and the fit is poor (worse than just fitting the mean). Try changing the model or using a different StartPoint.

如果我转到Levenberg-Marquardt,我会直接了解数据:

General model:
     f(v) = (299792458000^2*Gamma^2*N0)/(299792458000^2*Gamma^2+4*v^2*(4.29383292e-
                    15)^2)
Coefficients (with 95% confidence bounds):
       Gamma =       0.793  (-Inf, Inf)
       N0 =   6.456e+04  (6.447e+04, 6.465e+04)

Goodness of fit:
  SSE: 3.098e+08
  R-square: 2.22e-16
  Adjusted R-square: -0.002513
  RMSE: 882.3

enter image description here

为什么这两种情况都失败了呢?

1 个答案:

答案 0 :(得分:1)

f(v)简化为f(v)=N0/(1+(2.8645e-26*(v/Gamma))^2),因此分母中的1占主导地位,直到(v / Gamma)开始变得大到10 ^ 25。你的Gamma为0.793,你的v为| 15 |我认为matlab可能很难收敛到N0以外的任何东西