Skip to contents

Generates shocks z_t = sigma_t * eps_t with a persistent AR(1) log-variance, for use as sim_psy1(..., e = sim_vol_sv(...)).

Usage

sim_vol_sv(n, phi = 0.98, tau = 0.1, log_sigma0_sq = 0, seed = NULL)

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

$$\log\sigma_t^2 = \phi\log\sigma_{t-1}^2 + \eta_t,\quad \eta_t \sim iid\, N(0, \tau^2)$$

with phi close to, but below, 1 for the "double local-to-unity" near-integrated-variance case studied in the source.

References

Sarkar, A. & Wells, M.T. (2025). "Double Local-to-Unity." arXiv:2512.06823.

See also

Examples

sim_vol_sv(199, seed = 1) %>%
  autoplot()