pyselfi.lotkavolterra.prior module¶
Routines related to the SELFI prior for time-dependent smooth functions.
- class pyselfi.lotkavolterra.prior.lotkavolterra_prior(t_s, X0, Y0, theta_0, alpha_norm, t_smooth, t_chaos)[source]¶
Bases:
object
This class represents the SELFI prior for time-dependent smooth functions.
The prior is a Gaussian with mean \(\boldsymbol{\theta}_0\) and covariance matrix \(\textbf{S} = \alpha_\mathrm{norm}^2 \textbf{V} \circ \textbf{K}\) (Hadamard product), such that: \(\textbf{K} = \begin{pmatrix} \textbf{K}_x & \textbf{0} \\ \textbf{0} & \textbf{K}_y \end{pmatrix}\), \((\textbf{K}_z)_{ij} = -\dfrac{1}{2} \left( \dfrac{t_i-t_j}{t_\mathrm{smooth}} \right)^2\), \(\textbf{V} = \begin{pmatrix} x_0 \textbf{u}\textbf{u}^\intercal & \textbf{0} \\ \textbf{0} & y_0 \textbf{u}\textbf{u}^\intercal \end{pmatrix}\), \((\textbf{u})_i = 1 + \dfrac{t_i}{t_\mathrm{chaos}}\).
- Variables
t_s (array, double, dimension=S/2) – array of timesteps
theta_0 (array, double, dimension=S) – prior mean and blackbox expansion point
X0 (double) – initial condition (number of prey at t=0)
Y0 (double) – initial condition (number of predators at t=0)
alpha_norm (array, double, dimension=2) – overall amplitude of the prior covariance matrix (prey, predators)
t_smooth (array, double, dimension=2) – typical time parameter for the smoothness prior (prey, predators)
t_chaos (array, double, dimension=2) – typical time parameter for the time-dependent uncertainty (prey, predators)
- _get_covariance()[source]¶
Gets the full prior covariance matrix as \(\textbf{S}\).
- Returns
S – covariance matrix of the prior
- Return type
array, double, dimension=(S,S)
- _get_inverse_covariance()[source]¶
Gets the inverse covariance matrix.
- Returns
inv_S – inverse covariance matrix of the prior
- Return type
array, double, dimension=(S,S)
- _get_rbf()[source]¶
Gets the radial basis function (RBF) part of the prior covariance matrix, \(\textbf{K}\).
- Returns
K – RBF kernel
- Return type
array, double, dimension=(S,S)
- _get_time_variance()[source]¶
Gets the time-dependent part of the prior covariance matrix, \(\textbf{V} = \textbf{u}\textbf{u}^\intercal\).
- Returns
V – time variance matrix
- Return type
array, double, dimension=(S,S)
- property gammaX¶
Defined by \(\gamma_X \equiv 1/(2 t_\mathrm{smooth}[0]^2)\).
- Type
double
- property gammaY¶
Defined by \(\gamma_Y \equiv 1/(2 t_\mathrm{smooth}[1]^2)\).
- Type
double
- classmethod load(fname)[source]¶
Loads the prior from an input file.
- Parameters
fname (
str
) – input filename- Returns
prior – loaded prior object
- Return type
prior