TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace

Module Contents

Classes

Coradia175Vehicle

param v:

Longitudinal vehicle velocity (m/s)

ParametersPrior

Multivariate Gaussian distribution \(\mathcal{N}(\mu,\Sigma)\)

StateSpacePrior

Multivariate Gaussian distribution \(\pi({\bf x}\vert{\bf y}) \sim \mathcal{N}(\mu({\bf y}), \Sigma({\bf y}))\)

DynamicsMap

Abstract map \(T:\mathbb{R}^{d_x}\rightarrow\mathbb{R}^{d_y}\)

NoiseDynamicsMap

Abstract map \(T:\mathbb{R}^{d_x}\rightarrow\mathbb{R}^{d_y}\)

StateSpaceTransition

Transition probability distribution \(g(\theta,{\bf x}_{k-1},{\bf x}_k) = \pi_{{\bf X}_k \vert {\bf X}_{k-1}={\bf x}_{k-1}}({\bf x}_k, \Theta=\theta) = \pi({\bf x}_k - F_k(\theta) {\bf x}_{k-1} - {\bf c}_k(\theta))\) where \(\pi \sim \mathcal{N}(\mu_k(\theta),Q_k(\theta))\).

ObservationSystemMap

Abstract map \(T:\mathbb{R}^{d_x}\rightarrow\mathbb{R}^{d_y}\)

StateSpaceLogLikelihood

Define the log-likelihood for the additive linear Gaussian model

Functions

generate_data(nsteps, vehicle[, par_name_list, ...])

Attributes

Yw1

Yw1dot

Pw1

Pw1dot

Yw2

Yw2dot

Pw2

Pw2dot

Yb

Ybdot

Pb

Pbdot

Yc

Ycdot

D1

D2

DEFAULTS

TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.Yw1[source]
TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.Yw1dot[source]
TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.Pw1[source]
TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.Pw1dot[source]
TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.Yw2[source]
TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.Yw2dot[source]
TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.Pw2[source]
TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.Pw2dot[source]
TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.Yb[source]
TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.Ybdot[source]
TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.Pb[source]
TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.Pbdot[source]
TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.Yc[source]
TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.Ycdot[source]
TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.D1[source]
TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.D2[source]
TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.DEFAULTS[source]
class TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.Coradia175Vehicle(v, observables=[Ybdot, Pb, Ycdot], dt=0.01, Ar=2 * 0.33 * 1e-06, init_noise=1e-06, obs_noise={'Yw1dot': 0.0001 * 10.0, 'Yw2dot': 0.0001 * 10.0, 'Ybdot': 4.11 * 0.0001 * 10.0, 'Pb': 3.75 * 1e-07 * 10.0, 'Ycdot': 7.62 * 0.001 * 10.0})[source]

Bases: object

Parameters:

v (float) – Longitudinal vehicle velocity (m/s)

mw = 1000.0[source]
Iw = 600.0[source]
mb = 2000.0[source]
Ib = 2300.0[source]
mc = 8720.0[source]
a = 1.05[source]
l = 0.75[source]
lmb = 0.15[source]
r0 = 0.37[source]
get_system_matrix(L_Ky=DEFAULTS['L_Ky'], T_Ky=DEFAULTS['T_Ky'], L_KPsi=DEFAULTS['L_KPsi'], T_KPsi=DEFAULTS['T_KPsi'], Kyb=DEFAULTS['Kyb'], Cyb=DEFAULTS['Cyb'], CPb=DEFAULTS['CPb'], f11=DEFAULTS['f11'], f22=DEFAULTS['f22'])[source]
get_grad_system_matrix(par_name_list, L_Ky=DEFAULTS['L_Ky'], T_Ky=DEFAULTS['T_Ky'], L_KPsi=DEFAULTS['L_KPsi'], T_KPsi=DEFAULTS['T_KPsi'], Kyb=DEFAULTS['Kyb'], Cyb=DEFAULTS['Cyb'], CPb=DEFAULTS['CPb'], f11=DEFAULTS['f11'], f22=DEFAULTS['f22'])[source]
get_track_matrix()[source]
get_grad_track_matrix(par_name_list)[source]
get_observation_matrix(L_Ky=DEFAULTS['L_Ky'], T_Ky=DEFAULTS['T_Ky'], L_KPsi=DEFAULTS['L_KPsi'], T_KPsi=DEFAULTS['T_KPsi'], Kyb=DEFAULTS['Kyb'], Cyb=DEFAULTS['Cyb'], CPb=DEFAULTS['CPb'], f11=DEFAULTS['f11'], f22=DEFAULTS['f22'])[source]
get_grad_observation_matrix(par_name_list, L_Ky=DEFAULTS['L_Ky'], T_Ky=DEFAULTS['T_Ky'], L_KPsi=DEFAULTS['L_KPsi'], T_KPsi=DEFAULTS['T_KPsi'], Kyb=DEFAULTS['Kyb'], Cyb=DEFAULTS['Cyb'], CPb=DEFAULTS['CPb'], f11=DEFAULTS['f11'], f22=DEFAULTS['f22'])[source]
get_matrices(L_Ky=DEFAULTS['L_Ky'], T_Ky=DEFAULTS['T_Ky'], L_KPsi=DEFAULTS['L_KPsi'], T_KPsi=DEFAULTS['T_KPsi'], Kyb=DEFAULTS['Kyb'], Cyb=DEFAULTS['Cyb'], CPb=DEFAULTS['CPb'], f11=DEFAULTS['f11'], f22=DEFAULTS['f22'])[source]
class TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.ParametersPrior(par_name_list)[source]

