Main Content

自定义非线性ENSO数据分析

此示例使用多个自定义非线性方程拟合ENSO数据。ENSO数据包括复活节岛和澳大利亚达尔文之间的每月平均大气压力差异。这种差异驱动了南半球的贸易风。

The ENSO data is clearly periodic, which suggests it can be described by a Fourier series:

y (( X = 一种 0 + 一世 = 1 一种 一世 Cos (( 2 π X C 一世 + b 一世 (( 2 π X C 一世

在哪里一种一世一种ndb一世是振幅,C一世一种re the periods (cycles) of the data. Determine how many cycles exist.

As a first attempt, assume a single cycle and fit the data using one cosine term and one sine term.

y 1 (( X = 一种 0 + 一种 1 Cos (( 2 π X C 1 + b 1 (( 2 π X C 1

如果拟合不正确地描述数据,请添加其他余弦和正弦术语,并具有独特的周期系数,直到获得良好的拟合为止。

该方程是非线性的,因为未知系数C1作为三角函数参数的一部分。

Load Data and Fit Library and Custom Fourier Models

  1. 加载数据并打开曲线钳工应用程序。

    加载EnsoCurveFitter

  2. The app includes the Fourier series as a nonlinear library equation. However, the library equation does not meet the needs of this example because its terms are defined as fixed multiples of the fundamental frequencyw。Refer to傅立叶Seriesfor more information. Create the built-in library Fourier fit to compare with your custom equations:

    1. 在里面一种pp, on theCurve Fittertab, in theData部分,单击选择数据。在“选择拟合数据”对话框中,选择作为x数据价值和pressure作为y数据价值。

    2. Curve Fittertab, in theFit Type部分,单击箭头打开画廊。在Fit Gallery中,单击傅立叶一世n the回归模型group.

    3. 在里面Table Of Fits窗格,双击适合名称价值和enter傅立叶

    4. 在里面Fit Optionspane, change the number of terms to8

      观察库模型拟合。在接下来的步骤中,您将创建自定义方程式进行比较。

      ENSO数据的傅立叶拟合图

  3. Duplicate your fit. Right-click your fit in theTable Of Fitspane and select重复的“傅立叶”

  4. 命名新合身enso1period

  5. Curve Fittertab, in theFit Type部分,打开Fit类型画廊,然后单击自定义方程一世n theCustomgroup.

  6. 在里面Fit Options窗格,用以下内容替换等式编辑框中的示例文本:

    一种0+一种1*cos(2*pi*x/c1) + b1*sin(2*pi*x/c1)

    拟合选项窗格带自定义方程式

    该应用适用于Enso数据。

此处显示的图形和数值结果表明,拟合并不能很好地描述数据。特别是,拟合的值C1一世s unreasonably small. Your initial fit results might differ from these results because the starting points are randomly selected.

ENSO数据的自定义方程拟合图

定制方程式拟合ENSO数据的结果窗格

By default, the coefficients are unbounded and have random starting values from 0 to 1. The data include a periodic component with a period of about 12 months. However, withC1unconstrained and with a random starting point, this fit failed to find that cycle.

Use Fit Options to Constrain a Coefficient

  1. To assist the fitting procedure, constrainC1到一种value from 10 to 14. In theFit Options窗格,单击高级选项到expand the section and view the constraints for the coefficients. Observe that by default the coefficients are unbounded (bounds of-inf一种ndInf)。

  2. 在里面Coefficient Constraints表,改变降低一种ndbounds forC1到Constrain the cycle from 10 to 14 months, as shown next.

    ENSO1Period拟合的修改系数约束

    曲线钳工应用更新拟合。

  3. 观察新的拟合和残差图。如有必要,请单击残差图一世n the可视化部分Curve Fitter标签。

    适合ENSO1Period拟合的残差图

    对于某些数据点来说,拟合似乎是合理的,但显然不能很好地描述整个数据集。如预测的,数值导致Resultspane (C1 = 11.94)表示大约12个月的周期。但是,残差显示系统的周期性分布,表明至少存在一个周期。您应该在拟合方程式中包括其他周期。

Create Second Custom Fit with Additional Terms and Constraints

To refine your fit, you need to add an additional sine and cosine term toy1((X) 如下:

y 2 (( X = y 1 (( X + 一种 2 Cos (( 2 π X C 2 + b 2 (( 2 π X C 2

并限制C2大约是使用的界限的两倍C1

  1. 通过右键单击它来复制您的拟合Table Of Fitspane and selectingDuplicate "Enso1Period"

  2. 命名新合身Enso2Period

  3. 在里面Fit Optionspane, add two terms to the end of the previous equation so that the equation box displays the following terms:

    一种0+一种1*cos(2*pi*x/c1) + b1*sin(2*pi*x/c1) + a2*cos(2*pi*x/c2) + b2*sin(2*pi*x/c2)

  4. 点击高级选项扩展该部分。在里面Coefficient Constraints桌子,观察降低一种ndbounds forC1,将周期从10到14个月限制。添加更多系数约束。

    1. Change the降低一种ndbounds forC2大约是使用的界限的两倍C1(20 <C2<30)。

    2. Change the起点value for一种05

    As you change each setting, the Curve Fitter app updates the fit. You can observe the fit plot and the residuals plot.

Fit and residuals plots for the Enso2Period fit

对于大多数数据点来说,拟合似乎合理。但是,残差表明您应该在拟合方程式中包含另一个周期。

创建带有其他术语和约束的第三个自定义拟合

As a third attempt, add an additional sine and cosine term toy2((X

y 3 (( X = y 2 (( X + 一种 3 Cos (( 2 π X C 3 + b 3 (( 2 π X C 3

和限制的下界C3大约是三倍的价值C1

  1. 通过右键单击它来复制您的拟合Table Of Fitspane and selecting重复的“ enso2period”

  2. 命名新合身Enso3Period

  3. 在里面Fit Optionspane, add two terms to the end of the previous equation so that the equation box displays the following terms:

    一种0+一种1*cos(2*pi*x/c1) + b1*sin(2*pi*x/c1) + a2*cos(2*pi*x/c2) + b2*sin(2*pi*x/c2) + a3*cos(2*pi*x/c3) + b3*sin(2*pi*x/c3)

  4. 点击高级选项扩展该部分。Observe that your previous fit options are still present.

  5. 在里面Coefficient Constraints表,改变降低开往C336,大约是三倍的价值C1

    Modified coefficient constraints for the Enso3Period fit

    As you change each setting, the Curve Fitter app updates the fit. You can observe the fit plot and the residuals plot.

Fit and residuals plots for the Enso3Period fit

拟合是对前两个拟合的改进,并且似乎解释了ENSO数据集中的大多数周期。对于大多数数据,残差似乎是随机的,尽管仍然可见模式,表明可能存在其他周期,或者您可以改善拟合的幅度。

总之,对数据的傅立叶分析揭示了三个重要的周期。年度周期是最强的,但周期约为44和22个月。这些循环对应于El Nino和南部振荡(ENSO)。