Skip to content

Commit

Permalink
Convert citations
Browse files Browse the repository at this point in the history
  • Loading branch information
patnr committed Oct 30, 2024
1 parent 4e2d429 commit f63d687
Show file tree
Hide file tree
Showing 42 changed files with 82 additions and 82 deletions.
2 changes: 1 addition & 1 deletion dapper/da_methods/baseline.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Unsophisticated" but robust (widely applicable) DA methods.
Many are based on `bib.raanes2016thesis`.
Many are based on [raanes2016thesis][].
"""

from typing import Callable, Optional
Expand Down
28 changes: 14 additions & 14 deletions dapper/da_methods/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ens_method:
class EnKF:
"""The ensemble Kalman filter.
Refs: `bib.evensen2009ensemble`.
Refs: [evensen2009ensemble][].
"""

upd_a: str
Expand Down Expand Up @@ -67,8 +67,8 @@ def EnKF_analysis(E, Eo, hnoise, y, upd_a, stats=None, ko=None):
This implementation includes several flavours and forms,
specified by `upd_a`.
Main references: `bib.sakov2008deterministic`,
`bib.sakov2008implications`, `bib.hoteit2015mitigating`
Main references: [sakov2008deterministic][],
[sakov2008implications][], [hoteit2015mitigating][]
"""
R = hnoise.C # Obs noise cov
N, Nx = E.shape # Dimensionality
Expand Down Expand Up @@ -261,7 +261,7 @@ def post_process(E, infl, rot):
def add_noise(E, dt, noise, method):
"""Treatment of additive noise for ensembles.
Refs: `bib.raanes2014ext`
Refs: [raanes2014ext][]
"""
if noise.C == 0:
return E
Expand Down Expand Up @@ -354,7 +354,7 @@ def sqrt_core():
class EnKS:
"""The ensemble Kalman smoother.
Refs: `bib.evensen2009ensemble`
Refs: [evensen2009ensemble][]
The only difference to the EnKF
is the management of the lag and the reshapings.
Expand Down Expand Up @@ -414,7 +414,7 @@ def assimilate(self, HMM, xx, yy):
class EnRTS:
"""EnRTS (Rauch-Tung-Striebel) smoother.
Refs: `bib.raanes2016thesis`
Refs: [raanes2016thesis][]
"""

upd_a: str
Expand Down Expand Up @@ -484,7 +484,7 @@ def serial_inds(upd_a, y, cvR, A):
class SL_EAKF:
"""Serial, covariance-localized EAKF.
Refs: `bib.karspeck2007experimental`.
Refs: [karspeck2007experimental][].
In contrast with LETKF, this iterates over the observations rather
than over the state (batches).
Expand Down Expand Up @@ -614,7 +614,7 @@ def local_analysis(ii):
class LETKF:
"""Same as EnKF (Sqrt), but with localization.
Refs: `bib.hunt2007efficient`.
Refs: [hunt2007efficient][].
NB: Multiproc. yields slow-down for [`mods.Lorenz96`][],
even with `batch_size=(1,)`. But for [`mods.QG`][]
Expand Down Expand Up @@ -778,7 +778,7 @@ def hyperprior_coeffs(s, N, xN=1, g=0):
- Reason 1: mode correction.
These parameters bridge the Jeffreys (`xN=1`) and Dirac (`xN=Inf`) hyperpriors
for the prior covariance, B, as discussed in `bib.bocquet2015expanding`.
for the prior covariance, B, as discussed in [bocquet2015expanding][].
Indeed, mode correction becomes necessary when $$ R \rightarrow \infty $$
because then there should be no ensemble update (and also no inflation!).
More specifically, the mode of `l1`'s should be adjusted towards 1
Expand All @@ -790,7 +790,7 @@ def hyperprior_coeffs(s, N, xN=1, g=0):
- Reason 2: Boosting the inflation prior's certainty from N to xN*N.
The aim is to take advantage of the fact that the ensemble may not
have quite as much sampling error as a fully stochastic sample,
as illustrated in section 2.1 of `bib.raanes2019adaptive`.
as illustrated in section 2.1 of [raanes2019adaptive][].
- Its damping effect is similar to work done by J. Anderson.
Expand All @@ -809,7 +809,7 @@ def hyperprior_coeffs(s, N, xN=1, g=0):
eN = (N + 1) / N
cL = (N + g) / N1

# Mode correction (almost) as in eqn 36 of `bib.bocquet2015expanding`
# Mode correction (almost) as in eqn 36 of [bocquet2015expanding][]
prior_mode = eN / cL # Mode of l1 (before correction)
diagonal = pad0(s**2, N) + N1 # diag of [email protected]@Y + N1*I
# (Hessian of J)
Expand Down Expand Up @@ -847,7 +847,7 @@ def zeta_a(eN, cL, w):
class EnKF_N:
"""Finite-size EnKF (EnKF-N).
Refs: `bib.bocquet2011ensemble`, `bib.bocquet2015expanding`
Refs: [bocquet2011ensemble][], [bocquet2015expanding][]
This implementation is pedagogical, prioritizing the "dual" form.
In consequence, the efficiency of the "primal" form suffers a bit.
Expand Down Expand Up @@ -985,7 +985,7 @@ def nvrs(w):
# l1 = 1.0

