Simulate a stochastic or conditional-Gaussian model
Source:R/aci-model.R
simulate.stochastic_model.RdGenerates truth-twin realisations by Euler-Maruyama integration, optionally retaining the hidden path and the driving Wiener increments so that a later ensemble smoother can reuse them.
Usage
# S3 method for class 'stochastic_model'
simulate(
object,
nsim = 1,
seed = NULL,
t_end,
dt,
ic = NULL,
burn_in = 0,
keep_hidden = TRUE,
keep_noise = TRUE,
...
)Arguments
- object
A
stochastic_modelorcgns_modelobject.- nsim
Positive whole number of realisations to generate.
- seed
Optional non-negative whole number seeding the generator. Seeding is contained: an existing
.Random.seedis restored bit for bit when the call returns, so a reproducible path leaves the caller's stream where it was and the next draw is the draw that would have followed no call at all. When no.Random.seedexists, one is created before the seeded draw so that there is a state to restore, and the caller is left holding it. An unseeded call draws from, and advances, the caller's stream as usual.- t_end
Positive 1-length numeric total simulated time, excluding burn-in. Called
Tbefore 0.1.0; that deprecated name remains accepted with a warning. Uset_endin new code.- dt
Positive 1-length numeric integration step.
- ic
Optional list with elements
x0andy0giving the initial state;NULLuses the model's default initial condition.- burn_in
Non-negative 1-length numeric time discarded before recording.
TRUEto retain the hidden path.- keep_noise
TRUEto retain the driving Wiener increments.- ...
Must be empty; unused arguments are an error.
Value
An object of class aci_sim when nsim is one, otherwise a list of
such objects. Its observed trajectory carries the model's own channel
names when meta$vars$observed supplies one unique non-empty name per
observed channel, as the built-in constructors do, so that
aci_conditional()'s given and target can be named straight off a
simulation. The names are labels: no numeric result depends on them.