Bases: TransportMaps.Distributions.NormalDistribution

Multivariate Gaussian distribution \(\mathcal{N}(\mu,\Sigma)\)

Parameters:
  • mu (ndarray [\(d\)]) – mean vector \(\mu\)

  • covariance (ndarray [\(d,d\)]) – covariance matrix \(\Sigma\)

  • precision (ndarray [\(d,d\)]) – precision matrix \(\Sigma^{-1}\)

  • square_root_covariance (ndarray [\(d,d\)]) – square root \(\Sigma^{\frac{1}{2}}\)

  • square_root_precision (ndarray [\(d,d\)]) – square root \(\Sigma^{-\frac{1}{2}}\)

  • square_root_type (str) – type of square root to be used in case covariance or precision``were provided. For ``square_root_type=='sym', \(L=U\Lambda^{\frac{1}{2}}U^T\) where \(\Sigma = U\Lambda U^T\) is the eigenvalue decomposition of \(\Sigma\). For square_root_type=='tri' or square_root_type=='chol', :maht:`L=C` where \(\Sigma=CC^T\) is the Cholesky decomposition of \(\Sigma\). For square_root_type=='kl', \(L=U\Lambda^{\frac{1}{2}}\) where \(\Sigma = U\Lambda U^T\) is the eigenvalue decomposition of \(\Sigma\) (this corresponds to the Karuenen-Loeve expansion). The eigenvalues and eigenvectors are ordered with \(\lambda_i\geq\lambda_{i+1}\). If the parameter square_root is provided, then the square_root_type attribute will be set user.

Note

The arguments covariance, precision and square_root are mutually exclusive.

class TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.StateSpacePrior(vehicle, par_name_list=[], init_coeffs=None)[source]

Bases: TransportMaps.Distributions.ConditionallyGaussianDistribution

Multivariate Gaussian distribution \(\pi({\bf x}\vert{\bf y}) \sim \mathcal{N}(\mu({\bf y}), \Sigma({\bf y}))\)

Parameters:
  • mu (Map) – mean vector map

  • sigma (Map) – covariance matrix map

  • precision (Map) – precision matrix map

  • coeffs (ndarray) – fix the coefficients \({\bf y}\)

class TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.DynamicsMap(vehicle, par_name_list=[])[source]

Bases: TransportMaps.Maps.Map

Abstract map \(T:\mathbb{R}^{d_x}\rightarrow\mathbb{R}^{d_y}\)

Parameters:
  • dim_in (int) – input dimension

  • dim_out (int) – output dimension

evaluate(x, *args, **kwargs)[source]

[Abstract] Evaluate the map \(T\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).

Parameters:
  • x (ndarray [\(m,d_x\)]) – evaluation points

  • precomp (dict) – dictionary of precomputed values

  • idxs_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 match x.shape[0].

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:
  • x (ndarray [\(m,d_x\)]) – evaluation points

  • precomp (dict) – dictionary of precomputed values

  • idxs_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 match x.shape[0].

Returns:

(ndarray [\(m,d_y,d_x\)]) – transformed points

Raises:

NotImplementedError – to be implemented in sub-classes

class TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.NoiseDynamicsMap(vehicle, par_name_list=[])[source]

Bases: TransportMaps.Maps.Map

Abstract map \(T:\mathbb{R}^{d_x}\rightarrow\mathbb{R}^{d_y}\)

Parameters:
  • dim_in (int) – input dimension

  • dim_out (int) – output dimension

evaluate(x, *args, **kwargs)[source]

[Abstract] Evaluate the map \(T\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).

Parameters:
  • x (ndarray [\(m,d_x\)]) – evaluation points

  • precomp (dict) – dictionary of precomputed values

  • idxs_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 match x.shape[0].

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:
  • x (ndarray [\(m,d_x\)]) – evaluation points

  • precomp (dict) – dictionary of precomputed values

  • idxs_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 match x.shape[0].

Returns:

