数学建模社区-数学中国

标题: 求高手知道指数函数拟合 [打印本页]

作者: Losing    时间: 2015-5-5 12:10
标题: 求高手知道指数函数拟合
x=5:5:70;
y=[0.4293 0.2417 0.1240 0.0604 0.0493 0.0270 0.0223 0.0095 0.0079 0.0048 0.0064 0.0032 0.0016 0.0127];
y=c*exp(-c*x);

C是系数,想通过上面数据求出c。


作者: 光之仑    时间: 2015-5-5 12:30
General model Exp1:
       f(x) = a*exp(b*x)
Coefficients (with 95% confidence bounds):
       a =      0.7751  (0.7252, 0.825)
       b =     -0.1184  (-0.1262, -0.1105)

Goodness of fit:
  SSE: 0.000652
  R-square: 0.9966
  Adjusted R-square: 0.9964
  RMSE: 0.007371

作者: 光之仑    时间: 2015-5-5 12:32
General model:
       f(x) = c*exp(-c*x)
Coefficients (with 95% confidence bounds):
       c =      0.1458  (-0.8828, 1.174)

Goodness of fit:
  SSE: 0.1899
  R-square: 0.02284
  Adjusted R-square: 0.02284
  RMSE: 0.1209


作者: liwenhui    时间: 2017-6-5 10:40
LINGO也能实现:
  1. SETS:
  2. VAR/ 1..14/: X, Y;
  3. ENDSETS

  4. DATA:
  5. Y= 0.4293 0.2417 0.1240 0.0604 0.0493 0.0270 0.0223 0.0095 0.0079 0.0048 0.0064 0.0032 0.0016 0.0127;
  6. ENDDATA

  7. CALC:
  8. X( 1) = 5;
  9. @FOR( VAR( I)| I #GE# 2: X( I) = X( I - 1) + 5);
  10. ENDCALC

  11. MIN=RS;
  12. RS = @SUM( VAR( I): (C * @EXP( -C * X( I)) - Y( I))^ 2);

  13. CALC:
  14. @SET('GLOBAL', 1);
  15. ENDCALC
复制代码
结果:
  1. Global optimal solution found.
  2.   Objective value:                             0.1899075
  3.   Objective bound:                             0.1899066
  4.   Infeasibilities:                              0.000000
  5.   Extended solver steps:                             103
  6.   Total solver iterations:                         18999


  7.                        Variable           Value        Reduced Cost
  8.                              RS       0.1899075            0.000000
  9.                               C       0.1458114            0.000000
  10.                           X( 1)        5.000000            0.000000
  11.                           X( 2)        10.00000            0.000000
  12.                           X( 3)        15.00000            0.000000
  13.                           X( 4)        20.00000            0.000000
  14.                           X( 5)        25.00000            0.000000
  15.                           X( 6)        30.00000            0.000000
  16.                           X( 7)        35.00000            0.000000
  17.                           X( 8)        40.00000            0.000000
  18.                           X( 9)        45.00000            0.000000
  19.                          X( 10)        50.00000            0.000000
  20.                          X( 11)        55.00000            0.000000
  21.                          X( 12)        60.00000            0.000000
  22.                          X( 13)        65.00000            0.000000
  23.                          X( 14)        70.00000            0.000000
  24.                           Y( 1)       0.4293000            0.000000
  25.                           Y( 2)       0.2417000            0.000000
  26.                           Y( 3)       0.1240000            0.000000
  27.                           Y( 4)       0.6040000E-01        0.000000
  28.                           Y( 5)       0.4930000E-01        0.000000
  29.                           Y( 6)       0.2700000E-01        0.000000
  30.                           Y( 7)       0.2230000E-01        0.000000
  31.                           Y( 8)       0.9500000E-02        0.000000
  32.                           Y( 9)       0.7900000E-02        0.000000
  33.                          Y( 10)       0.4800000E-02        0.000000
  34.                          Y( 11)       0.6400000E-02        0.000000
  35.                          Y( 12)       0.3200000E-02        0.000000
  36.                          Y( 13)       0.1600000E-02        0.000000
  37.                          Y( 14)       0.1270000E-01        0.000000

  38.                             Row    Slack or Surplus      Dual Price
  39.                               1       0.1899075           -1.000000
  40.                               2        0.000000           -1.000000
复制代码






欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) Powered by Discuz! X2.5