simulate.vlmc {VLMC} | R Documentation |
Simulate a Discrete Time Series from fitted VLMC model
Description
Simulate from fitted VLMC model – basis of the VLMC bootstrap
Usage
## S3 method for class 'vlmc'
simulate(object, nsim = 1, seed = NULL, n,
n.start = 64 * object$size[["context"]],
integer.return = FALSE, keep.RSeed = TRUE, ...)
Arguments
object |
typically the result of |
nsim , n |
non-negative integer, giving the length of the result.
Note that |
seed |
random seed initializer; see |
n.start |
the number of initial values to be discarded (because of initial effects). |
integer.return |
logical; if |
keep.RSeed |
logical indicating if the seed should be stored with
the result (as ‘required’ by the generic
|
... |
(potentially further arguments for other |
Details
The .Random.seed
is used and updated as with other random
number generation routines such as rbinom
.
Note that if you want to simulate from a given start sequence
x0
, you'd use predict.vlmc(x, x0, type= "response")
— actually not quite yet.
Value
A "simulate.vlmc"
object, basically a vector of length
nsim
. Either integer
or character
,
depending on the integer.return
argument, see above. Further,
if keep.RSeed
was true (as by default), a "seed"
attribute
with the random seed at the start of the simulation, for reproducibility.
Author(s)
Martin Maechler
See Also
vlmc
and predict.vlmc
.
Examples
example(vlmc)
simulate(vlmc.dt1, 100)
simulate(vlmc.dt1c01, 100, int = TRUE)
# n.start = 0: 1st few observations will resemble the data
simulate(vlmc.dt1c01, 20, n.start=0, int = TRUE)