(ndarray [\(m,d_y,d_x\)]) – transformed points

Raises:

NotImplementedError – to be implemented in sub-classes

class TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.StateSpaceTransition(vehicle, par_name_list=[], init_coeffs=None)[source]

Bases: TransportMaps.Distributions.Decomposable.LinearGaussianSequentialInferenceDistributions.ConditionallyLinearGaussianAR1TransitionDistribution

Transition probability distribution \(g(\theta,{\bf x}_{k-1},{\bf x}_k) = \pi_{{\bf X}_k \vert {\bf X}_{k-1}={\bf x}_{k-1}}({\bf x}_k, \Theta=\theta) = \pi({\bf x}_k - F_k(\theta) {\bf x}_{k-1} - {\bf c}_k(\theta))\) where \(\pi \sim \mathcal{N}(\mu_k(\theta),Q_k(\theta))\).

This represents the following Markov transition model:

\[\begin{split}{\bf x}_k = c_k + F_k {\bf x}_{k-1} + {\bf w}_k \\ {\bf w}_k \sim \mathcal{N}(\mu,Q_k)\end{split}\]

where the control \({\bf c}_k := B_k {\bf u}_k\) can be used for control purposes

Parameters:
  • ck (ndarray [\(d\)] or Map) – constant part or map returning the constant part given some parameters

  • Fk (ndarray [\(d,d\)] or Map) – state transition matrix (dynamics) or map returning the linear part given some parametrs

  • mu (ndarray [\(d\)] or Map) – mean \(\mu_k\) or parametric map for \(\mu_k(\theta)\)

  • covariance (ndarray [\(d,d\)] or Map) – covariance \(Q_k\) or parametric map for \(Q_k(\theta)\)

  • precision (ndarray [\(d,d\)] or Map) – precision \(Q_k^{-1}\) or parametric map for \(Q_k^{-1}(\theta)\)

  • coeffs (ndarray) – fixing the coefficients \(\theta\)

class TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.ObservationSystemMap(vehicle, par_name_list=[])[source]

Bases: TransportMaps.Maps.Map

Abstract map \(T:\mathbb{R}^{d_x}\rightarrow\mathbb{R}^{d_y}\)

Parameters:
  • dim_in (int) – input dimension

  • dim_out (int) – output dimension

evaluate(x, *args, **kwargs)[source]

[Abstract] Evaluate the map \(T\) at the points \({\bf x} \in \mathbb{R}^{m \times d_x}\).

Parameters:
  • x (ndarray [\(m,d_x\)]) – evaluation points

  • precomp (dict) – dictionary of precomputed values

  • idxs_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 match x.shape[0].

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:
  • x (ndarray [\(m,d_x\)]) – evaluation points

  • precomp (dict) – dictionary of precomputed values

  • idxs_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 match x.shape[0].

Returns:

(ndarray [\(m,d_y,d_x\)]) – transformed points

Raises:

NotImplementedError – to be implemented in sub-classes

class TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.StateSpaceLogLikelihood(y, vehicle, par_name_list=[], init_coeffs=np.zeros(0))[source]

Bases: TransportMaps.Likelihoods.AdditiveConditionallyLinearGaussianLogLikelihood

Define the log-likelihood for the additive linear Gaussian model

The model is

\[{\bf y} = {\bf c}(\theta) + {\bf T}(\theta){\bf x} + \varepsilon \;, \quad \varepsilon \sim \mathcal{N}(\mu(\theta), \Sigma(\theta))\]

where \(T \in \mathbb{R}^{d_y \times d_x}\), \(\mu \in \mathbb{R}^{d_y}\) and \(\Sigma \in \mathbb{R}^{d_y \times d_y}\) is symmetric positve definite

Parameters:
  • y (ndarray [\(d_y\)]) – data

  • c (ndarray [\(d_y\)] or Map) – system constant or parametric map returning the constant

  • T (ndarray [\(d_y,d_x\)] or Map) – system matrix or parametric map returning the system matrix

  • mu (ndarray [\(d_y\)] or Map) – noise mean or parametric map returning the mean

  • covariance (ndarray [\(d_y,d_y\)] or Map) – noise covariance or parametric map returning the covariance

  • precision (ndarray [\(d_y,d_y\)] or Map) – noise precision matrix or parametric map returning the precision matrix

  • active_vars_system (list of int) – active variables identifying the parameters for for \(c(\theta), T(\theta)\).

  • active_vars_distribution (list of int) – active variables identifying the parameters for for \(\mu(\theta), \Sigma(\theta)\).

  • coeffs (ndarray) – initialization coefficients

TransportMaps.Distributions.Examples.RailwayVehicleDynamics.Coradia175.Coradia175VehicleStateSpace.generate_data(nsteps, vehicle, par_name_list=[], par_val_list=np.zeros(0))[source]