Week 6: The connection between statistical mechanics and ensemble forecast II: Applications#
Connections between Liouville equation (LE) and ensemble forecasts#
Last week, we learned the physical meaning of Jacobian matrix, determinant and LE. This week, we will walk through a few of their applications. Before we introduce the examples, we need to know there are two equivalent formulas of LE: (1) initial state-based LE and (2) current state-based LE. One easy way to distinguish these two is looking at how (64) is defined.
First, let’s consider a dynamical system with first-order derivative.
In the initial state-based method, the LE is only a function of initial state and time. Physically, we can know how a dynamical system evolves with time as long as we know its initial states and time for integration. i.e.,
where \(\Xi\) is the initial state and \(t\) represents the number of time steps we integrate forward. Then the determinant of the Jacobian matrix, which maps a perturbation of the initial condition to a perturbation of the current state, can be written as
Since the dynamical system is deterministic, we can also find a one-to-one bijection between \(\mathbf{\Xi}\) and \(\mathbf{X}\) at a given \(t\). i.e.,
The existence of 1-on-1 bijection enables us to rewrite the prognostic equation of \(\alpha\) ((67)) i.e., replace \(\mathrm{\Xi}\) with \(\mathrm{X}\)
compare (74) to the initial state-based LE (similar to (67))
By observing (74) and (75), it’s not hard to find their analogies in equations of fluid dynamics. (74) is similar to so-called Eulerian form (i.e., observing the system at a fixed point), while (75) is similar to Lagrangian form (i.e, observers following the particle). This is also the reason why it’s called “particle flow”.
To illustrate the mathematical equivalence between (74) and (75), we use a Riccati equation (i.e., equation with form of \(x^{'}=P(t)x^2+Q(t)x+R(t)\)) to test (74) and (75)
the analytical solution is
where \(\Xi\) is the initial condition and \(t\) is time of integration. Inverting (77) (i.e., the bijection in (73)), we can find the initial state as a function of current state.
The Jacobian as a function of initial state can be written as,
and the Jacobian as a function of current state can be written as,
Now, let’s substitute \(\alpha(\Xi,t)\) in (75) with (79) and \(\alpha(X,t)\) in (74) with (80), which will give us
We can replace the right-hand-side of the second equation in (81) with (77). Then we can find the first and second equations are mathematically equivalent.
Note
(71) leads to a very interesting debate in science, “Laplace demon theory”. Laplace demon theory describes that if there is an intellect who knows the “specific location of every element particle in the universe”, it will know the past as well as the future of the entire universe given (71) is deterministic. For example, every decision made by you and me can be considered as result of chemical reaction (i.e., the moving of electrons) in your brain. However, the discovery of uncertainty principle in 1927 protects us from having such demon.
In weather forecast, there is always some uncertainty since we can never have infinitely fine-scale observations.
Solution of the Liouville equation#
Different from finding the solution of a dynamical system, the analytical solution of LE is relatively simple and interpretable. We can divide both sides of (75) by \(\alpha\) and integrate over the \(t\) dimension, which gives us,
which further leads to
where \(\alpha(\mathbf{\Xi},0)=1\) by definition, since the Jacobian of the identity map is the identity matrix. Equivalently, in density form
If we still remember what we learned in week1, (83) and (6) have exact the same formula. The only difference is, we leverage Taylor expansion to linearize the dynamical system while this week (and last week), we use Jacobian matrix to map the initial states to the final states.
Liouville equation in 1st-order ODE case#
Here we use a simple ODE along with a python code showing how to implement LE in a forecast problem.
Before we solve this ODE, we can take a look at its dynamical behavior. From (85), one can easily find that it has three equilibrium points: -1, 0 ,1. At these three equilibrium points, \(\frac{dx}{dt}\) equals 0, indicating the tendency vanishes and the state stays where it is. However, among these points, two of them are stable equilibrium points and the other one is unstable equilibrium point.
The analytical solution of (85) can be written as (brainstorming…)
where \(\Xi\) is the initial state and \(t\) is the time for integration. One can verify that (86) solves (85) by direct differentiation. As a sanity check on its long-term behavior, substituting \(t\) with \(\infty\) gives us \(x(\Xi,t) \rightarrow \pm 1\) (for \(\Xi \neq 0\)), which is consistent with the equilibrium analysis above.
On the other hand, (85) also leads to
. by substituting (87) into (84), we can have
Now, we can compare the probabilistic forecast generated by LE as well as the traditional forecast method. For the LE-based method, we can use numerical integration to approach the analytical solution:
def PDF(x,mu,std):
return stats.norm(mu, std).pdf(x)
rho = PDF(x,mu,std)
# x = location, rho = density in given location, n_step = number of time step, t_size = size of each step
def LE_method(x,rho,n_step,t_size):
for count in range(n_step): # forward for 1 time steps
xi = x
xint = 0
# Riemann sum of d(Phi)/dx along the trajectory over one time step.
# Start at i=1 so that the loop ends at tp = t_size, i.e. x is advanced
# by a *full* time step rather than falling short by one sub-step.
for i in np.arange(1,1001,1):
tp = i*t_size/1000
x = xi*np.exp(tp)*(1-xi*xi+xi*xi*np.exp(2*tp))**(-1/2)
c = 1-3*x*x
xint += c
rho = rho*np.exp(-xint*t_size/1000)
rho = rho/np.trapz(rho,x) # safeguard only; the LE already conserves probability
return x,rho
For traditional method, we initialized model with 10000 normally distributed random points and integrate them forward in time. The comparison is shown below.
Fig. 14 The intercomparison between traditional probabilistic forecast method (bar) vs LE-based method.#
The LE-based method only used 200 grid points (chosen for the purpose of visualization) while the traditional method took 10000 scenarios to get a comparable answer, suggesting the LE-based method can reach a similar accuracy with far fewer points than the traditional ensemble forecast method.
Liouville equation in Lorenz 63 model (Lorenz 84 model as HW)#
We can also apply the LE-based method to a higher-dimensional system, such as the Lorenz 63 model, which is a three-variable truncation of the 2D Rayleigh-Bénard convection problem. In the homework you will repeat the exercise with the Lorenz 84 model, a different three-variable system that Lorenz designed as a caricature of the mid-latitude general circulation rather than of convection.
or in a matrix form
To apply the LE-based method to the Lorenz 63 model, we first linearize the equation about a state \((\bar{X},\bar{Y},\bar{Z})\), since what the LE needs is the divergence of the flow, i.e., the sum of the diagonal elements (the trace) of the Jacobian. (we will talk about the off-diagonal element in the chapters of generalized instability problem).
and the corresponding \(\sum_{i}\frac{\partial \Phi_i(\mathbf{X},t)}{\partial X_i}\) is
Interestingly, we can find that this divergence is a negative constant, independent of location. Through (84), a negative divergence means the phase-space volume spanned by the ensemble contracts, and therefore the density \(\rho\) carried by each member grows at the uniform rate \(\mathrm{exp}[(\sigma+1+b)\tau]\). Note that this trace is the rate at which volume shrinks, not the rate at which the error grows: Lorenz 63 is a dissipative system in which volumes contract while errors still grow along certain directions (the stretching comes from the state-dependent off-diagonal terms, which we defer to the generalized instability chapters). Uniform volume contraction also does not mean the PDF will stay Gaussian, given that each member is moving around within a nonlinear system. Physically, ensemble members are something like particles carrying different amounts of electric charge (probability density). Thus, even if each member carries the same shape of PDF (Gaussian), their superposition in phase space is not necessarily Gaussian.
The animation below shows the LE-based method of probabilistic forecast for Lorenz 63 model. We can find that the system goes through a stage of linear error growth first (stretching along y-axis). At the later stage, we can find the regions with higher probability are concentrated around the two lobes (wings) of the attractor, i.e., around the two unstable equilibria \(C^{\pm}\). This feature is generally consistent with our finding.
Fig. 15 Using LE-based method of generating probabilistic forecast in Lorenz 63 model.#
Note
In the homework assignment, you will practice how to apply the LE-based method to Lorenz 84 model ((93)). Different from the Lorenz 63 model, the convergence/divergence of \(\Phi_i(\mathbf{X},t)\) is state-dependent (a function of location). This indicates that the probability density carried by each member might experience nonlinear decaying/growth when it is moving around inside the dynamical system.
Challenges of applying Liouville Equation to weather forecast#
One can find LE is a powerful tool for generating the probabilistic forecast. However, one fundamental problem of implementing LE to a dynamical system is that the ultra-high dimension of weather forecast model makes finding the analytical solution impossible.
Given the existing challenge of applying LE to a weather forecast model, Singular Value Decomposition (which is closely related to Principal Component Analysis – PCA is just the SVD of the centered data matrix) was introduced to the field of data assimilation to extract the dominant information in a data set. Mathematically, it finds a few orthogonal components, which successively maximize the explained variance. Thus, after we apply SVD to a given data set, we can efficiently compress the data and reduce the data dimension. We will cover more details in the following few weeks.