Linear model¶
LinearModel advances reduced coordinates with a linear map and optional process noise,
which makes it useful for Kalman-filter examples and baseline forecasts.
romda.models.data_driven.linear_model.LinearModel(F, M_obs=None, psi0=None, dt=1.0, Q=None, **model_dict)
¶
Bases: Model
Simple linear state-space forecast model.
where \(\mathbf{F}\) is the \((N_\phi \times N_\phi)\) state transition matrix and
\(\boldsymbol{\eta}_t \sim \mathcal{N}(\mathbf{0}, \mathbf{Q})\) is optional
zero-mean Gaussian process noise with covariance \(\mathbf{Q}\) (Q_noise).
Uses DiscreteIntegrator (a fixed-step map), so it only requires a time_step
method instead of a continuous time_derivative.
Build a LinearModel from a fixed state transition matrix F.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
F
|
ndarray
|
State transition matrix, shape |
required |
M_obs
|
ndarray
|
Observation (measurement) operator, shape |
None
|
psi0
|
ndarray
|
Initial state, shape |
None
|
dt
|
float
|
Time step. Default 1.0. |
1.0
|
Q
|
ndarray
|
Process noise covariance |
None
|
**model_dict
|
Additional |
{}
|
Raises:
| Type | Description |
|---|---|
AssertionError
|
If |
Source code in src/models/data_driven/linear_model.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
state_labels
property
¶
list of str: LaTeX labels for the state vector, \(x_0, \dots, x_{N_\phi-1}\).
obs_labels
property
¶
list of str: LaTeX labels for the observed outputs, \(y_0, \dots, y_{N_q-1}\).
time_step(Nt)
¶
Propagate the state forward Nt steps,
\(\boldsymbol{\psi}_{k+1} = \mathbf{F}\boldsymbol{\psi}_k + \boldsymbol{\eta}_k\)
with \(\boldsymbol{\eta}_k \sim \mathcal{N}(\mathbf{0}, \mathbf{Q})\) added if
Q_noise is non-zero.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Nt
|
int
|
Number of steps to propagate. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
psi_out |
ndarray
|
State trajectory, shape |
t_out |
ndarray
|
Corresponding time points, shape |
Source code in src/models/data_driven/linear_model.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
get_observables(Nt=1, **kwargs)
¶
Map the trailing states to observables, \(\mathbf{y} = \mathbf{M}_\mathrm{obs}\boldsymbol{\psi}\).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Nt
|
int
|
Number of trailing time steps to return (same convention as
|
1
|
**kwargs
|
Unused; accepted for interface compatibility. |
{}
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Observed outputs, shape |
Source code in src/models/data_driven/linear_model.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |