Example #1
0
# NB: Since there is no noise, and the system is stable,
#     the benchmarks obtained from this configuration
#     - go to zero as T-->infty
#     - are highly dependent on the initial error.

from common import *

from mods.LA.core import Fmat, homogeneous_1D_cov

tseq = Chronology(dt=1, dkObs=5, T=300, BurnIn=-1)

m = 100

#def step(x,t,dt):
#return np.roll(x,1,axis=x.ndim-1)
Fm = Fmat(m, -1, 1, tseq.dt)


def step(x, t, dt):
    assert dt == tseq.dt
    return x @ Fm.T


f = {'m': m, 'model': step, 'noise': 0}

X0 = GaussRV(C=homogeneous_1D_cov(m, m / 8, kind='Gauss'))

p = 4
jj = equi_spaced_integers(m, p)
h = partial_direct_obs_setup(m, jj)
h['noise'] = 0.01
Example #2
0
from common import *

from mods.LA.core import sinusoidal_sample, Fmat
from mods.Lorenz95.core import LPs

Nx = 1000
Ny = 4
jj = equi_spaced_integers(Nx,Ny)

tseq = Chronology(dt=1,dkObs=5,T=300,BurnIn=-1,Tplot=100)

# WITHOUT explicit matrix (assumes dt == dx/c):
# step = lambda x,t,dt: np.roll(x,1,axis=x.ndim-1)
# WITH:
Fm = Fmat(Nx,c=-1,dx=1,dt=tseq.dt)
def step(x,t,dt):
  assert dt == tseq.dt
  return x @ Fm.T

Dyn = {
    'M'    : Nx,
    'model': step,
    'jacob': Fm,
    'noise': 0
    }

# In the animation, it can sometimes/somewhat occur
# that the truth is outside 3*sigma !!!
# Yet this is not so implausible because sinusoidal_sample()
# yields (multivariate) uniform (random numbers) -- not Gaussian.
Example #3
0
# Smaller version.
# => convenient for debugging, e.g., scripts/test_iEnKS.py

from common import *

from mods.LA.core import Fmat, homogeneous_1D_cov
from mods.Lorenz95.core import LPs

tseq = Chronology(dt=1, dkObs=5, T=300, BurnIn=-1, Tplot=100)

Nx = 100

# def step(x,t,dt):
# return np.roll(x,1,axis=x.ndim-1)
Fm = Fmat(Nx, -1, 1, tseq.dt)


def step(x, t, dt):
    assert dt == tseq.dt
    return x @ Fm.T


Dyn = {'M': Nx, 'model': step, 'noise': 0}

X0 = GaussRV(C=homogeneous_1D_cov(Nx, Nx / 8, kind='Gauss'))

Ny = 4
jj = equi_spaced_integers(Nx, Ny)
Obs = partial_direct_Obs(Nx, jj)
Obs['noise'] = 0.01
Example #4
0
#     and so these absolute rmse values are not so useful
#     for quantatative evaluation of DA methods.
#     For that purpose, see mods/LA/raanes2015.py instead.

from common import *

from mods.LA.core import sinusoidal_sample, Fmat
from mods.Lorenz95.liveplotting import LP_setup

m = 1000
p = 4
jj = equi_spaced_integers(m,p)

tseq = Chronology(dt=1,dkObs=5,T=300,BurnIn=-1)

Fm = Fmat(m,c=-1,dx=1,dt=tseq.dt)
def step(x,t,dt):
  assert dt == tseq.dt
  return x @ Fm.T

# WITHOUT explicit matrix (assumes dt == dx/c):
# step = lambda x,t,dt: np.roll(x,1,axis=x.ndim-1)

f = {
    'm'    : m,
    'model': step,
    'jacob': Fm,
    'noise': 0
    }

# In the animation, it can sometimes/somewhat occur