# Explicitly inflate prior
# => formulae look different from `bib.bocquet2015expanding`.
# => formulae look different from [bocquet2015expanding][].
A *= l1
Y *= l1

Expand All @@ -1000,7 +1000,7 @@ def nvrs(w):
else:
# Also include angular-radial co-dependence.
# Note: denominator not squared coz
# unlike `bib.bocquet2015expanding` we have inflated Y.
# unlike [bocquet2015expanding][] we have inflated Y.
Hw = (
Y @ R.inv @ Y.T / N1
+ eye(N)
Expand Down
6 changes: 3 additions & 3 deletions dapper/da_methods/other.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class RHF:
"""Rank histogram filter.
Refs: `bib.anderson2010non`.
Refs: [anderson2010non][].
Quick & dirty implementation without attention to (de)tails.
"""
Expand Down Expand Up @@ -86,9 +86,9 @@ def assimilate(self, HMM, xx, yy):
class LNETF:
"""The Nonlinear-Ensemble-Transform-Filter (localized).
Refs: `bib.wiljes2016second`, `bib.todter2015second`.
Refs: [wiljes2016second][], [todter2015second][].
It is (supposedly) a deterministic upgrade of the NLEAF of `bib.lei2011moment`.
It is (supposedly) a deterministic upgrade of the NLEAF of [lei2011moment][].
"""

N: int
Expand Down
14 changes: 7 additions & 7 deletions dapper/da_methods/particle.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class particle_method:
class PartFilt:
r"""Particle filter ≡ Sequential importance (re)sampling SIS (SIR).
Refs: `bib.wikle2007bayesian`, `bib.van2009particle`, `bib.chen2003bayesian`
Refs: [wikle2007bayesian][], [van2009particle][], [chen2003bayesian][]
This is the bootstrap version: the proposal density is just
Expand All @@ -37,7 +37,7 @@ class PartFilt:
- qroot: "Inflate" (anneal) the proposal noise kernels
by this root to increase diversity.
The weights are updated to maintain un-biased-ness.
See `bib.chen2003bayesian`, section VI-M.2
See [chen2003bayesian][], section VI-M.2
"""

N: int
Expand Down Expand Up @@ -92,7 +92,7 @@ def assimilate(self, HMM, xx, yy):
class OptPF:
"""'Optimal proposal' particle filter, also known as 'Implicit particle filter'.
Ref: `bib.bocquet2010beyond`.
Ref: [bocquet2010beyond][].
!!! note Regularization (`Qs`) is here added BEFORE Bayes' rule.
If `Qs==0`: OptPF should be equal to the bootstrap filter `PartFilt`.
Expand Down Expand Up @@ -520,7 +520,7 @@ def mask_unique_of_sorted(idx):
def auto_bandw(N, M):
"""Optimal bandwidth (not bandwidth^2), as per Scott's rule-of-thumb.
Refs: `bib.doucet2001sequential` section 12.2.2, [Wik17]_ section "Rule_of_thumb"
Refs: [doucet2001sequential][] section 12.2.2, [Wik17]_ section "Rule_of_thumb"
"""
return N ** (-1 / (M + 4))

Expand All @@ -534,7 +534,7 @@ def regularize(C12, E, idx, no_uniq_jitter):
(so-named because Dirac-deltas are approximated Gaussian kernels),
which controls the strength of the jitter.
This causes a bias. But, as N-->∞, the reg. bandwidth-->0, i.e. bias-->0.
Ref: `bib.doucet2001sequential`, section 12.2.2.
Ref: [doucet2001sequential][], section 12.2.2.
"""
# Select
E = E[idx]
Expand All @@ -554,7 +554,7 @@ def regularize(C12, E, idx, no_uniq_jitter):
def resample(w, kind="Systematic", N=None, wroot=1.0):
"""Multinomial resampling.
Refs: `bib.doucet2009tutorial`, `bib.van2009particle`, `bib.liu2001theoretical`.
Refs: [doucet2009tutorial][], [van2009particle][], [liu2001theoretical][].
- kind: 'Systematic', 'Residual' or 'Stochastic'.
'Stochastic' corresponds to `rng.choice` or `rng.multinomial`.
Expand All @@ -571,7 +571,7 @@ def resample(w, kind="Systematic", N=None, wroot=1.0):
- wroot: Adjust weights before resampling by this root to
promote particle diversity and mitigate thinning.
The outcomes of the resampling are then weighted to maintain un-biased-ness.
Ref: `bib.liu2001theoretical`, section 3.1
Ref: [liu2001theoretical][], section 3.1
Note: (a) resampling methods are beneficial because they discard
low-weight ("doomed") particles and reduce the variance of the weights.
Expand Down
18 changes: 9 additions & 9 deletions dapper/da_methods/variational.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class var_method:
class iEnKS:
"""Iterative EnKS.
Special cases: EnRML, ES-MDA, iEnKF, EnKF `bib.raanes2019revising`.
Special cases: EnRML, ES-MDA, iEnKF, EnKF [raanes2019revising][].
As in `bib.bocquet2014iterative`, optimization uses Gauss-Newton.
See `bib.bocquet2012combining` for Levenberg-Marquardt.
As in [bocquet2014iterative][], optimization uses Gauss-Newton.
See [bocquet2012combining][] for Levenberg-Marquardt.
If MDA=True, then there's not really any optimization,
but rather Gaussian annealing.
Expand All @@ -41,13 +41,13 @@ class iEnKS:
- "Sqrt" : as in ETKF , using a deterministic matrix square root transform.
- "PertObs": as in EnRML , using stochastic, perturbed-observations.
- "Order1" : as in DEnKF of `bib.sakov2008deterministic`.
- "Order1" : as in DEnKF of [sakov2008deterministic][].
Lag:
Length of the DA window (DAW, multiples of dko, i.e. cycles).
- Lag=1 (default) => iterative "filter" iEnKF `bib.sakov2012iterative`.
- Lag=0 => maximum-likelihood filter `bib.zupanski2005maximum`.
- Lag=1 (default) => iterative "filter" iEnKF [sakov2012iterative][].
- Lag=0 => maximum-likelihood filter [zupanski2005maximum][].
Shift : How far (in cycles) to slide the DAW.
Fixed at 1 for code simplicity.
Expand All @@ -60,7 +60,7 @@ class iEnKS:
Recommended: 1e-5.
MDA : Use iterations of the "multiple data assimlation" type.
Ref `bib.emerick2012history`
Ref [emerick2012history][]
bundle: Use finite-diff. linearization instead of of least-squares regression.
Makes the iEnKS very much alike the iterative, extended KF (IEKS).
Expand All @@ -70,8 +70,8 @@ class iEnKS:
Total number of model simulations (of duration dto): N * (nIter*Lag + 1).
(due to boundary cases: only asymptotically valid)
Refs: `bib.bocquet2012combining`, `bib.bocquet2013joint`,
`bib.bocquet2014iterative`.
Refs: [bocquet2012combining][], [bocquet2013joint][],
[bocquet2014iterative][].
"""

upd_a: str
Expand Down
2 changes: 1 addition & 1 deletion dapper/mods/KS/bocquet2019.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Settings as in `bib.bocquet2019consistency`."""
"""Settings as in [bocquet2019consistency][]."""

import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion dapper/mods/LA/evensen2009.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""A mix of `bib.evensen2009ensemble` and `bib.sakov2008implications`.
"""A mix of [evensen2009ensemble][] and [sakov2008implications][].
!!! note
Since there is no noise, and the system is stable,
Expand Down
2 changes: 1 addition & 1 deletion dapper/mods/LA/raanes2015.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Reproduce results from Fig. 2 of `bib.raanes2014ext`."""
"""Reproduce results from Fig. 2 of [raanes2014ext][]."""

import numpy as np

Expand Down
8 changes: 4 additions & 4 deletions dapper/mods/Lorenz05/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""A multi-scale, smooth version of the classic Lorenz-96.
This is an implementation of "Model III" of `bib.lorenz2005designing`.
This is an implementation of "Model III" of [lorenz2005designing][].
Similar to [`mods.LorenzUV`][] this model is designed
to contain two different scales. However, in "Model III"
Expand Down Expand Up @@ -111,7 +111,7 @@ def step(self, E, t, dt):


def summation_kernel(width):
"""Prepare computation of the modified sum in `bib.lorenz2005designing`.
"""Prepare computation of the modified sum in [lorenz2005designing][].
Note: This gets repeatedly called, but actually the input is only ever
`width = K` or `2*J`, so we should really cache or pre-compute.
Expand All @@ -131,7 +131,7 @@ def boxcar(x, n, method="direct"):
For symmetry, if `n` is pair, the actual number of elements used is `n+1`,
and the outer elements weighted by `0.5` to compensate for the `+1`.
This is the modified sum of `bib.lorenz2005designing`, used e.g. in eqn. 9.
This is the modified sum of [lorenz2005designing][], used e.g. in eqn. 9.
For intuition: this type of summation (and the associated Sigma prime notation)
may also be found for the "Trapezoidal rule" and in the inverse DFT used in
spectral methods on a periodic domain.
Expand Down Expand Up @@ -216,7 +216,7 @@ def shift(x, k):


def prodsum_self(x, k):
"""Compute `prodsum(x, x, k)` efficiently: eqn 10 of `bib.lorenz2005designing`."""
"""Compute `prodsum(x, x, k)` efficiently: eqn 10 of [lorenz2005designing][]."""
W = boxcar(x, k)
WW = shift(W, -2 * k) * shift(W, -k)
WX = shift(W, -k) * shift(x, k)
Expand Down
2 changes: 1 addition & 1 deletion dapper/mods/Lorenz63/anderson2010rhf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Settings from `bib.anderson2010non`."""
"""Settings from [anderson2010non][]."""

import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion dapper/mods/Lorenz63/bocquet2012.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Reproduce results from Fig 11 of `bib.bocquet2012combining`."""
"""Reproduce results from Fig 11 of [bocquet2012combining][]."""

import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion dapper/mods/Lorenz63/mandel2016.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Settings from `bib.mandel2016hybrid`."""
"""Settings from [mandel2016hybrid][]."""

import dapper.mods as modelling
from dapper.mods.Lorenz63.sakov2012 import HMM as _HMM
Expand Down
2 changes: 1 addition & 1 deletion dapper/mods/Lorenz63/sakov2012.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Reproduce results from Table 1 `bib.sakov2012iterative`."""
"""Reproduce results from Table 1 [sakov2012iterative][]."""

import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion dapper/mods/Lorenz63/wiljes2017.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Settings from `bib.wiljes2016second`."""
"""Settings from [wiljes2016second][]."""

import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion dapper/mods/Lorenz84/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""A chaotic system of size 3, like Lorenz-63, but with +complex geometry.
Refs: `bib.lorenz1984irregularity`, `bib.lorenz2005look`
Refs: [lorenz1984irregularity][], [lorenz2005look][]
"""

import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion dapper/mods/Lorenz84/pajonk2012.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Settings from `bib.pajonk2012deterministic`.
"""Settings from [pajonk2012deterministic][].
There is nothing to reproduce from the paper as there are no
statistically converged numbers.
Expand Down
2 changes: 1 addition & 1 deletion dapper/mods/Lorenz96/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""A 1D emulator of chaotic atmospheric behaviour.
`bib.lorenz1996predictability`
[lorenz1996predictability][]
For a short introduction, see
Expand Down
2 changes: 1 addition & 1 deletion dapper/mods/Lorenz96/anderson2009.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""A land-ocean setup from `bib.anderson2009spatially`."""
"""A land-ocean setup from [anderson2009spatially][]."""

import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion dapper/mods/Lorenz96/bocquet2010.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""From Fig. 1 of `bib.bocquet2010beyond`."""
"""From Fig. 1 of [bocquet2010beyond][]."""

import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion dapper/mods/Lorenz96/bocquet2010_m40.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""From `bib.bocquet2010beyond` (again), but `ndim=40` (i.e. Fig. 5 of paper)."""
"""From [bocquet2010beyond][] (again), but `ndim=40` (i.e. Fig. 5 of paper)."""

import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion dapper/mods/Lorenz96/bocquet2015loc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Settings as in `bib.bocquet2016localization`."""
"""Settings as in [bocquet2016localization][]."""

import numpy as np

Expand Down
Loading

0 comments on commit f63d687

Please sign in to comment.