主要内容

Exponential Models

About Exponential Models

The toolbox provides a one-term and a two-term exponential model as given by

y = a e b x y = a e b x + c e d x

Exponentials are often used when the rate of change of a quantity is proportional to the initial amount of the quantity. If the coefficient associated withb和/ordis negative,yrepresents exponential decay. If the coefficient is positive,y代表指数增长。

For example, a single radioactive decay mode of a nuclide is described by a one-term exponential.a被解释为核的初始数量,bis the decay constant,xis time, andyis the number of remaining nuclei after a specific amount of time passes. If two decay modes exist, then you must use the two-term exponential model. For the second decay mode, you add another exponential term to the model.

例子of exponential growth include contagious diseases for which a cure is unavailable, and biological populations whose growth is uninhibited by predation, environmental factors, and so on.

Fit Exponential Models Interactively

  1. Open the Curve Fitter app by enteringcurveFitter在Matlab®command line. Alternatively, on theApps标签,在数学,统计和优化group, click曲线钳工.

  2. In the Curve Fitter app, select curve data. On the曲线钳工标签,在数据部分中,点击Select Data. In theSelect Fitting Data对话框,选择X DataY Data, 要不就Y Data反对索引。

  3. 单击箭头适合类型部分打开画廊,然后单击Exponential在里面Regression Models团体。

The适合选项pane for the single-termExponential拟合在这里显示。

适合选项pane for exponential fit

You can specify the following options in the适合选项窗格:

  • Choose one or two terms to fitEXP1或者exp2. Look in the结果pane to see the model terms, values of the coefficients, and goodness-of-fit statistics.

  • 可选,在Advanced Options部分,指定适合您数据的系数启动值和约束范围,或更改算法设置。此处显示的系数启动值和约束是censusdata.

    The app calculates optimized start points forExponential根据数据集进行拟合。您可以覆盖起点,并在适合选项pane. For an example specifying starting values appropriate to the data, seeGaussian Fitting with an Exponential Background.

适合选项pane showing Advanced Options for an exponential fit

有关设置的更多信息,请参阅Specify Fit Options and Optimized Starting Points.

Fit Exponential Models Using the fit Function

This example shows how to fit an exponential model to data using thefitfunction.

指数库模型是对fitFittypefunctions. Specify the model type'exp1'或者'exp2'.

Fit a Single-Term Exponential Model

以指数趋势生成数据,然后使用单个指数级拟合数据。绘制拟合和数据。

x =(0:0.2:5)';y = 2*exp(-0.2*x) + 0.1*randn(size(x));f = fit(x,y,'exp1')
f = General model Exp1: f(x) = a*exp(b*x) Coefficients (with 95% confidence bounds): a = 2.021 (1.89, 2.151) b = -0.1812 (-0.2104, -0.152)
情节(f,x,y)

Figure contains an axes object. The axes object contains 2 objects of type line. These objects represent data, fitted curve.

Fit a Two-Term Exponential Model

f2 = fit(x,y,'exp2')
F2 =常规模型EXP2:F2(X)= A*EXP(B*X)+ C*EXP(D*X)系数(具有95%置信度界限):A = 384.8(-4.78e+ 09,4.78e+09)b = -0.2572(-2939,2938)C = -382.8(-4.78e+09,4.78e+09)d = -0.2577(-2957,2957)
情节(F2,X,Y)

Figure contains an axes object. The axes object contains 2 objects of type line. These objects represent data, fitted curve.

设置起点

The toolbox calculates optimized start points for exponential fits based on the current data set. You can override the start points and specify your own values.

Find the order of the entries for coefficients in the first model (f)使用coeffnamesfunction.

coeffnames(f)
ans =2x1 cell{'a'} {'b'}

If you specify start points, choose values appropriate to your data. Set arbitrary start points for coefficientsabfor example purposes.

f = fit(x,y,'exp1','StartPoint',[1,2])
f = General model Exp1: f(x) = a*exp(b*x) Coefficients (with 95% confidence bounds): a = 2.021 (1.89, 2.151) b = -0.1812 (-0.2104, -0.152)
情节(f,x,y)

Figure contains an axes object. The axes object contains 2 objects of type line. These objects represent data, fitted curve.

Examine Exponential Fit Options

如果要修改适合选项,例如系数启动值和适合您数据的约束范围,或更改算法设置,请检查拟合选项。有关这些选项的详细信息,请参见在该选项上的属性表fitoptions参考页。

fitoptions('exp1')
ans = Normalize: 'off' Exclude: [] Weights: [] Method: 'NonlinearLeastSquares' Robust: 'Off' StartPoint: [1x0 double] Lower: [1x0 double] Upper: [1x0 double] Algorithm: 'Trust-Region' DiffMinChange: 1.0000e-08 DiffMaxChange: 0.1000 Display: 'Notify' MaxFunEvals: 600 MaxIter: 400 TolFun: 1.0000e-06 TolX: 1.0000e-06

See Also

Apps

Functions

相关话题