Generic reconstructing the hidden state from the observed record up to each
time. The closed-form method is used for a cgns_model; a general
stochastic_model is out of scope in this release.
Usage
aci_filter(model, obs, ...)
# S3 method for class 'cgns_model'
aci_filter(
model,
obs,
init = NULL,
conditional = NULL,
stepper = c("explicit", "implicit"),
nsub = 1L,
regularize = NULL,
loglik = TRUE,
...
)
# S3 method for class 'stochastic_model'
aci_filter(model, obs, ...)Arguments
- model
A
cgns_modelorstochastic_modelobject.- obs
An observed trajectory, or anything
as_obs()accepts.- ...
Arguments passed to methods.
- init
Optional list with the initial hidden
meanandcov;NULLuses a diffuse prior and warns.- conditional
Optional
aci_conditional_specselecting a conditional ACI reduction; seeaci_conditional().- stepper
Either
"explicit"or"implicit"; the implicit Riccati step preserves positivity.- nsub
Positive whole number of sub-steps taken per observation.
- regularize
Covariance policy for this call.
"none"(the default, and the value ofgetOption("aci.regularize")when it is unset) stops with a classedaci_error_covariance_not_spdnaming the site, grid index and time as soon as a covariance leaves the positive-definite cone."floor"is the previous behaviour: the covariance is projected back byspd_floor()and every such event is recorded in the result'smeta$regularization.- loglik
TRUE(the default) accumulates the predictive log-likelihood intometa$loglik.FALSEskips that work; the filter moments are unchanged andmeta$loglikisNULL. The likelihood is not used by ACI, soFALSEis the cheaper choice when only the state estimate is wanted.
Value
An assimilation path: da_path_gaussian for the closed-form engine.
Its meta$loglik holds the predictive log-likelihood of the observed
record, or NULL when the method was called with loglik = FALSE.
Methods (by class)
aci_filter(cgns_model): Closed-form filter for a conditional-Gaussian model.aci_filter(stochastic_model): Classed not-implemented condition for a general (non-CGNS) stochastic model.
Examples
m <- aci_dyad_model()
sim <- simulate(m, seed = 1, t_end = 2, dt = 0.01)
ob <- as_obs(sim)
f <- aci_filter(m, ob)
#> Warning: No init$cov supplied; using a diffuse prior. Discard an initial burn-in window when interpreting results.
f
#> <da_path_gaussian> kind = filter, l = 1, N+1 = 201