Constructs a conditional-Gaussian nonlinear system, in which the observed drift is affine in the hidden state and the hidden drift is linear in it, so that the conditional statistics of the hidden component are Gaussian in closed form. The noise is described by up to two shared Wiener channels, so that correlated observation and signal noise can be represented.
Usage
aci_model(
Lx,
fx,
Ly,
fy,
Sx1,
Sx2 = NULL,
Sy1 = NULL,
Sy2,
k,
l,
name = NULL,
meta = list()
)Arguments
- Lx
Function of
(t, x)giving the coupling of the hidden state into the observed drift, akbylmatrix.- fx
Function of
(t, x)giving the remaining observed drift.- Ly
Function of
(t, x)giving the hidden self-drift, anlbylmatrix.- fy
Function of
(t, x)giving the remaining hidden drift.- Sx1
Function of
(t, x)giving the observed diffusion on the first Wiener channel.- Sx2
Optional function of
(t, x)giving the observed diffusion on the second Wiener channel;NULLis a zero block matched toSy2.- Sy1
Optional function of
(t, x)giving the hidden diffusion on the first Wiener channel;NULLis a zero block matched toSx1.- Sy2
Function of
(t, x)giving the hidden diffusion on the second Wiener channel.- k
Observed dimension; a positive whole number.
- l
Hidden dimension; a positive whole number.
- name
Optional 1-length character label for the model.
- meta
Optional named list of metadata carried on the object.
Details
CGNS coefficient functions are mathematical coefficients: for a
fixed (t, x) they must return deterministic values with stable shapes and
diffusion-channel counts. Random-number generation or result-changing
mutable state inside a coefficient function is outside the model contract.
Closed-form execution may realise each coefficient once on the observation
grid and reuse that realised path.
A model is fixed once constructed. Its derived drifts capture the
coefficient functions supplied to the constructor, so assigning a new
coefficient into an existing model changes only the field assigned and
leaves simulation, filtering and every realised path on the original
coefficients. Change a parameter by rebuilding the model with
aci_model(), not by modifying one.
Examples
aci_model(
Lx = function(t, x) matrix(1, 1, 1),
fx = function(t, x) -0.5 * x,
Ly = function(t, x) matrix(-0.5, 1, 1),
fy = function(t, x) 0,
Sx1 = function(t, x) matrix(0.5, 1, 1),
Sy2 = function(t, x) matrix(1, 1, 1),
k = 1, l = 1)
#> <cgns_model> 'cgns_model': k = 1 observed, l = 1 hidden
# Coefficients are fixed for the model's lifetime: change a parameter by
# rebuilding, not by assigning into an existing model.
make_dyadish <- function(lambda)
aci_model(Lx = function(t, x) matrix(1, 1, 1),
fx = function(t, x) lambda * x,
Ly = function(t, x) matrix(-0.5, 1, 1),
fy = function(t, x) 0,
Sx1 = function(t, x) matrix(0.5, 1, 1),
Sy2 = function(t, x) matrix(1, 1, 1),
k = 1, l = 1)
m_a <- make_dyadish(-0.5)
m_b <- make_dyadish(-1)