Models¶
-
class
stonesoup.models.base.
Model
[source]¶ Bases:
stonesoup.base.Base
Model type
Base/Abstract class for all models.
-
abstract property
ndim
¶ Number of dimensions of model
-
abstract property
-
class
stonesoup.models.base.
LinearModel
[source]¶ Bases:
stonesoup.models.base.Model
LinearModel class
Base/Abstract class for all linear models
-
function
(state, noise=False, **kwargs)[source]¶ Model linear function \(f_k(x(k),w(k)) = F_k(x_k) + w_k\)
- Parameters
state (
State
) – An input statenoise (
numpy.ndarray
or bool) – An externally generated random process noise sample (the default is False, in which case no noise will be added if ‘True’, the output ofrvs()
is added)
- Returns
The updated State with the model function evaluated.
- Return type
State
-
-
class
stonesoup.models.base.
NonLinearModel
[source]¶ Bases:
stonesoup.models.base.Model
NonLinearModel class
Base/Abstract class for all non-linear models
-
jacobian
(state, **kwargs)[source]¶ Model jacobian matrix \(H_{jac}\)
- Parameters
state (
State
) – An input state- Returns
The model jacobian matrix evaluated around the given state vector.
- Return type
numpy.ndarray
of shape (ndim_meas
,ndim_state
)
-
abstract
function
(state, noise=False, **kwargs)[source]¶ Model function \(f(t,x(t),w(t))\)
- Parameters
state (
State
) – An input statenoise (
numpy.ndarray
or bool) – An externally generated random process noise sample (the default is False, in which case no noise will be added if ‘True’, the output ofrvs()
is added)
- Returns
The model function evaluated.
- Return type
-
-
class
stonesoup.models.base.
ReversibleModel
[source]¶ Bases:
stonesoup.models.base.NonLinearModel
Non-linear model containing sufficient co-ordinate information such that the linear co-ordinate conversions can be calculated from the non-linear counterparts.
Contains an inverse function which computes the reverse of the relevant linear-to-non-linear function
-
class
stonesoup.models.base.
TimeVariantModel
[source]¶ Bases:
stonesoup.models.base.Model
TimeVariantModel class
Base/Abstract class for all time-variant models
-
class
stonesoup.models.base.
TimeInvariantModel
[source]¶ Bases:
stonesoup.models.base.Model
TimeInvariantModel class
Base/Abstract class for all time-invariant models
-
class
stonesoup.models.base.
GaussianModel
[source]¶ Bases:
stonesoup.models.base.Model
GaussianModel class
Base/Abstract class for all Gaussian models
-
rvs
(num_samples=1, **kwargs)[source]¶ Model noise/sample generation function
Generates noise samples from the model.
In mathematical terms, this can be written as:
\[v_t \sim \mathcal{N}(0,Q)\]where \(v_t =\)
noise
and \(Q\) =covar
.- Parameters
num_samples (scalar, optional) – The number of samples to be generated (the default is 1)
- Returns
noise – A set of Np samples, generated from the model’s noise distribution.
- Return type
2-D array of shape (
ndim
,num_samples
)
-
pdf
(state1, state2, **kwargs)[source]¶ Model pdf/likelihood evaluation function
Evaluates the pdf/likelihood of
state1
, given the statestate2
which is passed tofunction()
.In mathematical terms, this can be written as:
\[p = p(y_t | x_t) = \mathcal{N}(y_t; x_t, Q)\]where \(y_t\) =
state_vector1
, \(x_t\) =state_vector2
and \(Q\) =covar
.- Parameters
- Returns
The likelihood of
state1
, givenstate2
- Return type
-