自定义非线性ENSO数据分析
此示例使用多个自定义非线性方程拟合ENSO数据。ENSO数据包括复活节岛和澳大利亚达尔文之间的每月平均大气压力差异。这种差异驱动了南半球的贸易风。
The ENSO data is clearly periodic, which suggests it can be described by a Fourier series:
在哪里一种一世一种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.
如果拟合不正确地描述数据,请添加其他余弦和正弦术语,并具有独特的周期系数,直到获得良好的拟合为止。
该方程是非线性的,因为未知系数C1作为三角函数参数的一部分。
Load Data and Fit Library and Custom Fourier Models
加载数据并打开曲线钳工应用程序。
加载EnsoCurveFitter
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:
在里面一种pp, on theCurve Fittertab, in theData部分,单击选择数据。在“选择拟合数据”对话框中,选择
月
作为x数据价值和pressure
作为y数据价值。在Curve Fittertab, in theFit Type部分,单击箭头打开画廊。在Fit Gallery中,单击傅立叶一世n the回归模型group.
在里面Table Of Fits窗格,双击适合名称价值和enter
傅立叶
。在里面Fit Optionspane, change the number of terms to
8
。观察库模型拟合。在接下来的步骤中,您将创建自定义方程式进行比较。
Duplicate your fit. Right-click your fit in theTable Of Fitspane and select重复的“傅立叶”。
命名新合身
enso1period
。在Curve Fittertab, in theFit Type部分,打开Fit类型画廊,然后单击自定义方程一世n theCustomgroup.
在里面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.
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, withC1
unconstrained and with a random starting point, this fit failed to find that cycle.
Use Fit Options to Constrain a Coefficient
To assist the fitting procedure, constrain
C1
到一种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
)。在里面Coefficient Constraints表,改变降低一种nd上bounds for
C1
到Constrain the cycle from 10 to 14 months, as shown next.曲线钳工应用更新拟合。
观察新的拟合和残差图。如有必要,请单击残差图一世n the可视化部分Curve Fitter标签。
对于某些数据点来说,拟合似乎是合理的,但显然不能很好地描述整个数据集。如预测的,数值导致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) 如下:
并限制C2大约是使用的界限的两倍C1。
通过右键单击它来复制您的拟合Table Of Fitspane and selectingDuplicate "Enso1Period"。
命名新合身
Enso2Period
。在里面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)
点击高级选项扩展该部分。在里面Coefficient Constraints桌子,观察降低一种nd上bounds for
C1
,将周期从10到14个月限制。添加更多系数约束。Change the降低一种nd上bounds for
C2
大约是使用的界限的两倍C1
(20 <C2
<30)。Change the起点value for
一种0
到5
。
As you change each setting, the Curve Fitter app updates the fit. You can observe the fit plot and the residuals plot.
对于大多数数据点来说,拟合似乎合理。但是,残差表明您应该在拟合方程式中包含另一个周期。
创建带有其他术语和约束的第三个自定义拟合
As a third attempt, add an additional sine and cosine term toy2((X)
和限制的下界C3大约是三倍的价值C1。
通过右键单击它来复制您的拟合Table Of Fitspane and selecting重复的“ enso2period”。
命名新合身
Enso3Period
。在里面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)
点击高级选项扩展该部分。Observe that your previous fit options are still present.
在里面Coefficient Constraints表,改变降低开往
C3
到36
,大约是三倍的价值C1
。As you change each setting, the Curve Fitter app updates the fit. You can observe the fit plot and the residuals plot.
拟合是对前两个拟合的改进,并且似乎解释了ENSO数据集中的大多数周期。对于大多数数据,残差似乎是随机的,尽管仍然可见模式,表明可能存在其他周期,或者您可以改善拟合的幅度。
总之,对数据的傅立叶分析揭示了三个重要的周期。年度周期是最强的,但周期约为44和22个月。这些循环对应于El Nino和南部振荡(ENSO)。