dapper.mods.Lorenz96.frei2013bridging

Settings as in bib.frei2013bridging.

They also cite its use in the following:

bib.bengtsson2003toward, bib.lei2011moment, bib.frei2013mixture.

 1"""Settings as in `bib.frei2013bridging`.
 2
 3They also cite its use in the following:
 4
 5`bib.bengtsson2003toward`, `bib.lei2011moment`, `bib.frei2013mixture`.
 6"""
 7
 8import numpy as np
 9
10import dapper.mods as modelling
11from dapper.mods.Lorenz96 import dstep_dx, step
12from dapper.tools.localization import nd_Id_localization
13
14t = modelling.Chronology(0.05, dto=0.4, T=4**5, BurnIn=20)
15
16Nx = 40
17Dyn = {
18    "M": Nx,
19    "model": step,
20    "linear": dstep_dx,
21    "noise": 0,
22}
23
24X0 = modelling.GaussRV(M=Nx, C=0.001)
25
26jj = 1 + np.arange(0, Nx, 2)
27Obs = modelling.partial_Id_Obs(Nx, jj)
28Obs["noise"] = 0.5
29Obs["localizer"] = nd_Id_localization((Nx,), (2,), jj)
30
31HMM = modelling.HiddenMarkovModel(Dyn, Obs, t, X0)
32
33
34####################
35# Suggested tuning
36####################
37# Compare to Table 1 and 3 from frei2013bridging. Note:
38#  - N is too large to be very interesting.
39#  - We obtain better EnKF scores than they report,
40#    and use inflation and sqrt updating,
41#    and don't really need localization.
42# from dapper.mods.Lorenz96.frei2013bridging import HMM     # rmse.a
43# xps += EnKF_N(N=400,rot=1)                                # 0.80
44# xps += LETKF( N=400,rot=True,infl=1.01,loc_rad=10/1.82)   # 0.79 # short xp. only
45# xps += Var3D()                                            # 2.42 # short xp. only
t = <Chronology> - K: 20480 - Ko: 2559 - T: 1024.0 - BurnIn: 20 - dto: 0.4 - dt: 0.05
Nx = 40
Dyn = {'M': 40, 'model': <function step>, 'linear': <function dstep_dx>, 'noise': 0}
X0 = GaussRV({ 'C': <CovMat> M: 40 kind: 'diag' trunc: 1.0 rk: 40 full: (only computing/printing corners) [[0.001 0. 0. ... 0. 0. 0. ] [0. 0.001 0. ... 0. 0. 0. ] [0. 0. 0.001 ... 0. 0. 0. ] ... [0. 0. 0. ... 0.001 0. 0. ] [0. 0. 0. ... 0. 0.001 0. ] [0. 0. 0. ... 0. 0. 0.001]] diag: [0.001 0.001 0.001 ... 0.001 0.001 0.001], 'mu': array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]), 'M': 40 })
jj = array([ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39])
Obs = {'M': 20, 'model': Direct obs. at [ 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39] <function partial_Id_Obs.<locals>.model>, 'linear': Constant matrix [[0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0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0. 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 0. 0.] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1.]] <function partial_Id_Obs.<locals>.linear>, 'noise': 0.5, 'localizer': <function localization_setup.<locals>.localization_now>}
HMM = HiddenMarkovModel({ 'Dyn': Operator({ 'M': 40, 'model': <function step>, 'noise': GaussRV({ 'mu': array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]), 'M': 40, 'C': 0 }), 'linear': <function dstep_dx> }), 'Obs': <TimeDependentOperator> CONSTANT operator sepcified by .Op1: Operator({ 'M': 20, 'model': Direct obs. at [ 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39] <function partial_Id_Obs.<locals>.model>, 'noise': GaussRV({ 'C': <CovMat> M: 20 kind: 'diag' trunc: 1.0 rk: 20 full: [[0.5 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ] [0. 0.5 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ] [0. 0. 0.5 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ] [0. 0. 0. 0.5 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ] [0. 0. 0. 0. 0.5 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ] [0. 0. 0. 0. 0. 0.5 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ] [0. 0. 0. 0. 0. 0. 0.5 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ] [0. 0. 0. 0. 0. 0. 0. 0.5 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ] [0. 0. 0. 0. 0. 0. 0. 0. 0.5 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0.5 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.5 0. 0. 0. 0. 0. 0. 0. 0. 0. ] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.5 0. 0. 0. 0. 0. 0. 0. 0. ] [0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.5 0. 0. 0. 0. 0. 0. 0. ] [0. 0. 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- BurnIn: 20 - dto: 0.4 - dt: 0.05, 'X0': GaussRV({ 'C': <CovMat> M: 40 kind: 'diag' trunc: 1.0 rk: 40 full: (only computing/printing corners) [[0.001 0. 0. ... 0. 0. 0. ] [0. 0.001 0. ... 0. 0. 0. ] [0. 0. 0.001 ... 0. 0. 0. ] ... [0. 0. 0. ... 0.001 0. 0. ] [0. 0. 0. ... 0. 0.001 0. ] [0. 0. 0. ... 0. 0. 0.001]] diag: [0.001 0.001 0.001 ... 0.001 0.001 0.001], 'mu': array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]), 'M': 40 }), 'liveplotters': [], 'sectors': {}, 'name': 'Lorenz96/frei2013bridging.py' })