TransportMaps.Distributions.Examples.Lorenz96.Lorenz96Distributions
¶
Module Contents¶
Classes¶
Defines the evolution of the dynamics of the Lorenz-96 (model II) system. |
|
Defines the evolution of the Lorenz-96 dynamics for one forward Euler step. |
|
Defines the evolution of the Lorenz-96 dynamics for \(n\) forward Euler steps. |
|
Defines the Hidden Markov Chain distribution defined by the Lorenz-96 dynamics. |
|
Defines the Hidden Markov Chain distribution defined by the Lorenz-96 dynamics in modal form. |
- class TransportMaps.Distributions.Examples.Lorenz96.Lorenz96Distributions.Lorenz96DynamicsMap(d=40, K=1, F=8.0)[source]¶
Bases:
TransportMaps.Maps.Map
Defines the evolution of the dynamics of the Lorenz-96 (model II) system.
Evaluates the right hand side the Lorenz-96 system:
\[\dot{x}_n = \sum_{j=-J}^J \sum_{i=-J}^J (-x_{n-2K-i} x_{n-K-j} + x_{n-K+j-i} x_{n+K+j})/K^2 - x_{n} + F\]where \(J=(K-1)/2\) and \(K\) is odd.
The model is presented in
Lorenz, E. N. (2005). Designing Chaotic Models. Journal of the Atmospheric Sciences, 62(5), 1574–1587. https://doi.org/10.1175/JAS3430.1
For the parameter \(K=1\), this reverts to the original Lorenz-96 model
Lorenz, E. (1963). Deterministic nonperiodic flow. Journal of the Atmospheric Sciences. https://doi.org/10.1175/1520-0469(1963)020<0130%3ADNF>2.0.CO%3B2
- evaluate(x, *args, **kwargs)[source]¶
[Abstract] Evaluate the map \(T\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
- Returns:
(
ndarray
[\(m,d_y\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- grad_x(x, *args, **kwargs)[source]¶
[Abstract] Evaluate the gradient \(\nabla_{\bf x}T\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
- Returns:
(
ndarray
[\(m,d_y,d_x\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- tuple_grad_x(x, *args, **kwargs)[source]¶
[Abstract] Evaluate the function and gradient.
- Parameters:
- Returns:
(
tuple
) – function and gradient evaluation- Raises:
NotImplementedError – to be implemented in sub-classes
- hess_x(x, *args, **kwargs)[source]¶
[Abstract] Evaluate the Hessian \(\nabla^2_{\bf x}T\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
- Returns:
(
ndarray
[\(m,d_y,d_x,d_x\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- action_hess_x(x, dx, *args, **kwargs)[source]¶
[Abstract] Evaluate the action of the Hessian \(\langle\nabla^2_{\bf x}T,\delta{\bf x}\rangle\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).
- Parameters:
x (
ndarray
[\(m,d_x\)]) – evaluation pointsdx (
ndarray
[\(m,d_x\)]) – direction on which to evaluate the Hessianprecomp (
dict
) – dictionary of precomputed valuesidxs_slice (slice) – if precomputed values are present, this parameter indicates at which of the points to evaluate. The number of indices represented by
idxs_slice
must matchx.shape[0]
.
- Returns:
(
ndarray
[\(m,d_y,d_x\)]) – transformed points- Raises:
NotImplementedError – to be implemented in sub-classes
- class TransportMaps.Distributions.Examples.Lorenz96.Lorenz96Distributions.Lorenz96ForwardEulerMap(dt, d=40, K=1, F=8.0)[source]¶
Bases:
TransportMaps.Maps.ODEs.AutonomousForwardEulerMap
Defines the evolution of the Lorenz-96 dynamics for one forward Euler step.
Evaluates the Euler step of the Lorenz-96 system:
\[\dot{x}_i^{(n+1)} = x_i^{(n)} + \Delta t \cdot (x_{i+1}^{(n)} - x_{i-2}^{(n)}) x_{i-1}^{(n)} / K^2 - x_{i}^{(n)} + F\]
- class TransportMaps.Distributions.Examples.Lorenz96.Lorenz96Distributions.Lorenz96MultipleStepsForwardEulerMap(n, dt, d=40, K=1, F=8.0)[source]¶
Bases:
TransportMaps.Maps.ListCompositeMap
Defines the evolution of the Lorenz-96 dynamics for \(n\) forward Euler steps.
Evaluates \(n\) times the Euler step of the Lorenz-96 system:
\[\dot{x}_i^{(k)} \mapsto x_i^{(k)} + \Delta t \cdot (x_{i+1}^{(k)} - x_{i-2}^{(k)}) x_{i-1}^{(k)} / K^2 - x_{i}^{(k)} + F\]
- class TransportMaps.Distributions.Examples.Lorenz96.Lorenz96Distributions.Lorenz96ForwardEulerDistribution(n, dt, d, K, F, pi_init, pi_dyn, obs_map, pi_noise)[source]¶
-
Defines the Hidden Markov Chain distribution defined by the Lorenz-96 dynamics.
For the index sets \(\Lambda={in : i=0,\ldots}\) and \(\Xi \subset \Lambda\) the model is defined by
\[\begin{split}\begin{cases} {\bf x}_{k+n} = g({\bf x}_k) + \varepsilon_{\text{dyn}} & \text{for } k \in \Lambda \\ {\bf y}_{k+n} &= h({\bf x}_{k+n}) + \varepsilon_{\text{noise}} & \text{for } k+n \in \Xi \;, \end{cases}\end{split}\]where \(g:{\bf x}_k \mapsto {\bf x}_{k+n}\) is the map corresponding to \(n\) Euler steps of the discretized dynamics with time step \(\Delta t\), \(h\) is the observation operator, \(\varepsilon_{\text{dyn}} \sim \pi_{\text{dyn}}\) is the dynamics noise, \(\varepsilon_{\text{noise}} \sim \pi_{\text{noise}}\) is the observational noise and the initial conditions \({\bf x}_0\) are distributed according to \(\pi_{\text{init}}\).
- class TransportMaps.Distributions.Examples.Lorenz96.Lorenz96Distributions.Lorenz96ModalForwardEulerDistribution(n, dt, d, K, F, modal_map, pi_init, pi_dyn, obs_map, pi_noise)[source]¶
Bases:
Lorenz96ForwardEulerDistribution
Defines the Hidden Markov Chain distribution defined by the Lorenz-96 dynamics in modal form.
For the index sets \(\Lambda={in : i=0,\ldots}\) and \(\Xi \subset \Lambda\) the model is defined by
\[\begin{split}\begin{cases} {\bf b}_{k+n} = P_r^{-1} \circ g \circ P_r({\bf b}_k) + \varepsilon^r_{\text{dyn}} & \text{for } k \in \Lambda \\ {\bf y}_{k+n} &= h\circ P_r({\bf b}_{k+n}) + \varepsilon_{\text{noise}} & \text{for } k+n \in \Xi \;, \end{cases}\end{split}\]where \(g:{\bf x}_k \mapsto {\bf x}_{k+n}\) is the map corresponding to \(n\) Euler steps of the discretized dynamics with time step \(\Delta t\), \(P_r:\mathbb{R}^d\rightarrow\mathbb{R}^r\) is a projection operator onto the modal subspace (\(r\leq d\)), \(h\) is the observation operator, \(\varepsilon^r_{\text{dyn}} \sim \pi^r_{\text{dyn}}\) is the noise of the modal dynamics, \(\varepsilon_{\text{noise}} \sim \pi_{\text{noise}}\) is the observational noise and the initial conditions \({\bf b}_0\) are distributed according to \(\pi^r_{\text{init}}\).