User`s guide

3 Fitting Data
3-52
General Equation: Fourier Series Fit
This example fits the ENSO data using several custom nonlinear equations.
The ENSO data consists of monthly averaged atmospheric pressure differences
between Easter Island and Darwin, Australia. This difference drives the trade
winds in the southern hemisphere.
As shown in Example: Smoothing Data on page 2-21, the ENSO data is
clearly periodic, which suggests it can be described by a Fourier series
where a
i
and b
i
are the amplitudes, and c
i
are the periods (cycles) of the data.
The question to be answered in this example is how many cycles exist? As a
first attempt, assume a 12 month cycle and fit the data using one sine term and
one cosine term.
If the fit does not describe the data well, add additional sine and cosine terms
with unique period coefficients until a good fit is obtained.
Because there is an unknown coefficient c
1
included as part of the
trigonometric function arguments, the equation is nonlinear. Therefore, you
must specify the equation using the General Equations pane of the Create
Custom Equation GUI. This pane is shown below for the equation given by
y
1
(x).
yx() a
0
a
i
2π
x
c
i
----


b
i
2π
x
c
i
----


sin+cos
i 1=
+=
y
1
x() a
0
a
1
2π
x
c
1
-----


b
1
2π
x
c
1
-----


sin+cos+=
Assume one 12 month cycle.
By default, the coefficients are
unbounded and have random
starting values between 0 and 1.
Specify a meaningful
equation name.