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: the caller's
.Random.seedis restored when the call returns, so a reproducible path leaves the caller's stream where it was.- t_end
Positive 1-length numeric total simulated time, excluding burn-in. Called
Tbefore 0.1.0; that name is accepted with a warning until 0.2.0.- 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.