A simple way to model atmospheric pressure is to assume that values dance around a mean **μ**. We then assume in the simplest case that **deviations of consecutive values** **ε** from the mean follow this equation:

The relation is linear and in the simplest case, we need to estimate only one parameter—**θ**. To do so, we will require SciPy functionality. The full code for this recipe is in the `moving_average.py`

file in this book's code bundle:

from __future__ import print_function import numpy as np import matplotlib.pyplot as plt from datetime import datetime as dt from scipy.optimize import leastsq data = np.load('cbk12.npy') ...

Start Free Trial

No credit card required