Skip to content
exuber

Simulation

Simulate fractionally-integrated (long-memory) innovations

sim_fi
sim_fi(n, d = 0.2, sigma = 1, seed = NULL)

Generates ut=Δ−dϵtu_t = \Delta^{-d}\epsilon_t, with ϵt\epsilon_t i.i.d. (0,σ2)(0, \sigma^2), through a truncated MA(∞)MA(\infty) expansion of the fractional-differencing operator, for use as sim_psy1(..., e = sim_fi(...)).

Arguments

n Number of innovations to generate.
d Long-memory (fractional differencing) parameter, in (0, 0.5) so that utu_t itself is stationary.
sigma A positive scalar indicating the standard deviation of the innovations.
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

Δ−d=∑j=0∞ψjLj,ψ0=1,ψj=ψj−1j−1+dj\Delta^{-d} = \sum_{j=0}^\infty \psi_j L^j,\quad \psi_0 = 1,\quad \psi_j = \psi_{j-1}\frac{j-1+d}{j}

The expansion is truncated at max(200, n) lags with a matching burn-in, which is dropped before the function returns, to limit the truncation bias in the early observations.

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_fi(199, d = 0.2, seed = 1) %>%
  autoplot()
Plot from the sim_fi example

See also

sim_psy1

References

Lui, Y.L., Phillips, P.C.B. & Yu, J. (2024). "Robust testing for explosive behavior with strongly dependent errors."