Simulation
Simulate AR(1) lognormal stochastic-volatility innovations
sim_vol_sv sim_vol_sv(n, phi = 0.98, tau = 0.1, log_sigma0_sq = 0, seed = NULL) Generates shocks z_t = sigma_t * eps_t with a persistent AR(1) log-variance, for use as sim_psy1(..., e = sim_vol_sv(...)).
Arguments
| n | Number of innovations to generate. |
| phi | AR(1) log-variance persistence, in (0, 1). |
| tau | Positive standard deviation of the log-variance innovations. |
| log_sigma0_sq | Starting value of log(sigma^2). Defaults to 0. |
| seed | An object specifying if and how the random number generator (rng)
should be initialized. It is either NULL or an integer, which is passed to
set.seed before the simulation. If you set it, the value is saved as the
"seed" attribute of the returned value. The default, NULL, leaves the state of
the rng unchanged and returns .Random.seed as the "seed" attribute. Results are
reproducible across the parallel and the non-parallel option when you use the
same seed. |
Value
A numeric vector of length n.
Details
with phi close to, but below, 1 for the "double local-to-unity" near-integrated-variance case studied in the source.
Examples
These examples are copied from the package's own documentation and are run by R CMD check on every release.
The printed output (after #>) and the plots were produced by running them against the current package source.
sim_vol_sv(199, seed = 1) %>%
autoplot() See also
References
Sarkar, A. & Wells, M.T. (2025). "Double Local-to-Unity." arXiv:2512.06823.
exuber